]> git.lizzy.rs Git - rust.git/blob - tests/ui/nll/lint-no-err.rs
Auto merge of #101138 - Rejyr:diagnostic-migration-rustc-lint-pt2, r=davidtwco
[rust.git] / tests / ui / nll / lint-no-err.rs
1 // check-pass
2
3 // mir borrowck previously incorrectly set `tainted_by_errors`
4 // when buffering lints, which resulted in ICE later on,
5 // see #94502.
6
7 struct Repro;
8 impl Repro {
9     fn get(&self) -> &i32 {
10         &3
11     }
12
13     fn insert(&mut self, _: i32) {}
14 }
15
16 fn main() {
17     let x = &0;
18     let mut conflict = Repro;
19     let prev = conflict.get();
20     conflict.insert(*prev + *x);
21 }