2023-06-08 09:18:34 +02:00
|
|
|
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
|
2022-10-07 01:11:06 +02:00
|
|
|
// unit-test: DataflowConstProp
|
|
|
|
|
|
|
|
#[inline(never)]
|
|
|
|
fn escape<T>(x: &T) {}
|
|
|
|
|
2022-10-07 01:17:43 +02:00
|
|
|
#[inline(never)]
|
|
|
|
fn some_function() {}
|
|
|
|
|
2022-10-07 01:11:06 +02:00
|
|
|
// EMIT_MIR ref_without_sb.main.DataflowConstProp.diff
|
|
|
|
fn main() {
|
|
|
|
let mut a = 0;
|
|
|
|
escape(&a);
|
|
|
|
a = 1;
|
2022-10-07 01:17:43 +02:00
|
|
|
some_function();
|
2022-11-09 18:03:30 +01:00
|
|
|
// This should currently not be propagated.
|
2022-10-07 01:11:06 +02:00
|
|
|
let b = a;
|
|
|
|
}
|