Skip to content

Commit

Permalink
context: Escape the dyn keyword properly.
Browse files Browse the repository at this point in the history
Fixes #1946
  • Loading branch information
emilio committed Dec 20, 2020
1 parent 4ce4b93 commit 98841b3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/ir/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -807,9 +807,9 @@ If you encounter an error missing from this list, please file an issue or a PR!"
match name {
"abstract" | "alignof" | "as" | "async" | "become" |
"box" | "break" | "const" | "continue" | "crate" | "do" |
"else" | "enum" | "extern" | "false" | "final" | "fn" |
"for" | "if" | "impl" | "in" | "let" | "loop" | "macro" |
"match" | "mod" | "move" | "mut" | "offsetof" |
"dyn" | "else" | "enum" | "extern" | "false" | "final" |
"fn" | "for" | "if" | "impl" | "in" | "let" | "loop" |
"macro" | "match" | "mod" | "move" | "mut" | "offsetof" |
"override" | "priv" | "proc" | "pub" | "pure" | "ref" |
"return" | "Self" | "self" | "sizeof" | "static" |
"struct" | "super" | "trait" | "true" | "type" | "typeof" |
Expand Down
4 changes: 4 additions & 0 deletions tests/expectations/tests/keywords.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ extern "C" {
#[link_name = "\u{1}str"]
pub static mut str_: ::std::os::raw::c_int;
}
extern "C" {
#[link_name = "\u{1}dyn"]
pub static mut dyn_: ::std::os::raw::c_int;
}
extern "C" {
#[link_name = "\u{1}as"]
pub static mut as_: ::std::os::raw::c_int;
Expand Down
1 change: 1 addition & 0 deletions tests/headers/keywords.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ int usize;
int isize;
int bool;
int str;
int dyn;

int as;
int box;
Expand Down

0 comments on commit 98841b3

Please sign in to comment.