blob: d31b847997eb3bd199dbf5de4065ce14c1242ee1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
//@ revisions: base polonius
//@ ignore-compare-mode-polonius
//@ [polonius] compile-flags: -Z polonius
trait TT {}
impl dyn TT {
fn func(&self) {}
}
fn main() {
let f = |x: &dyn TT| x.func();
//[base]~^ ERROR: borrowed data escapes outside of closure
//[polonius]~^^ ERROR: borrowed data escapes outside of closure
}
|