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