8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents ab45408 + 6ce5ab6 commit ffe4af5Copy full SHA for ffe4af5
src/librustc_span/symbol.rs
@@ -1023,6 +1023,14 @@ impl Symbol {
1023
pub fn as_u32(self) -> u32 {
1024
self.0.as_u32()
1025
}
1026
+
1027
+ /// This method is supposed to be used in error messages, so it's expected to be
1028
+ /// identical to printing the original identifier token written in source code
1029
+ /// (`token_to_string`, `Ident::to_string`), except that symbols don't keep the rawness flag
1030
+ /// or edition, so we have to guess the rawness using the global edition.
1031
+ pub fn to_ident_string(self) -> String {
1032
+ Ident::with_dummy_span(self).to_string()
1033
+ }
1034
1035
1036
impl fmt::Debug for Symbol {
0 commit comments