]> git.lizzy.rs Git - rust.git/blob - src/test/ui/regions/regions-infer-borrow-scope-within-loop-ok.rs
Auto merge of #93718 - thomcc:used-macho, r=pnkfelix
[rust.git] / src / test / ui / regions / regions-infer-borrow-scope-within-loop-ok.rs
1 // run-pass
2
3 fn borrow<T>(x: &T) -> &T {x}
4
5 pub fn main() {
6     let x: Box<_> = Box::new(3);
7     loop {
8         let y = borrow(&*x);
9         assert_eq!(*x, *y);
10         break;
11     }
12 }