2018-05-08 08:10:16 -05:00
|
|
|
// compile-flags:-Zprint-mono-items=eager
|
2015-11-02 07:46:39 -06:00
|
|
|
|
|
|
|
#![deny(dead_code)]
|
2017-12-22 08:31:51 -06:00
|
|
|
#![feature(start)]
|
2015-11-02 07:46:39 -06:00
|
|
|
|
|
|
|
pub trait SomeTrait {
|
|
|
|
fn foo(&self);
|
|
|
|
fn bar<T>(&self, x: T);
|
|
|
|
}
|
|
|
|
|
|
|
|
impl SomeTrait for i64 {
|
|
|
|
|
2020-08-28 08:31:03 -05:00
|
|
|
//~ MONO_ITEM fn <i64 as SomeTrait>::foo
|
2015-11-02 07:46:39 -06:00
|
|
|
fn foo(&self) {}
|
|
|
|
|
|
|
|
fn bar<T>(&self, _: T) {}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl SomeTrait for i32 {
|
|
|
|
|
2020-08-28 08:31:03 -05:00
|
|
|
//~ MONO_ITEM fn <i32 as SomeTrait>::foo
|
2015-11-02 07:46:39 -06:00
|
|
|
fn foo(&self) {}
|
|
|
|
|
|
|
|
fn bar<T>(&self, _: T) {}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub trait SomeGenericTrait<T> {
|
|
|
|
fn foo(&self, x: T);
|
|
|
|
fn bar<T2>(&self, x: T, y: T2);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Concrete impl of generic trait
|
|
|
|
impl SomeGenericTrait<u32> for f64 {
|
|
|
|
|
2020-08-28 08:31:03 -05:00
|
|
|
//~ MONO_ITEM fn <f64 as SomeGenericTrait<u32>>::foo
|
2015-11-02 07:46:39 -06:00
|
|
|
fn foo(&self, _: u32) {}
|
|
|
|
|
|
|
|
fn bar<T2>(&self, _: u32, _: T2) {}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Generic impl of generic trait
|
|
|
|
impl<T> SomeGenericTrait<T> for f32 {
|
|
|
|
|
|
|
|
fn foo(&self, _: T) {}
|
|
|
|
fn bar<T2>(&self, _: T, _: T2) {}
|
|
|
|
}
|
|
|
|
|
2020-08-28 08:31:03 -05:00
|
|
|
//~ MONO_ITEM fn start
|
2017-12-22 08:31:51 -06:00
|
|
|
#[start]
|
|
|
|
fn start(_: isize, _: *const *const u8) -> isize {
|
2020-08-28 08:31:03 -05:00
|
|
|
//~ MONO_ITEM fn <i32 as SomeTrait>::bar::<char>
|
2015-11-02 07:46:39 -06:00
|
|
|
0i32.bar('x');
|
|
|
|
|
2020-08-28 08:31:03 -05:00
|
|
|
//~ MONO_ITEM fn <f64 as SomeGenericTrait<u32>>::bar::<&str>
|
2015-11-02 07:46:39 -06:00
|
|
|
0f64.bar(0u32, "&str");
|
|
|
|
|
2020-08-28 08:31:03 -05:00
|
|
|
//~ MONO_ITEM fn <f64 as SomeGenericTrait<u32>>::bar::<()>
|
2015-11-02 07:46:39 -06:00
|
|
|
0f64.bar(0u32, ());
|
|
|
|
|
2020-08-28 08:31:03 -05:00
|
|
|
//~ MONO_ITEM fn <f32 as SomeGenericTrait<char>>::foo
|
2015-11-02 07:46:39 -06:00
|
|
|
0f32.foo('x');
|
|
|
|
|
2020-08-28 08:31:03 -05:00
|
|
|
//~ MONO_ITEM fn <f32 as SomeGenericTrait<i64>>::foo
|
2015-11-02 07:46:39 -06:00
|
|
|
0f32.foo(-1i64);
|
|
|
|
|
2020-08-28 08:31:03 -05:00
|
|
|
//~ MONO_ITEM fn <f32 as SomeGenericTrait<u32>>::bar::<()>
|
2015-11-02 07:46:39 -06:00
|
|
|
0f32.bar(0u32, ());
|
|
|
|
|
2020-08-28 08:31:03 -05:00
|
|
|
//~ MONO_ITEM fn <f32 as SomeGenericTrait<&str>>::bar::<&str>
|
2015-11-02 07:46:39 -06:00
|
|
|
0f32.bar("&str", "&str");
|
2017-12-22 08:31:51 -06:00
|
|
|
|
|
|
|
0
|
2015-11-02 07:46:39 -06:00
|
|
|
}
|