]> git.lizzy.rs Git - rust.git/blob - tests/ui/stats/hir-stats.rs
Rollup merge of #106715 - BoxyUwU:new_solver_triagebot, r=lcnr
[rust.git] / tests / ui / stats / hir-stats.rs
1 // check-pass
2 // compile-flags: -Zhir-stats
3 // only-x86_64
4 // ignore-stage1  FIXME: remove after next bootstrap bump
5
6 // The aim here is to include at least one of every different type of top-level
7 // AST/HIR node reported by `-Zhir-stats`.
8
9 #![allow(dead_code)]
10
11 use std::arch::asm;
12 use std::fmt::Debug;
13 use std::ffi::c_void;
14
15 extern "C" { fn f(p: *mut c_void); }
16
17 /// An enum.
18 enum E<'a, T: Copy> { A { t: T }, B(&'a u32) }
19
20 trait Go {
21     type G: Debug;
22     fn go(self) -> u32;
23 }
24
25 impl<'a, T: Copy> Go for E<'a, T> {
26     type G = bool;
27     fn go(self) -> u32 {
28         99
29     }
30 }
31
32 fn f2<T>(t: T) where T: Debug {}
33
34 fn main() {
35     let x = E::A { t: 3 };
36     match x {
37         E::A { .. } => {}
38         _ => {}
39     }
40
41     unsafe { asm!("mov rdi, 1"); }
42 }