summaryrefslogtreecommitdiffstats
path: root/tests/ui/regions/issue-78262.rs
blob: 642dbd7f821cfb8d8c24d06d0faa496b3863e2de (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// 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
}