]> git.lizzy.rs Git - rust.git/blob - tests/ui/lambda-infer-unresolved.rs
Rollup merge of #107576 - P1n3appl3:master, r=tmandry
[rust.git] / tests / ui / lambda-infer-unresolved.rs
1 // run-pass
2
3 #![allow(unused_mut)]
4 // This should typecheck even though the type of e is not fully
5 // resolved when we finish typechecking the ||.
6
7
8 struct Refs { refs: Vec<isize> , n: isize }
9
10 pub fn main() {
11     let mut e = Refs{refs: vec![], n: 0};
12     let _f = || println!("{}", e.n);
13     let x: &[isize] = &e.refs;
14     assert_eq!(x.len(), 0);
15 }