summaryrefslogtreecommitdiffstats
path: root/src/tools/rustfmt/tests/target/raw_identifiers.rs
blob: 6ab0fdf053bccd098f6de62c47ef9efd9b4ff5c1 (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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#![feature(custom_attribute)]
#![feature(raw_identifiers)]
#![feature(extern_types)]
#![allow(invalid_type_param_default)]
#![allow(unused_attributes)]

use r#foo as r#alias_foo;

// https://github.com/rust-lang/rustfmt/issues/3837
pub(crate) static r#break: &'static str = "foo";

fn main() {
    #[r#attr]
    r#foo::r#bar();

    let r#local = r#Struct { r#field: () };
    r#local.r#field = 1;
    r#foo.r#barr();
    let r#async = r#foo(r#local);
    r#macro!();

    if let r#sub_pat @ r#Foo(_) = r#Foo(3) {}

    match r#async {
        r#Foo | r#Bar => r#foo(),
    }
}

fn r#bar<'a, r#T>(r#x: &'a r#T) {}

mod r#foo {
    pub fn r#bar() {}
}

enum r#Foo {
    r#Bar {},
}

struct r#Struct {
    r#field: r#FieldType,
}

trait r#Trait {
    type r#Type;
}

impl r#Trait for r#Impl {
    type r#Type = r#u32;
    fn r#xxx(r#fjio: r#u32) {}
}

extern "C" {
    type r#ccc;
    static r#static_val: u32;
}

macro_rules! r#macro {
    () => {};
}

macro_rules! foo {
    ($x:expr) => {
        let r#catch = $x + 1;
        println!("{}", r#catch);
    };
}