mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-14 02:49:40 +00:00

Done with ```bash sd '//@ pretty-expanded.*\n' '' tests/ui/**/*.rs ``` and ``` sd '//@pretty-expanded.*\n' '' tests/ui/**/*.rs ```
18 lines
334 B
Rust
18 lines
334 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.
|
|
|
|
|
|
#![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
|
|
}
|
|
}
|