-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
-Zmir-opt-level=2 misoptimises valid code under Tree Borrows #110947
Copy link
Copy link
Closed
Labels
A-mir-optArea: MIR optimizationsArea: MIR optimizationsA-rustlantisArea: A miscompilation found by RustlantisArea: A miscompilation found by RustlantisC-bugCategory: This is a bug.Category: This is a bug.I-unsoundIssue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/SoundnessIssue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/Soundness
Metadata
Metadata
Assignees
Labels
A-mir-optArea: MIR optimizationsArea: MIR optimizationsA-rustlantisArea: A miscompilation found by RustlantisArea: A miscompilation found by RustlantisC-bugCategory: This is a bug.Category: This is a bug.I-unsoundIssue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/SoundnessIssue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/Soundness
Type
Fields
Give feedbackNo fields configured for issues without a type.
This code has UB under Stacked Borrows in Miri, but is fine with
-Zmiri-tree-borrows, and it should printfalseHowever, under
-Zmir-opt-level=2and above, it printstrueMeta
rustc --version --verbose:cc @Vanille-N @RalfJung