summaryrefslogtreecommitdiffstats
path: root/tests/ui/borrowck/borrowck-trait-lifetime.rs
blob: 8a6dfe76d6065c9c204c1dc3bfb18522a02d6b16 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// run-pass
#![allow(unused_imports)]
// This test verifies that casting from the same lifetime on a value
// to the same lifetime on a trait succeeds. See issue #10766.

// pretty-expanded FIXME #23616

#![allow(dead_code)]

use std::marker;

fn main() {
    trait T { fn foo(&self) {} }

    fn f<'a, V: T>(v: &'a V) -> &'a dyn T {
        v as &'a dyn T
    }
}