Edition 2021 added reserved syntax, making
<simple-ident><string-literal> single tokens. However, in tests, I noted that use of these tokens is lexically ill-formed, except for the defined forms.
In GitHub - LightningCreations/lccc: Lightning Creations Compiler Frontend for various languages, reserved syntax is planned to be used to do various internal things (In particular, two keywords with
k# prefix are defined to allow the asm!()/global_asm!() macros, as well as a compiler-specific macro used for implementing some stdlib functions, to expand to actual syntax), behind feature gates. However, I am unsure whether it is possible to gate syntax behind features.
Thus, I propose that any prefixed string/character literal or identifier be considered lexically valid, but an error to use anywhere (other than an input to a macro tt matcher or a function-like proc macro) unless it is considered valid by the stable rust language, or the relevant feature is enabled.
Alternatively, if this is too permissive, then perhaps a subset of prefixes may be considered lexically valid, such as prefixes starting with two consecutive underscores (a prefix that I would consider "reserved for the implementation", but that's a different discussion really). However, as the only valid use (in stable) would be to consume and discard the token, I do not believe this to be a problem (though proc-macros make a notable exception, since it's possible to specifically match these tokens if they are made valid).