mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-22 03:44:24 +00:00

Done with ```bash sd '//@ pretty-expanded.*\n' '' tests/ui/**/*.rs ``` and ``` sd '//@pretty-expanded.*\n' '' tests/ui/**/*.rs ```
19 lines
330 B
Rust
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);
|
|
}
|