ast: Keep string literals in ABIs precisely
This commit is contained in:
@@ -1233,7 +1233,8 @@ impl<'a> State<'a> {
|
||||
ast::ItemKind::ForeignMod(ref nmod) => {
|
||||
self.head("extern");
|
||||
if let Some(abi) = nmod.abi {
|
||||
self.print_abi(abi);
|
||||
self.print_literal(&abi.as_lit());
|
||||
self.nbsp();
|
||||
}
|
||||
self.bopen();
|
||||
self.print_foreign_mod(nmod, &item.attrs);
|
||||
@@ -2875,17 +2876,14 @@ impl<'a> State<'a> {
|
||||
}
|
||||
ast::Extern::Explicit(abi) => {
|
||||
self.word_nbsp("extern");
|
||||
self.print_abi(abi);
|
||||
self.print_literal(&abi.as_lit());
|
||||
self.nbsp();
|
||||
}
|
||||
}
|
||||
|
||||
self.s.word("fn")
|
||||
}
|
||||
|
||||
fn print_abi(&mut self, abi: ast::Abi) {
|
||||
self.word_nbsp(format!("\"{}\"", abi.symbol));
|
||||
}
|
||||
|
||||
crate fn print_unsafety(&mut self, s: ast::Unsafety) {
|
||||
match s {
|
||||
ast::Unsafety::Normal => {},
|
||||
|
||||
Reference in New Issue
Block a user