]> git.proxmox.com Git - rustc.git/blob - src/test/ui/lto/auxiliary/debuginfo-lto-aux.rs
New upstream version 1.67.1+dfsg1
[rustc.git] / src / test / ui / lto / auxiliary / debuginfo-lto-aux.rs
1 // compile-flags: -g --crate-type=rlib
2
3 pub struct StructWithLifetime<'a>(&'a i32);
4 pub fn mk_struct_with_lt<'a>(x: &'a i32) -> StructWithLifetime<'a> {
5 StructWithLifetime(x)
6 }
7
8 pub struct RegularStruct(u32);
9 pub fn mk_regular_struct(x: u32) -> RegularStruct {
10 RegularStruct(x)
11 }
12
13 pub fn take_fn(f: fn(i32) -> i32, x: i32) -> i32 {
14 f(x)
15 }
16
17 pub fn with_closure(x: i32) -> i32 {
18 let closure = |i| { x + i };
19
20 closure(1) + closure(2)
21 }
22
23 pub fn generic_fn<T>(x: T) -> (T, u32) {
24 (x, 1)
25 }
26
27 pub fn user_of_generic_fn(x: f32) -> (f32, u32) {
28 generic_fn(x)
29 }