diff --git a/CHANGELOG.md b/CHANGELOG.md index 013438df..137c4048 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/). - Update `irx-config` - Fix register array derive regression +- Sanitize `gen` keyword (new in Rust 2024 edition) ## [v0.36.0] - 2025-03-09 diff --git a/src/util.rs b/src/util.rs index 40a1e526..92e420c6 100644 --- a/src/util.rs +++ b/src/util.rs @@ -132,13 +132,13 @@ pub fn ident_str(name: &str, fmt: &IdentFormat) -> String { } pub fn sanitize_keyword(sc: Cow) -> Cow { - const KEYWORDS: [&str; 55] = [ + const KEYWORDS: [&str; 56] = [ "abstract", "alignof", "as", "async", "await", "become", "box", "break", "const", "continue", "crate", "do", "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", "sizeof", "static", - "struct", "super", "trait", "true", "try", "type", "typeof", "unsafe", "unsized", "use", - "virtual", "where", "while", "yield", + "gen", "if", "impl", "in", "let", "loop", "macro", "match", "mod", "move", "mut", + "offsetof", "override", "priv", "proc", "pub", "pure", "ref", "return", "self", "sizeof", + "static", "struct", "super", "trait", "true", "try", "type", "typeof", "unsafe", "unsized", + "use", "virtual", "where", "while", "yield", ]; if KEYWORDS.contains(&sc.as_ref()) { sc + "_"