Skip to content

Commit 41fec1a

Browse files
authored
Merge pull request #932 from mdbernard/add-gen-keyword
add 'gen' keyword (close #927)
2 parents 3804bed + 5a4d946 commit 41fec1a

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/).
99

1010
- Update `irx-config`
1111
- Fix register array derive regression
12+
- Sanitize `gen` keyword (new in Rust 2024 edition)
1213

1314
## [v0.36.0] - 2025-03-09
1415

src/util.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -132,13 +132,13 @@ pub fn ident_str(name: &str, fmt: &IdentFormat) -> String {
132132
}
133133

134134
pub fn sanitize_keyword(sc: Cow<str>) -> Cow<str> {
135-
const KEYWORDS: [&str; 55] = [
135+
const KEYWORDS: [&str; 56] = [
136136
"abstract", "alignof", "as", "async", "await", "become", "box", "break", "const",
137137
"continue", "crate", "do", "dyn", "else", "enum", "extern", "false", "final", "fn", "for",
138-
"if", "impl", "in", "let", "loop", "macro", "match", "mod", "move", "mut", "offsetof",
139-
"override", "priv", "proc", "pub", "pure", "ref", "return", "self", "sizeof", "static",
140-
"struct", "super", "trait", "true", "try", "type", "typeof", "unsafe", "unsized", "use",
141-
"virtual", "where", "while", "yield",
138+
"gen", "if", "impl", "in", "let", "loop", "macro", "match", "mod", "move", "mut",
139+
"offsetof", "override", "priv", "proc", "pub", "pure", "ref", "return", "self", "sizeof",
140+
"static", "struct", "super", "trait", "true", "try", "type", "typeof", "unsafe", "unsized",
141+
"use", "virtual", "where", "while", "yield",
142142
];
143143
if KEYWORDS.contains(&sc.as_ref()) {
144144
sc + "_"

0 commit comments

Comments
 (0)