Remove space after negative sign in Literal to_string
This commit is contained in:
parent
d5fd37f00f
commit
3744dc8687
4 changed files with 8 additions and 4 deletions
|
@ -582,6 +582,9 @@ impl server::Literal for Rustc<'_> {
|
||||||
|
|
||||||
Ok(Literal { lit, span: self.call_site })
|
Ok(Literal { lit, span: self.call_site })
|
||||||
}
|
}
|
||||||
|
fn to_string(&mut self, literal: &Self::Literal) -> String {
|
||||||
|
literal.lit.to_string()
|
||||||
|
}
|
||||||
fn debug_kind(&mut self, literal: &Self::Literal) -> String {
|
fn debug_kind(&mut self, literal: &Self::Literal) -> String {
|
||||||
format!("{:?}", literal.lit.kind)
|
format!("{:?}", literal.lit.kind)
|
||||||
}
|
}
|
||||||
|
|
|
@ -109,6 +109,7 @@ macro_rules! with_api {
|
||||||
fn drop($self: $S::Literal);
|
fn drop($self: $S::Literal);
|
||||||
fn clone($self: &$S::Literal) -> $S::Literal;
|
fn clone($self: &$S::Literal) -> $S::Literal;
|
||||||
fn from_str(s: &str) -> Result<$S::Literal, ()>;
|
fn from_str(s: &str) -> Result<$S::Literal, ()>;
|
||||||
|
fn to_string($self: &$S::Literal) -> String;
|
||||||
fn debug_kind($self: &$S::Literal) -> String;
|
fn debug_kind($self: &$S::Literal) -> String;
|
||||||
fn symbol($self: &$S::Literal) -> String;
|
fn symbol($self: &$S::Literal) -> String;
|
||||||
fn suffix($self: &$S::Literal) -> Option<String>;
|
fn suffix($self: &$S::Literal) -> Option<String>;
|
||||||
|
|
|
@ -1195,7 +1195,7 @@ impl FromStr for Literal {
|
||||||
#[stable(feature = "proc_macro_lib", since = "1.15.0")]
|
#[stable(feature = "proc_macro_lib", since = "1.15.0")]
|
||||||
impl ToString for Literal {
|
impl ToString for Literal {
|
||||||
fn to_string(&self) -> String {
|
fn to_string(&self) -> String {
|
||||||
TokenStream::from(TokenTree::from(self.clone())).to_string()
|
self.0.to_string()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue