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;
|
|
|
|
}
|