Rollup of 15 pull requests#159316
Conversation
Previously, the lint might suggested using interior mutable type even if it the compiler already decides that the referenced type is interior mutable, while it didn't give such suggestion when the referenced type is considered non-interior mutable. This commit refined the logic as follow: if the referenced type is not interior mutable, then suggests using types with interior mutability; otherwise, suggests removing `mut` if the reference is a *shared* reference. Note that in the latter case, compiler might be silent if the span of the `static mut` definition is not appropriate for suggestions (e.g., comes from macro expansion).
For cases like `&a` or `&mut a`, we only leave a subdiagnostic to suggest user to use raw borrow operators. Using raw pointers in such cases are also equally viable solution but it's not appropriate to suggest using interior mutable types at the same time.
The "can also not" phrasing was slightly awkward, so rephrase this sentence.
Document the built-in `inline` attribute in the standard library using the `#[doc(attribute = "...")]` mechanism, following the existing `must_use` attribute documentation.
```
error: lifetime may not live long enough
--> $DIR/higher-ranked-return.rs:11:46
|
LL | let x = async move |x: &str| -> &str {
| ________________________________-________-____^
| | | |
| | | let's call the lifetime of this reference `'2`
| | let's call the lifetime of this reference `'1`
LL | | x
LL | | };
| |_________^ returning this value requires that `'1` must outlive `'2`
```
instead of
```
error: lifetime may not live long enough
--> $DIR/higher-ranked-return.rs:11:46
|
LL | let x = async move |x: &str| -> &str {
| ________________________________-________----_^
| | | |
| | | return type of async closure `{async closure body@$DIR/higher-ranked-return.rs:11:46: 13:10}` contains a lifetime `'2`
| | let's call the lifetime of this reference `'1`
LL | | x
LL | | };
| |_________^ returning this value requires that `'1` must outlive `'2`
```
GetSystemInfo reports only the primary processor group's CPU count. Before Windows 11 and Windows Server 2022 a process was confined to one group by default, so that count matched what it could use; since then processes span all groups by default, so it can undercount the parallelism available.
* add rustc_no_writable no mem::forget and structs it uses * rename test file * apply #[rustc_no_writable] to transmute_prefix and transmute_neo
Co-authored-by: Gwen Mittertreiner <gmtr@google.com>
…=Mark-Simulacrum Add 1.97.1 release notes This is a forward port of the release notes that landed on the stable branch. We need this on main for triagebot's GitHub release to happen as expected. r? me
…ge, r=nia-e Implement `VecDeque::truncate_to_range` Tracking issue: rust-lang#156215
Implement `#[diagnostic::opaque]` attribute to hide backtraces of macros. r? @estebank There are some more places where we can use this, for example https://github.com/rust-lang/rust/blob/345632878cffcb4c8e90750e943296b43d16c76e/compiler/rustc_trait_selection/src/error_reporting/traits/fulfillment_errors.rs#L623-L639 but those turned out to be a little complicated so are left for followup prs. Tracking issue: rust-lang#158813
Fix static_mut_refs lint check logic This PR fixes issue rust-lang#158735. Previously, the lint might suggested using interior mutable type even if it the compiler already decides that the referenced type is interior mutable, while it didn't give such suggestion when the referenced type is considered non-interior mutable. This commit refined the logic as follow: if the referenced type is not interior mutable, then suggests using types with interior mutability; otherwise, suggests removing `mut` if the reference is a *shared* reference. Note that in the latter case, compiler might be silent if the span of the `static mut` definition is not appropriate for suggestions (e.g., comes from macro expansion). r? @RalfJung
…ion_parent, r=petrochenkov resolve: Inherit eager invocation parents Fixes rust-lang#159233 `format!` eagerly expands its first arg. In this case that path ran into a glob delegation from `fn_delegation`, and resolver tried to read `invocation_parents[invoc_id]` for an eager invocation that never went through reduced-graph collection. So a bad input got an ICE instead of normal errors. This makes eager invocations copy `InvocationParent` from the eager expansion root, matching the parent-scope fallback already there. imo this is the right place to fix it: idk of a cleaner split where the scope and parent def do not drift apart. fyi the UI regression is the reported case, btw, and it still emits the expected user-facing errors without the panic.
…ngjubilee
Account for async closures when pointing at lifetime in return type
```
error: lifetime may not live long enough
--> $DIR/higher-ranked-return.rs:11:46
|
LL | let x = async move |x: &str| -> &str {
| ________________________________-________-____^
| | | |
| | | let's call the lifetime of this reference `'2`
| | let's call the lifetime of this reference `'1`
LL | | x
LL | | };
| |_________^ returning this value requires that `'1` must outlive `'2`
```
instead of
```
error: lifetime may not live long enough
--> $DIR/higher-ranked-return.rs:11:46
|
LL | let x = async move |x: &str| -> &str {
| ________________________________-________----_^
| | | |
| | | return type of async closure `{async closure body@$DIR/higher-ranked-return.rs:11:46: 13:10}` contains a lifetime `'2`
| | let's call the lifetime of this reference `'1`
LL | | x
LL | | };
| |_________^ returning this value requires that `'1` must outlive `'2`
```
…ingjubilee cleanup: upstream dropped AMX-TF32 LLVM recently dropped x86 AMX-TF32 llvm/llvm-project#207673. This is a re-upload of [rust-lang#158910](rust-lang#158910) as the author is out on vacation for this week. I've also removed the leftover references to amx-tf32 that were missed in the original PR which caused it to fail the roll up. r? @durin42
… r=GuillaumeGomez Add documentation for the `inline` attribute Document the built-in `inline` attribute in the standard library using the `#[doc(attribute = "...")]` mechanism, following rust-lang#157957 (`must_use`). Part of rust-lang#157604 r? @GuillaumeGomez Tested with `./x test library/std --doc --test-args attribute_docs`.
This comment has been minimized.
This comment has been minimized.
Rollup of 15 pull requests try-job: dist-various-1 try-job: test-various try-job: x86_64-gnu-aux try-job: x86_64-gnu-llvm-21-3 try-job: x86_64-msvc-1 try-job: aarch64-apple try-job: x86_64-mingw-1 try-job: i686-msvc-*
|
@bors p=6 note="ahead of release notes, which is included" |
This comment has been minimized.
This comment has been minimized.
What is this?This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.Comparing 470556c (parent) -> 47101ad (this PR) Test differencesShow 733 test diffsStage 1
Stage 2
Additionally, 690 doctest diffs were found. These are ignored, as they are noisy. Job group index
Test dashboardRun cargo run --manifest-path src/ci/citool/Cargo.toml -- \
test-dashboard 47101adcea71daee3c2879218f5b883bcdf180aa --output-dir test-dashboardAnd then open Job duration changes
How to interpret the job duration changes?Job durations can vary a lot, based on the actual runner instance |
|
📌 Perf builds for each rolled up PR:
previous master: 470556c8c1 In the case of a perf regression, run the following command for each PR you suspect might be the cause: |
|
Finished benchmarking commit (47101ad): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis perf run didn't have relevant results for this metric. Max RSS (memory usage)Results (primary 2.4%, secondary 0.2%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (secondary -1.5%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis perf run didn't have relevant results for this metric. Bootstrap: 490.163s -> 491.257s (0.22%) |
Successful merges:
VecDeque::truncate_to_range#156220 (ImplementVecDeque::truncate_to_range)#[diagnostic::opaque]attribute to hide backtraces of macros. #158608 (Implement#[diagnostic::opaque]attribute to hide backtraces of macros.)inlineattribute #158348 (Add documentation for theinlineattribute)PrivateItemswithstd_internalsunstable feature. #159191 (MarkPrivateItemswithstd_internalsunstable feature.)r? @ghost
Create a similar rollup