]> git.lizzy.rs Git - rust.git/blobdiff - src/test/ui/issues/issue-5500-1.rs
Rollup merge of #62257 - RalfJung:miri-c-str, r=estebank
[rust.git] / src / test / ui / issues / issue-5500-1.rs
index e8043563c73595be92859a1fc704d85e11067ff6..edbbe33c66fcc6b54366c85afed4b710b9503f7b 100644 (file)
@@ -1,6 +1,8 @@
-// ignore-compare-mode-nll
-// revisions: ast mir
-//[mir]compile-flags: -Z borrowck=compare
+// MIR doesn't generate an error because the assignment isn't reachable. This
+// is OK because the test is here to check that the compiler doesn't ICE (cf.
+// #5500).
+
+// build-pass (FIXME(62277): could be check-pass?)
 
 struct TrieMapIterator<'a> {
     node: &'a usize
@@ -9,9 +11,5 @@ struct TrieMapIterator<'a> {
 fn main() {
     let a = 5;
     let _iter = TrieMapIterator{node: &a};
-    _iter.node = & //[ast]~ ERROR cannot assign to field `_iter.node` of immutable binding
-                   //[mir]~^ ERROR cannot assign to field `_iter.node` of immutable binding (Ast)
-                   // MIR doesn't generate an error because the code isn't reachable. This is OK
-                   // because the test is here to check that the compiler doesn't ICE (cf. #5500).
-    panic!()
+    _iter.node = &panic!()
 }