rust/tests/ui/regions/issue-78262.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

16 lines
337 B
Rust
Raw Normal View History

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