use tracing::{debug, error};
+#[rustfmt::skip] // https://github.com/rust-lang/rustfmt/issues/5213
macro_rules! down_cast_data {
($id:ident, $kind:ident, $sp:expr) => {
- let $id = if let super::Data::$kind(data) = $id {
- data
- } else {
+ let super::Data::$kind($id) = $id else {
span_bug!($sp, "unexpected data kind: {:?}", $id);
};
};
) {
debug!("process_method: {:?}:{}", def_id, ident);
- let map = &self.tcx.hir();
+ let map = self.tcx.hir();
let hir_id = map.local_def_id_to_hir_id(def_id);
self.nest_typeck_results(def_id, |v| {
if let Some(mut method_data) = v.save_ctxt.get_method_data(hir_id, ident, span) {
ty_params: &'tcx hir::Generics<'tcx>,
body: hir::BodyId,
) {
- let map = &self.tcx.hir();
+ let map = self.tcx.hir();
self.nest_typeck_results(item.def_id, |v| {
let body = map.body(body);
if let Some(fn_data) = v.save_ctxt.get_item_data(item) {
}
}
- let map = &self.tcx.hir();
+ let map = self.tcx.hir();
self.nest_typeck_results(item.def_id, |v| {
v.visit_ty(&impl_.self_ty);
if let Some(trait_ref) = &impl_.of_trait {
// walk generics and methods
self.process_generic_params(generics, &qualname, item.hir_id());
for method in methods {
- let map = &self.tcx.hir();
+ let map = self.tcx.hir();
self.process_trait_item(map.trait_item(method.id), item.def_id.to_def_id())
}
}