]> git.lizzy.rs Git - rust.git/blob - tests/ui/regions/issue-78262.rs
internally change regions to be covariant
[rust.git] / tests / ui / regions / issue-78262.rs
1 // revisions: base polonius
2 // ignore-compare-mode-polonius
3 // [polonius] compile-flags: -Z polonius
4
5 trait TT {}
6
7 impl dyn TT {
8     fn func(&self) {}
9 }
10
11 fn main() {
12     let f = |x: &dyn TT| x.func();
13     //[base]~^ ERROR: borrowed data escapes outside of closure
14     //[polonius]~^^ ERROR: borrowed data escapes outside of closure
15 }