2022-04-01 13:13:25 -04:00
|
|
|
// revisions: base polonius
|
2021-08-03 19:42:07 +02:00
|
|
|
// ignore-compare-mode-polonius
|
2022-04-01 13:13:25 -04:00
|
|
|
// [polonius] compile-flags: -Z polonius
|
2020-10-25 11:43:26 +09:00
|
|
|
|
2020-10-23 18:00:18 +09:00
|
|
|
trait TT {}
|
|
|
|
|
|
|
|
impl dyn TT {
|
|
|
|
fn func(&self) {}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
2022-04-01 13:13:25 -04:00
|
|
|
let f = |x: &dyn TT| x.func();
|
|
|
|
//[base]~^ ERROR: borrowed data escapes outside of closure
|
2021-08-03 19:42:07 +02:00
|
|
|
//[polonius]~^^ ERROR: borrowed data escapes outside of closure
|
2020-10-23 18:00:18 +09:00
|
|
|
}
|