Dylan DPC [Mon, 28 Mar 2022 14:08:10 +0000 (16:08 +0200)]
Rollup merge of #95370 - jyn514:less-verbose-skips, r=Dylan-DPC
[bootstrap] Don't print `Suite not skipped` unless `--verbose` is set
This was so verbose before that it made it hard to see what effect the flag actually had.
Before:
```
Set({test::src/tools/tidy}) not skipped for "bootstrap::test::Tidy" -- not in [src/test/ui, src/test/mir-opt/, src/test/debuginfo, src/test/ui-fulldeps]
Skipping Suite(test::src/test/ui) because it is excluded
Suite(test::src/test/run-pass-valgrind) not skipped for "bootstrap::test::RunPassValgrind" -- not in [src/test/ui, src/test/mir-opt/, src/test/debuginfo, src/test/ui-fulldeps]
Skipping Suite(test::src/test/mir-opt) because it is excluded
Suite(test::src/test/codegen) not skipped for "bootstrap::test::Codegen" -- not in [src/test/ui, src/test/mir-opt/, src/test/debuginfo, src/test/ui-fulldeps]
Suite(test::src/test/codegen-units) not skipped for "bootstrap::test::CodegenUnits" -- not in [src/test/ui, src/test/mir-opt/, src/test/debuginfo, src/test/ui-fulldeps]
Suite(test::src/test/assembly) not skipped for "bootstrap::test::Assembly" -- not in [src/test/ui, src/test/mir-opt/, src/test/debuginfo, src/test/ui-fulldeps]
Suite(test::src/test/incremental) not skipped for "bootstrap::test::Incremental" -- not in [src/test/ui, src/test/mir-opt/, src/test/debuginfo, src/test/ui-fulldeps]
Skipping Suite(test::src/test/debuginfo) because it is excluded
Skipping Suite(test::src/test/ui-fulldeps) because it is excluded
... about 100 more lines ...
```
After:
```
Skipping Suite(test::src/test/ui) because it is excluded
Skipping Suite(test::src/test/mir-opt) because it is excluded
Skipping Suite(test::src/test/debuginfo) because it is excluded
Skipping Suite(test::src/test/ui-fulldeps) because it is excluded
```
Dylan DPC [Mon, 28 Mar 2022 14:08:08 +0000 (16:08 +0200)]
Rollup merge of #95314 - c410-f3r:aqui-vamos-nos, r=lcnr
Tell users that `||` operators are not currently supported in let chain expressions
Tells that `||` operators are not currently supported instead of not allowed. See https://github.com/rust-lang/rust/issues/53667#issuecomment-1066075876
Dylan DPC [Mon, 28 Mar 2022 14:08:07 +0000 (16:08 +0200)]
Rollup merge of #95301 - nnethercote:rm-NtTT, r=petrochenkov
Remove `Nonterminal::NtTT`.
It's only needed for macro expansion, not as a general element in the
AST. This commit removes it, adds `NtOrTt` for the parser and macro
expansion cases, and renames the variants in `NamedMatch` to better
match the new type.
bors [Mon, 28 Mar 2022 05:48:25 +0000 (05:48 +0000)]
Auto merge of #95300 - workingjubilee:less-bitsets, r=eddyb
Skip needless bitset for debuginfo
Found this while digging around looking at the inlining logic.
Seemed obvious enough so I decided to try to take care of it.
Is this what you had in mind, `@eddyb?`
bors [Mon, 28 Mar 2022 02:29:06 +0000 (02:29 +0000)]
Auto merge of #95393 - Dylan-DPC:rollup-l72f39g, r=Dylan-DPC
Rollup of 4 pull requests
Successful merges:
- #88375 (Clarify that ManuallyDrop<T> has same layout as T)
- #93755 (Allow comparing `Vec`s with different allocators using `==`)
- #95016 (Docs: make Vec::from_raw_parts documentation less strict)
- #95098 (impl From<&[T; N]> and From<&mut [T; N]> for Vec<T>)
Dylan DPC [Mon, 28 Mar 2022 02:12:10 +0000 (04:12 +0200)]
Rollup merge of #95016 - janpaul123:patch-1, r=dtolnay
Docs: make Vec::from_raw_parts documentation less strict
This is my first PR; be gentle!
In https://users.rust-lang.org/t/why-does-vec-from-raw-parts-require-same-size-and-not-same-size-capacity/73036/2?u=janpaul123 it was suggested to me that I should make a PR to make the documentation of `Vec::from_raw_parts` less strict, since we don't require `T` to have the same size, just `size_of::<T>() * capacity` to be the same, since that is what results in `Layout::size` being the same in `dealloc`, which is really what matters.
Also in https://users.rust-lang.org/t/why-does-vec-from-raw-parts-require-same-size-and-not-same-size-capacity/73036/8?u=janpaul123 it was suggested that it's better to use `slice::from_raw_parts`, which I think is useful advise that could also be mentioned in the docs, so I added that too.
I did not changed the `PartialOrd` impl too because it was not generic already (didn't support `Vec<T> <=> Vec<U> where T: PartialOrd<U>`).
Does it needs tests?
I don't think this will hurt type inference much because the default allocator is usually not inferred (`new()` specifies it directly, and even with other allocators, you pass the allocator to `new_in()` so the compiler usually knows the type).
I think this requires FCP since the impls are already stable.
Dylan DPC [Mon, 28 Mar 2022 02:12:09 +0000 (04:12 +0200)]
Rollup merge of #88375 - joshlf:patch-3, r=dtolnay
Clarify that ManuallyDrop<T> has same layout as T
This PR implements the documentation change under discussion in https://github.com/rust-lang/unsafe-code-guidelines/issues/302. It should not be approved or merged until the discussion there is resolved.
It's only needed for macro expansion, not as a general element in the
AST. This commit removes it, adds `NtOrTt` for the parser and macro
expansion cases, and renames the variants in `NamedMatch` to better
match the new type.
bors [Sun, 27 Mar 2022 21:36:42 +0000 (21:36 +0000)]
Auto merge of #95382 - Dylan-DPC:rollup-bebyfd1, r=Dylan-DPC
Rollup of 5 pull requests
Successful merges:
- #94939 (diagnostics: suggest missing comma in bad FRU syntax)
- #95120 (Implement `apply_switch_int_edge_effects` for backward analyses)
- #95364 (Add long error explanation for E0667)
- #95366 (Remove test files with duplicated checksums)
- #95368 (Fix typo in `String::try_reserve_exact` docs)
Dylan DPC [Sun, 27 Mar 2022 20:51:42 +0000 (22:51 +0200)]
Rollup merge of #95368 - lopopolo:lopopolo/string-try-reserve-exact-doc-typo, r=Dylan-DPC
Fix typo in `String::try_reserve_exact` docs
Copying the pattern from `Vec::try_reserve_exact` and `String::try_reserve`,
it looks like this doc comment is intending to refer to the currently-being-documented
function.
bors [Sun, 27 Mar 2022 18:55:58 +0000 (18:55 +0000)]
Auto merge of #94495 - estebank:missing-closing-gt, r=jackh726
Provide suggestion for missing `>` in a type parameter list
When encountering an inproperly terminated type parameter list, provide
a suggestion to close it after the last non-constraint type parameter
that was successfully parsed.
bors [Sun, 27 Mar 2022 16:36:05 +0000 (16:36 +0000)]
Auto merge of #95345 - dtolnay:escape0, r=Dylan-DPC
Debug print char 0 as '\0' rather than '\u{0}'
```rust
println!("{:?}", "foo\0");
```
- **Before:** `"foo\u{0}"`
- **After:** `"foo\0"`
```rust
println!("{:?}", '\0');
```
- **Before:** `'\u{0}'`
- **After:** `'\0'`
`'\0'` will be more recognizable to everyone than `'\u{0}'` because it's how we talk about character 0 in all of our docs and example code, such as https://doc.rust-lang.org/std/ffi/index.html, https://doc.rust-lang.org/std/ffi/struct.CStr.html, https://doc.rust-lang.org/std/ffi/struct.CString.html.
Joshua Nelson [Sun, 27 Mar 2022 15:11:02 +0000 (10:11 -0500)]
[bootstrap] Don't print `Suite not skipped` unless `--verbose` is set
This was so verbose before that it made it hard to see what effect the flag actually had.
Before:
```
Set({test::src/tools/tidy}) not skipped for "bootstrap::test::Tidy" -- not in [src/test/ui, src/test/mir-opt/, src/test/debuginfo, src/test/ui-fulldeps]
Skipping Suite(test::src/test/ui) because it is excluded
Suite(test::src/test/run-pass-valgrind) not skipped for "bootstrap::test::RunPassValgrind" -- not in [src/test/ui, src/test/mir-opt/, src/test/debuginfo, src/test/ui-fulldeps]
Skipping Suite(test::src/test/mir-opt) because it is excluded
Suite(test::src/test/codegen) not skipped for "bootstrap::test::Codegen" -- not in [src/test/ui, src/test/mir-opt/, src/test/debuginfo, src/test/ui-fulldeps]
Suite(test::src/test/codegen-units) not skipped for "bootstrap::test::CodegenUnits" -- not in [src/test/ui, src/test/mir-opt/, src/test/debuginfo, src/test/ui-fulldeps]
Suite(test::src/test/assembly) not skipped for "bootstrap::test::Assembly" -- not in [src/test/ui, src/test/mir-opt/, src/test/debuginfo, src/test/ui-fulldeps]
Suite(test::src/test/incremental) not skipped for "bootstrap::test::Incremental" -- not in [src/test/ui, src/test/mir-opt/, src/test/debuginfo, src/test/ui-fulldeps]
Skipping Suite(test::src/test/debuginfo) because it is excluded
Skipping Suite(test::src/test/ui-fulldeps) because it is excluded
... about 100 more lines ...
```
After:
```
Skipping Suite(test::src/test/ui) because it is excluded
Skipping Suite(test::src/test/mir-opt) because it is excluded
Skipping Suite(test::src/test/debuginfo) because it is excluded
Skipping Suite(test::src/test/ui-fulldeps) because it is excluded
```
Ryan Lopopolo [Sun, 27 Mar 2022 13:53:55 +0000 (06:53 -0700)]
Fix typo in `String::try_reserve_exact` docs
Copying the pattern from `Vec::try_reserve_exact` and `String::try_reserve`,
it looks like this doc comment is intending to refer to the currently-being-documented
function.
I need this in order to pick up https://github.com/BurntSushi/ripgrep/pull/1722, which picked up https://github.com/BurntSushi/bstr/pull/58, which unblocks https://github.com/rust-lang/rust/pull/95345. Ripgrep uses the Debug representation of a `BStr` in some of its tests. In old versions of bstr, that used to just use the standard library's `escape_debug()` implementation, so the output ends up being sensitive to whether the standard library renders character 0 as `\u{0}` or as `\0`. The newer bstr always renders character 0 as `\0` and ripgrep's test suite has been correspondingly updated.
bors [Sun, 27 Mar 2022 04:20:07 +0000 (04:20 +0000)]
Auto merge of #95351 - Dylan-DPC:rollup-o1il7tx, r=Dylan-DPC
Rollup of 5 pull requests
Successful merges:
- #91981 (Recover suggestions and useful information lost in previous PR)
- #93469 (Skip pointing out ambiguous impls in alloc/std crates too in inference errors)
- #95335 (Move resolve_path to rustc_builtin_macros and make it private)
- #95340 (interpret: with enforce_number_validity, ensure integers are truly Scalar::Int (i.e., no pointers))
- #95341 (ARMv6K Horizon OS has_thread_local support)
Dylan DPC [Sun, 27 Mar 2022 03:36:11 +0000 (05:36 +0200)]
Rollup merge of #95341 - Meziu:armv6k-3ds-target, r=nagisa
ARMv6K Horizon OS has_thread_local support
cc. ```@ian-h-chamberlain```
cc. ```@AzureMarker```
Being an ARM target, it has always had built-in support for `#[thread_local]`. This PR comes in just now because we were testing `std::thread` support with `thread_local_dtor`s. This will hopefully be the last PR for the target specification, unless anymore features will be needed as time goes on.
Dylan DPC [Sun, 27 Mar 2022 03:36:08 +0000 (05:36 +0200)]
Rollup merge of #93469 - compiler-errors:issue-93450, r=estebank
Skip pointing out ambiguous impls in alloc/std crates too in inference errors
This generalizes the logic in `annotate_source_of_ambiguity` to skip printing ambiguity errors traits in `alloc` and `std` as well, not just `core`.
While this does spot-fix the issue mentioned below, it would be nicer to generalize this logic, for example to detect when the trait predicate's `self_ty` has any numerical inference variables. Is it worthwhile to scrap this solution for one like that?
Esteban Kuber [Tue, 1 Mar 2022 19:40:48 +0000 (19:40 +0000)]
Provide suggestion for missing `>` in a type parameter list
When encountering an inproperly terminated type parameter list, provide
a suggestion to close it after the last non-constraint type parameter
that was successfully parsed.
bors [Sat, 26 Mar 2022 00:54:54 +0000 (00:54 +0000)]
Auto merge of #95149 - cjgillot:once-diag, r=estebank
Remove `Session::one_time_diagnostic`
This is untracked mutable state, which modified the behaviour of queries.
It was used for 2 things: some full-blown errors, but mostly for lint declaration notes ("the lint level is defined here" notes).
It is replaced by the diagnostic deduplication infra which already exists in the diagnostic emitter.
A new diagnostic level `OnceNote` is introduced specifically for lint notes, to deduplicate subdiagnostics.
As a drive-by, diagnostic emission takes a `&mut` to allow dropping the `SubDiagnostic`s.