1
Fork 0

rustc_ast: Turn MutVisitor::token_visiting_enabled into a constant

It's a visitor property rather than something that needs to be determined at runtime
This commit is contained in:
Vadim Petrochenkov 2021-10-18 00:06:40 +03:00
parent 8db8f48ea8
commit d2470e74e1
3 changed files with 8 additions and 13 deletions

View file

@ -19,9 +19,7 @@ use std::mem;
struct Marker(LocalExpnId, Transparency);
impl MutVisitor for Marker {
fn token_visiting_enabled(&self) -> bool {
true
}
const VISIT_TOKENS: bool = true;
fn visit_span(&mut self, span: &mut Span) {
*span = span.apply_mark(self.0.to_expn_id(), self.1)

View file

@ -15,9 +15,8 @@ fn print_crate_items(krate: &ast::Crate) -> String {
struct ToZzIdentMutVisitor;
impl MutVisitor for ToZzIdentMutVisitor {
fn token_visiting_enabled(&self) -> bool {
true
}
const VISIT_TOKENS: bool = true;
fn visit_ident(&mut self, ident: &mut Ident) {
*ident = Ident::from_str("zz");
}