Skip to content

Commit 98841b3

Browse files
committed
context: Escape the dyn keyword properly.
Fixes #1946
1 parent 4ce4b93 commit 98841b3

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

src/ir/context.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -807,9 +807,9 @@ If you encounter an error missing from this list, please file an issue or a PR!"
807807
match name {
808808
"abstract" | "alignof" | "as" | "async" | "become" |
809809
"box" | "break" | "const" | "continue" | "crate" | "do" |
810-
"else" | "enum" | "extern" | "false" | "final" | "fn" |
811-
"for" | "if" | "impl" | "in" | "let" | "loop" | "macro" |
812-
"match" | "mod" | "move" | "mut" | "offsetof" |
810+
"dyn" | "else" | "enum" | "extern" | "false" | "final" |
811+
"fn" | "for" | "if" | "impl" | "in" | "let" | "loop" |
812+
"macro" | "match" | "mod" | "move" | "mut" | "offsetof" |
813813
"override" | "priv" | "proc" | "pub" | "pure" | "ref" |
814814
"return" | "Self" | "self" | "sizeof" | "static" |
815815
"struct" | "super" | "trait" | "true" | "type" | "typeof" |

tests/expectations/tests/keywords.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@ extern "C" {
6161
#[link_name = "\u{1}str"]
6262
pub static mut str_: ::std::os::raw::c_int;
6363
}
64+
extern "C" {
65+
#[link_name = "\u{1}dyn"]
66+
pub static mut dyn_: ::std::os::raw::c_int;
67+
}
6468
extern "C" {
6569
#[link_name = "\u{1}as"]
6670
pub static mut as_: ::std::os::raw::c_int;

tests/headers/keywords.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ int usize;
1212
int isize;
1313
int bool;
1414
int str;
15+
int dyn;
1516

1617
int as;
1718
int box;

0 commit comments

Comments
 (0)