proc_macro: remove Context trait, and put span methods directly on Server

This commit is contained in:
Nika Layzell 2022-06-25 12:11:44 -04:00
parent 55f052d9c9
commit 2456ff8928
2 changed files with 13 additions and 17 deletions

View file

@ -372,7 +372,7 @@ impl<'a, 'b> Rustc<'a, 'b> {
fn lit(&mut self, kind: token::LitKind, symbol: Symbol, suffix: Option<Symbol>) -> Literal {
Literal {
lit: token::Lit::new(kind, symbol, suffix),
span: server::Context::call_site(self),
span: server::Server::call_site(self),
}
}
}
@ -550,7 +550,7 @@ impl server::Group for Rustc<'_, '_> {
Group {
delimiter,
stream: stream.unwrap_or_default(),
span: DelimSpan::from_single(server::Context::call_site(self)),
span: DelimSpan::from_single(server::Server::call_site(self)),
flatten: false,
}
}
@ -582,7 +582,7 @@ impl server::Group for Rustc<'_, '_> {
impl server::Punct for Rustc<'_, '_> {
fn new(&mut self, ch: char, spacing: Spacing) -> Self::Punct {
Punct::new(ch, spacing == Spacing::Joint, server::Context::call_site(self))
Punct::new(ch, spacing == Spacing::Joint, server::Server::call_site(self))
}
fn as_char(&mut self, punct: Self::Punct) -> char {
@ -918,7 +918,7 @@ impl server::Span for Rustc<'_, '_> {
}
}
impl server::Context for Rustc<'_, '_> {
impl server::Server for Rustc<'_, '_> {
fn def_site(&mut self) -> Self::Span {
self.def_site
}