]> git.lizzy.rs Git - rust.git/blob - tests/ui/borrowck/borrowck-trait-lifetime.rs
Rollup merge of #106644 - alexcrichton:update-wasi-toolchain, r=cuviper
[rust.git] / tests / ui / borrowck / borrowck-trait-lifetime.rs
1 // run-pass
2 #![allow(unused_imports)]
3 // This test verifies that casting from the same lifetime on a value
4 // to the same lifetime on a trait succeeds. See issue #10766.
5
6 // pretty-expanded FIXME #23616
7
8 #![allow(dead_code)]
9
10 use std::marker;
11
12 fn main() {
13     trait T { fn foo(&self) {} }
14
15     fn f<'a, V: T>(v: &'a V) -> &'a dyn T {
16         v as &'a dyn T
17     }
18 }