rust/tests/ui/traits/early-vtbl-resolution.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

19 lines
330 B
Rust

//@ run-pass
#![allow(non_camel_case_types)]
#![allow(dead_code)]
trait thing<A> {
fn foo(&self) -> Option<A>;
}
impl<A> thing<A> for isize {
fn foo(&self) -> Option<A> { None }
}
fn foo_func<A, B: thing<A>>(x: B) -> Option<A> { x.foo() }
struct A { a: isize }
pub fn main() {
let _x: Option<f64> = foo_func(0);
}