mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-02 11:44:28 +00:00
36 lines
728 B
Rust
36 lines
728 B
Rust
//@ compile-flags:-Zprint-mono-items=eager -Copt-level=0
|
|
|
|
#![deny(dead_code)]
|
|
#![feature(start)]
|
|
|
|
fn generic_fn<T>(a: T) -> (T, i32) {
|
|
//~ MONO_ITEM fn generic_fn::nested_fn
|
|
fn nested_fn(a: i32) -> i32 {
|
|
a + 1
|
|
}
|
|
|
|
let x = {
|
|
//~ MONO_ITEM fn generic_fn::nested_fn
|
|
fn nested_fn(a: i32) -> i32 {
|
|
a + 2
|
|
}
|
|
|
|
1 + nested_fn(1)
|
|
};
|
|
|
|
return (a, x + nested_fn(0));
|
|
}
|
|
|
|
//~ MONO_ITEM fn start
|
|
#[start]
|
|
fn start(_: isize, _: *const *const u8) -> isize {
|
|
//~ MONO_ITEM fn generic_fn::<i64>
|
|
let _ = generic_fn(0i64);
|
|
//~ MONO_ITEM fn generic_fn::<u16>
|
|
let _ = generic_fn(0u16);
|
|
//~ MONO_ITEM fn generic_fn::<i8>
|
|
let _ = generic_fn(0i8);
|
|
|
|
0
|
|
}
|