mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-03 12:13:43 +00:00
19 lines
367 B
Rust
19 lines
367 B
Rust
//@ 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
|
|
}
|
|
}
|