]> git.proxmox.com Git - rustc.git/blame - src/tools/rustfmt/tests/target/raw_identifiers.rs
New upstream version 1.52.1+dfsg1
[rustc.git] / src / tools / rustfmt / tests / target / raw_identifiers.rs
CommitLineData
f20569fa
XL
1#![feature(custom_attribute)]
2#![feature(raw_identifiers)]
3#![feature(extern_types)]
4#![allow(invalid_type_param_default)]
5#![allow(unused_attributes)]
6
7use r#foo as r#alias_foo;
8
9// https://github.com/rust-lang/rustfmt/issues/3837
10pub(crate) static r#break: &'static str = "foo";
11
12fn 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
29fn r#bar<'a, r#T>(r#x: &'a r#T) {}
30
31mod r#foo {
32 pub fn r#bar() {}
33}
34
35enum r#Foo {
36 r#Bar {},
37}
38
39struct r#Struct {
40 r#field: r#FieldType,
41}
42
43trait r#Trait {
44 type r#Type;
45}
46
47impl r#Trait for r#Impl {
48 type r#Type = r#u32;
49 fn r#xxx(r#fjio: r#u32) {}
50}
51
52extern "C" {
53 type r#ccc;
54 static r#static_val: u32;
55}
56
57macro_rules! r#macro {
58 () => {};
59}
60
61macro_rules! foo {
62 ($x:expr) => {
63 let r#catch = $x + 1;
64 println!("{}", r#catch);
65 };
66}