]>
Commit | Line | Data |
---|---|---|
94222f64 | 1 | // revisions: default nll polonius |
1b1a35ee | 2 | // ignore-compare-mode-nll |
94222f64 XL |
3 | // ignore-compare-mode-polonius |
4 | // [nll] compile-flags: -Z borrowck=mir | |
5 | // [polonius] compile-flags: -Z borrowck=mir -Z polonius | |
1b1a35ee XL |
6 | |
7 | trait TT {} | |
8 | ||
9 | impl dyn TT { | |
10 | fn func(&self) {} | |
11 | } | |
12 | ||
13 | fn main() { | |
14 | let f = |x: &dyn TT| x.func(); //[default]~ ERROR: mismatched types | |
15 | //[nll]~^ ERROR: borrowed data escapes outside of closure | |
94222f64 | 16 | //[polonius]~^^ ERROR: borrowed data escapes outside of closure |
1b1a35ee | 17 | } |