Rollup merge of #89991 - petrochenkov:visitok2, r=jackh726
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:
commit
cbebdd8e67
3 changed files with 8 additions and 13 deletions
|
@ -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)
|
||||
|
|
|
@ -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");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue