mirror of
https://github.com/rust-lang/rust
synced 2024-11-05 20:45:15 +00:00
15 lines
337 B
Rust
15 lines
337 B
Rust
//@ 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
|
|
}
|