4 ms·
The only reason to define it as `r#something` is if something is a keyword, and so regular-old `something` doesn't work. But if you happened to do it anyway, th
by steveklabnik 8y ago
The only reason to define it as `r#something` is if something is a keyword, and so regular-old `something` doesn't work. But if you happened to do it anyway, then yeah: https://play.rust-lang.org/?version=beta&mode=debug&edition=2015&gist=e73bd3ed13cf9e28e3b0e8e8145be957 https://play.rust-lang.org/?version=beta&mode=debug&edition=...
But yes, the `r#` isn't part of the name; if I define a Rust 2015 function as `fn async()`, in 2015 i can call it as just regular async() in 2015 code, and only need r#async() in Rust 2018 code.
And yeah, this is useful for codegen tools as well.