summaryrefslogtreecommitdiffstats
path: root/src/test/mir-opt/const_prop/mutable_variable_unprop_assign.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/mir-opt/const_prop/mutable_variable_unprop_assign.rs')
-rw-r--r--src/test/mir-opt/const_prop/mutable_variable_unprop_assign.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/test/mir-opt/const_prop/mutable_variable_unprop_assign.rs b/src/test/mir-opt/const_prop/mutable_variable_unprop_assign.rs
new file mode 100644
index 000000000..13f1b3f47
--- /dev/null
+++ b/src/test/mir-opt/const_prop/mutable_variable_unprop_assign.rs
@@ -0,0 +1,15 @@
+// compile-flags: -O
+
+// EMIT_MIR mutable_variable_unprop_assign.main.ConstProp.diff
+fn main() {
+ let a = foo();
+ let mut x: (i32, i32) = (1, 2);
+ x.1 = a;
+ let y = x.1;
+ let z = x.0; // this could theoretically be allowed, but we can't handle it right now
+}
+
+#[inline(never)]
+fn foo() -> i32 {
+ unimplemented!()
+}