]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-5500-1.rs
Rollup merge of #56217 - frewsxcv:frewsxcv-float-parse, r=QuietMisdreavus
[rust.git] / src / test / ui / issues / issue-5500-1.rs
1 // ignore-compare-mode-nll
2 // revisions: ast mir
3 //[mir]compile-flags: -Z borrowck=compare
4
5 struct TrieMapIterator<'a> {
6     node: &'a usize
7 }
8
9 fn main() {
10     let a = 5;
11     let _iter = TrieMapIterator{node: &a};
12     _iter.node = & //[ast]~ ERROR cannot assign to field `_iter.node` of immutable binding
13                    //[mir]~^ ERROR cannot assign to field `_iter.node` of immutable binding (Ast)
14                    // MIR doesn't generate an error because the code isn't reachable. This is OK
15                    // because the test is here to check that the compiler doesn't ICE (cf. #5500).
16     panic!()
17 }