fix: Fix proc-macro server not using the supplied span in Ident::new

This commit is contained in:
Lukas Wirth 2022-01-31 16:56:33 +01:00
parent 45ff51ba22
commit f6def3ccdf
5 changed files with 8 additions and 48 deletions

View file

@ -463,13 +463,8 @@ impl server::Punct for Rustc {
}
impl server::Ident for Rustc {
fn new(&mut self, string: &str, _span: Self::Span, _is_raw: bool) -> Self::Ident {
IdentId(
self.ident_interner.intern(&IdentData(tt::Ident {
text: string.into(),
id: tt::TokenId::unspecified(),
})),
)
fn new(&mut self, string: &str, span: Self::Span, _is_raw: bool) -> Self::Ident {
IdentId(self.ident_interner.intern(&IdentData(tt::Ident { text: string.into(), id: span })))
}
fn span(&mut self, ident: Self::Ident) -> Self::Span {

View file

@ -463,13 +463,8 @@ impl server::Punct for Rustc {
}
impl server::Ident for Rustc {
fn new(&mut self, string: &str, _span: Self::Span, _is_raw: bool) -> Self::Ident {
IdentId(
self.ident_interner.intern(&IdentData(tt::Ident {
text: string.into(),
id: tt::TokenId::unspecified(),
})),
)
fn new(&mut self, string: &str, span: Self::Span, _is_raw: bool) -> Self::Ident {
IdentId(self.ident_interner.intern(&IdentData(tt::Ident { text: string.into(), id: span })))
}
fn span(&mut self, ident: Self::Ident) -> Self::Span {

View file

@ -464,13 +464,8 @@ impl server::Punct for Rustc {
}
impl server::Ident for Rustc {
fn new(&mut self, string: &str, _span: Self::Span, _is_raw: bool) -> Self::Ident {
IdentId(
self.ident_interner.intern(&IdentData(tt::Ident {
text: string.into(),
id: tt::TokenId::unspecified(),
})),
)
fn new(&mut self, string: &str, span: Self::Span, _is_raw: bool) -> Self::Ident {
IdentId(self.ident_interner.intern(&IdentData(tt::Ident { text: string.into(), id: span })))
}
fn span(&mut self, ident: Self::Ident) -> Self::Span {

View file

@ -468,13 +468,8 @@ impl server::Punct for Rustc {
}
impl server::Ident for Rustc {
fn new(&mut self, string: &str, _span: Self::Span, _is_raw: bool) -> Self::Ident {
IdentId(
self.ident_interner.intern(&IdentData(tt::Ident {
text: string.into(),
id: tt::TokenId::unspecified(),
})),
)
fn new(&mut self, string: &str, span: Self::Span, _is_raw: bool) -> Self::Ident {
IdentId(self.ident_interner.intern(&IdentData(tt::Ident { text: string.into(), id: span })))
}
fn span(&mut self, ident: Self::Ident) -> Self::Span {