2021-08-03 12:42:07 -05:00
|
|
|
// revisions: default nll polonius
|
2020-10-24 21:43:26 -05:00
|
|
|
// ignore-compare-mode-nll
|
2021-08-03 12:42:07 -05:00
|
|
|
// ignore-compare-mode-polonius
|
|
|
|
// [nll] compile-flags: -Z borrowck=mir
|
|
|
|
// [polonius] compile-flags: -Z borrowck=mir -Z polonius
|
2020-10-24 21:43:26 -05:00
|
|
|
|
2020-10-23 04:00:18 -05:00
|
|
|
trait TT {}
|
|
|
|
|
|
|
|
impl dyn TT {
|
|
|
|
fn func(&self) {}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
2020-10-24 21:43:26 -05:00
|
|
|
let f = |x: &dyn TT| x.func(); //[default]~ ERROR: mismatched types
|
|
|
|
//[nll]~^ ERROR: borrowed data escapes outside of closure
|
2021-08-03 12:42:07 -05:00
|
|
|
//[polonius]~^^ ERROR: borrowed data escapes outside of closure
|
2020-10-23 04:00:18 -05:00
|
|
|
}
|