-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
large_assignments: Unactionable diagnostics with -Zinline-mir #121672
Copy link
Copy link
Open
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.A-mir-opt-inliningArea: MIR inliningArea: MIR inliningC-bugCategory: This is a bug.Category: This is a bug.D-confusingDiagnostics: Confusing error or lint that should be reworked.Diagnostics: Confusing error or lint that should be reworked.L-large_assignmentsLint: large_assignmentsLint: large_assignmentsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.requires-nightlyThis issue requires a nightly compiler in some way. When possible, use a F-* label instead.This issue requires a nightly compiler in some way. When possible, use a F-* label instead.
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.A-mir-opt-inliningArea: MIR inliningArea: MIR inliningC-bugCategory: This is a bug.Category: This is a bug.D-confusingDiagnostics: Confusing error or lint that should be reworked.Diagnostics: Confusing error or lint that should be reworked.L-large_assignmentsLint: large_assignmentsLint: large_assignmentsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.requires-nightlyThis issue requires a nightly compiler in some way. When possible, use a F-* label instead.This issue requires a nightly compiler in some way. When possible, use a F-* label instead.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Tracking issue #83518.
Doing
cargo build --releasewill activate-Zinline-mirunder the hood (through-Copt-level=3). But it makeslarge_assignmentsdiagnostics unhelpful, because it can make diagnostics point to library code that the user can't change.How to reproduce
src/main.rs
# One of: cargo +nightly build --release cargo +nightly rustc -- -Zmir-opt-level=1 -Zinline-mirActual
Compiling minimal v0.1.0 (/home/martin/src/bin) error: moving 9999 bytes --> /home/martin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/cell.rs:2054:9 | 2054 | UnsafeCell { value } | ^^^^^^^^^^^^^^^^^^^^ value moved from here |Expected
Remarks
The expected diagnostics is given with these commands. Note how
-Zinline-miris deactivated in both cases:# One of: cargo +nightly build cargo +nightly rustc -- -Zmir-opt-level=1The above test case is ui-testified here.
CC E-mentor @oli-obk who maybe have an idea on how to fix this? (I currently don't.)