]> git.proxmox.com Git - rustc.git/blob - src/test/codegen-units/item-collection/impl-in-non-instantiated-generic.rs
New upstream version 1.48.0~beta.8+dfsg1
[rustc.git] / src / test / codegen-units / item-collection / impl-in-non-instantiated-generic.rs
1 // compile-flags:-Zprint-mono-items=eager
2
3 #![deny(dead_code)]
4 #![feature(start)]
5
6 trait SomeTrait {
7 fn foo(&self);
8 }
9
10 // This function is never instantiated but the contained impl must still be
11 // discovered.
12 pub fn generic_function<T>(x: T) -> (T, i32) {
13 impl SomeTrait for i64 {
14 //~ MONO_ITEM fn generic_function::<impl SomeTrait for i64>::foo
15 fn foo(&self) {}
16 }
17
18 (x, 0)
19 }
20
21 //~ MONO_ITEM fn start
22 #[start]
23 fn start(_: isize, _: *const *const u8) -> isize {
24 0i64.foo();
25
26 0
27 }