rust/tests/ui/borrowck/borrowck-trait-lifetime.rs
许杰友 Jieyou Xu (Joe) 95ff642797 tests: remove //@ pretty-expanded usages
Done with

```bash
sd '//@ pretty-expanded.*\n' '' tests/ui/**/*.rs
```

and

```
sd '//@pretty-expanded.*\n' '' tests/ui/**/*.rs
```
2024-11-26 02:50:48 +08:00

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
}
}