@@ -2,67 +2,14 @@ use proc_macro2::TokenStream;
2
2
use quote:: quote;
3
3
use std:: borrow:: Cow ;
4
4
5
- // List of keywords based on https://doc.rust-lang.org/grammar.html#keywords
5
+ // List of keywords based on https://doc.rust-lang.org/reference/keywords.html
6
+ // code snippet: `[...new Set($$("code.hljs").map(x => x.textContent).filter(x => x.match(/^[_a-z0-9]+$/i)))].sort()`
6
7
const RUST_KEYWORDS : & [ & str ] = & [
7
- "abstract" ,
8
- "alignof" ,
9
- "as" ,
10
- "async" ,
11
- "await" ,
12
- "become" ,
13
- "box" ,
14
- "break" ,
15
- "const" ,
16
- "continue" ,
17
- "crate" ,
18
- "do" ,
19
- "else" ,
20
- "enum" ,
21
- "extern crate" ,
22
- "extern" ,
23
- "false" ,
24
- "final" ,
25
- "fn" ,
26
- "for" ,
27
- "for" ,
28
- "if let" ,
29
- "if" ,
30
- "if" ,
31
- "impl" ,
32
- "impl" ,
33
- "in" ,
34
- "let" ,
35
- "loop" ,
36
- "macro" ,
37
- "match" ,
38
- "mod" ,
39
- "move" ,
40
- "mut" ,
41
- "offsetof" ,
42
- "override" ,
43
- "priv" ,
44
- "proc" ,
45
- "pub" ,
46
- "pure" ,
47
- "ref" ,
48
- "return" ,
49
- "self" ,
50
- "sizeof" ,
51
- "static" ,
52
- "struct" ,
53
- "super" ,
54
- "trait" ,
55
- "true" ,
56
- "type" ,
57
- "typeof" ,
58
- "unsafe" ,
59
- "unsized" ,
60
- "use" ,
61
- "use" ,
62
- "virtual" ,
63
- "where" ,
64
- "while" ,
65
- "yield" ,
8
+ "Self" , "abstract" , "as" , "async" , "await" , "become" , "box" , "break" , "const" , "continue" ,
9
+ "crate" , "do" , "dyn" , "else" , "enum" , "extern" , "false" , "final" , "fn" , "for" , "if" , "impl" ,
10
+ "in" , "let" , "loop" , "macro" , "match" , "mod" , "move" , "mut" , "override" , "priv" , "pub" , "ref" ,
11
+ "return" , "self" , "static" , "struct" , "super" , "trait" , "true" , "try" , "type" , "typeof" ,
12
+ "union" , "unsafe" , "unsized" , "use" , "virtual" , "where" , "while" , "yield" ,
66
13
] ;
67
14
68
15
pub ( crate ) fn keyword_replace < ' a > ( needle : impl Into < Cow < ' a , str > > ) -> Cow < ' a , str > {
0 commit comments