mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-14 02:49:40 +00:00
Fix .to_string()
of proc_macro::Literal
(properly print cstr literals)
This commit is contained in:
parent
19c65022fc
commit
285e574b8e
@ -1411,7 +1411,15 @@ impl Literal {
|
||||
let hashes = get_hashes_str(n);
|
||||
f(&["br", hashes, "\"", symbol, "\"", hashes, suffix])
|
||||
}
|
||||
_ => f(&[symbol, suffix]),
|
||||
bridge::LitKind::CStr => f(&["c\"", symbol, "\"", suffix]),
|
||||
bridge::LitKind::CStrRaw(n) => {
|
||||
let hashes = get_hashes_str(n);
|
||||
f(&["cr", hashes, "\"", symbol, "\"", hashes, suffix])
|
||||
}
|
||||
|
||||
bridge::LitKind::Integer | bridge::LitKind::Float | bridge::LitKind::Err => {
|
||||
f(&[symbol, suffix])
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user