]> git.lizzy.rs Git - rust.git/blob - src/tools/rustfmt/tests/target/raw_identifiers.rs
Auto merge of #82624 - ojeda:rwlock-example-deadlock, r=JohnTitor
[rust.git] / src / tools / rustfmt / tests / target / raw_identifiers.rs
1 #![feature(custom_attribute)]
2 #![feature(raw_identifiers)]
3 #![feature(extern_types)]
4 #![allow(invalid_type_param_default)]
5 #![allow(unused_attributes)]
6
7 use r#foo as r#alias_foo;
8
9 // https://github.com/rust-lang/rustfmt/issues/3837
10 pub(crate) static r#break: &'static str = "foo";
11
12 fn main() {
13     #[r#attr]
14     r#foo::r#bar();
15
16     let r#local = r#Struct { r#field: () };
17     r#local.r#field = 1;
18     r#foo.r#barr();
19     let r#async = r#foo(r#local);
20     r#macro!();
21
22     if let r#sub_pat @ r#Foo(_) = r#Foo(3) {}
23
24     match r#async {
25         r#Foo | r#Bar => r#foo(),
26     }
27 }
28
29 fn r#bar<'a, r#T>(r#x: &'a r#T) {}
30
31 mod r#foo {
32     pub fn r#bar() {}
33 }
34
35 enum r#Foo {
36     r#Bar {},
37 }
38
39 struct r#Struct {
40     r#field: r#FieldType,
41 }
42
43 trait r#Trait {
44     type r#Type;
45 }
46
47 impl r#Trait for r#Impl {
48     type r#Type = r#u32;
49     fn r#xxx(r#fjio: r#u32) {}
50 }
51
52 extern "C" {
53     type r#ccc;
54     static r#static_val: u32;
55 }
56
57 macro_rules! r#macro {
58     () => {};
59 }
60
61 macro_rules! foo {
62     ($x:expr) => {
63         let r#catch = $x + 1;
64         println!("{}", r#catch);
65     };
66 }