Open
Description
In #48942, @Lymia landed raw identifiers; "equality" in this implementation includes observing the "raw" state. Therefore, macros can observe if r#foo
was used or not:
#![feature(raw_identifiers)]
macro_rules! foo {
(a) => {
1
};
(r#a) => { 2 };
}
fn main() {
println!("{}", foo!(a));
println!("{}", foo!(r#a));
}
This makes a certain measure of sense, but also makes me nervous, and I wanted to open an issue to discuss. For example, @Manishearth proposed making identifiers "raw" in macros when they are serialized, thus ensuring consistent interpretation as we cross editions.
I'm not entirely sure of the implications of this but it does make me nervous for users to be able to distinguish foo
and r#foo
.