summary refs log tree commit diff
path: root/src/test/mir-opt/inline/inline-specialization.rs
blob: 9591019bb4f70670f84d2cae174d9ce7a8cef9e6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#![feature(specialization)]

fn main() {
    let x = <Vec::<()> as Foo>::bar();
}

trait Foo {
    fn bar() -> u32;
}

impl<T> Foo for Vec<T> {
    #[inline(always)]
    default fn bar() -> u32 { 123 }
}

// END RUST SOURCE
// START rustc.main.Inline.before.mir
// let mut _0: ();
// let _1: u32;
// scope 1 {
//   debug x => _1;
// }
// bb0: {
//   StorageLive(_1);
//   _1 = const <std::vec::Vec<()> as Foo>::bar() -> bb1;
// }
// bb1: {
//   _0 = ();
//   StorageDead(_1);
//   return;
// }
// END rustc.main.Inline.before.mir
// START rustc.main.Inline.after.mir
// let mut _0: ();
// let _1: u32;
// scope 1 {
//   debug x => _1;
// }
// scope 2 {
// }
// bb0: {
//   StorageLive(_1);
//   _1 = const 123u32;
//   _0 = ();
//   StorageDead(_1);
//   return;
// }
// END rustc.main.Inline.after.mir