LanguageReference
22Reserved Syntax
The lexer and grammar reserve the following forms because the language plans to use them. The compiler does not yet lower them; using them today either errors at parse time or is silently ignored by later passes. Treat this list as a roadmap, not as features.
| Reserved | Status |
|---|---|
Raw strings r"..." | Reserved. Will treat backslashes literally (no escape processing). Today an r prefix lexes as a separate identifier followed by an ordinary string literal. |
Escapes \a \b \f \v | Reserved. The lexer does not yet recognise them; they pass through as a literal backslash plus the following character. The implemented escapes are \n \t \r \0 \\ \' \" \xHH. |
yield | Parser accepts a yield expression; no generator semantics exist. async / await are fully implemented - see section 19. |
Optional chaining ?. | Token reserved; not consumed by the parser. |
Spread ... in calls / literals | The token exists for variadic parameter declarations only. |
Pure-virtual class method (e.g. = 0 syntax) | Not implemented. Use a virtual method without a body to declare an interface point. |
| Macros | No macro system exists, and macro is not currently a reserved word (it lexes as an ordinary identifier). A future hygienic macro system may introduce one. |
![pure] | Reserved. Will assert the function has no observable side effects (enabling aggressive folding). Parsed as an unknown directive today (warning + no semantics). |
![const] | Reserved. Will mark a function as evaluable at compile time. |
![noreturn] | Reserved. Will declare a function that never returns normally. |
![constructor] / ![destructor] | Reserved. Will register functions that run before main / after main returns. |
![repr(<int_type>)] on enums | Reserved. Use type enum Foo : u8 { ... } syntax for now; future versions may accept ![repr(u8)] as an equivalent spelling. |
![derive(Trait, ...)] | Reserved. The directive's argument list is parsed and validated (an unknown trait name is rejected), but nothing consumes it: no implementation is synthesized for any listed trait. Copy in particular is decided structurally, not declared - see section 16. |
When any of these moves out of "reserved" and into "implemented," it will be added to the relevant section of this document and removed from this table.