| 1 |
// { dg-additional-options "-w" } |
| 2 |
#[lang = "sized"] |
| 3 |
pub trait Sized {} |
| 4 |
|
| 5 |
struct Foo<T>(T); |
| 6 |
impl<T> Foo<T> { |
| 7 |
fn new<Y>(a: T, b: Y) -> Self { |
| 8 |
Self(a) |
| 9 |
} |
| 10 |
} |
| 11 |
|
| 12 |
struct Bar<T>(T); |
| 13 |
impl Bar<i32> { |
| 14 |
fn baz(self) {} |
| 15 |
|
| 16 |
fn test() -> i32 { |
| 17 |
123 |
| 18 |
} |
| 19 |
} |
| 20 |
|
| 21 |
struct Baz<A, B>(A, B); |
| 22 |
impl Baz<i32, f32> { |
| 23 |
fn test<X>(a: X) -> X { |
| 24 |
a |
| 25 |
} |
| 26 |
} |
| 27 |
|
| 28 |
pub fn main() { |
| 29 |
let a = Foo::<i32>::new::<f32>(123, 456f32); |
| 30 |
let b = Foo::new::<f32>(123, 456f32); |
| 31 |
|
| 32 |
let c = Bar::<i32>(123); |
| 33 |
let d = Bar::baz(c); |
| 34 |
|
| 35 |
let e = Bar::test(); |
| 36 |
|
| 37 |
let f = Baz::test::<bool>(true); |
| 38 |
} |