mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 17:24:06 +00:00
dc6def3042
This test extracts a fragment of `issue-84561.rs` that has historically proven troublesome when trying to modify how spans are extracted from MIR.
23 lines
486 B
Rust
23 lines
486 B
Rust
//@ edition: 2021
|
|
|
|
use core::hint::black_box;
|
|
|
|
#[derive(Debug, PartialEq)]
|
|
struct Foo(u32);
|
|
|
|
fn main() {
|
|
assert_ne!(
|
|
Foo(5), // Make sure this expression's span isn't lost.
|
|
if black_box(false) {
|
|
Foo(0) //
|
|
} else {
|
|
Foo(1) //
|
|
}
|
|
);
|
|
()
|
|
}
|
|
|
|
// This test is a short fragment extracted from `issue-84561.rs`, highlighting
|
|
// a particular span of code that can easily be lost if overlapping spans are
|
|
// processed incorrectly.
|