2025-05-09 10:36:07 +02:00
|
|
|
//@ compile-flags:-Clink-dead-code
|
2015-11-02 14:46:39 +01:00
|
|
|
|
|
|
|
|
#![deny(dead_code)]
|
2024-12-14 09:13:12 +01:00
|
|
|
#![crate_type = "lib"]
|
2015-11-02 14:46:39 +01:00
|
|
|
|
|
|
|
|
trait SomeTrait {
|
|
|
|
|
fn foo(&self);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// This function is never instantiated but the contained impl must still be
|
|
|
|
|
// discovered.
|
|
|
|
|
pub fn generic_function<T>(x: T) -> (T, i32) {
|
|
|
|
|
impl SomeTrait for i64 {
|
2020-08-28 14:31:03 +01:00
|
|
|
//~ MONO_ITEM fn generic_function::<impl SomeTrait for i64>::foo
|
2015-11-02 14:46:39 +01:00
|
|
|
fn foo(&self) {}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
(x, 0)
|
|
|
|
|
}
|
|
|
|
|
|
2020-08-28 14:31:03 +01:00
|
|
|
//~ MONO_ITEM fn start
|
2024-12-14 09:13:12 +01:00
|
|
|
#[no_mangle]
|
|
|
|
|
pub fn start(_: isize, _: *const *const u8) -> isize {
|
2015-11-02 14:46:39 +01:00
|
|
|
0i64.foo();
|
2017-12-22 15:31:51 +01:00
|
|
|
|
|
|
|
|
0
|
2015-11-02 14:46:39 +01:00
|
|
|
}
|