rust/tests/ui/regions/issue-78262.rs
2023-01-11 09:32:08 +00:00

16 lines
334 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
}