Nach dem Mausklick ist die Projektion eines vierdimensionalen Würfels zu sehen receiver.rs
Sprache: Rust
use proc_macro2::{Group, Span, TokenStream, TokenTree}; use std::iter::FromIterator; use syn::visit_mut::{self, VisitMut}; use syn::{
Block, ExprPath, Ident, Item, Macro, Pat, PatIdent, Path, Receiver, Signature, Token, TypePath,
};
fn visit_path_mut(&mutself, p: &mut Path) { if p.segments.len() == 1 { // Replace `self`, but not `self::function`. self.visit_ident_mut(&mut p.segments[0].ident);
} for segment in &mut p.segments { self.visit_path_arguments_mut(&mut segment.arguments);
}
}
fn visit_item_mut(&mutself, i: &mut Item) { // Visit `macro_rules!` because locally defined macros can refer to // `self`. // // Visit `futures::select` and similar select macros, which commonly // appear syntactically like an item despite expanding to an expression. // // Otherwise, do not recurse into nested items. iflet Item::Macro(i) = i { if i.mac.path.is_ident("macro_rules")
|| i.mac.path.segments.last().unwrap().ident == "select"
{ self.visit_macro_mut(&mut i.mac);
}
}
}
fn visit_macro_mut(&mutself, mac: &mutMacro) { // We can't tell in general whether `self` inside a macro invocation // refers to the self in the argument list or a different self // introduced within the macro. Heuristic: if the macro input contains // `fn`, then `self` is more likely to refer to something other than the // outer function's self argument. if !contains_fn(mac.tokens.clone()) { self.visit_token_stream(&mut mac.tokens);
}
}
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.11 Sekunden
(vorverarbeitet am 2026-06-19)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.