X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;ds=sidebyside;f=compiler%2Frustc_middle%2Fsrc%2Fty%2Fprint%2Fpretty.rs;h=4c0bc2e4337c712ffd96f09cc6d90f744c4abf20;hb=91afd0263269c44d57fe127f4c20748b5747113b;hp=991666908f94a83c2ee1409518e0f8d15dd09df9;hpb=3d18f945cab17c98a2d4bedd174c47a24ecfe8f4;p=rust.git diff --git a/compiler/rustc_middle/src/ty/print/pretty.rs b/compiler/rustc_middle/src/ty/print/pretty.rs index 991666908f9..4c0bc2e4337 100644 --- a/compiler/rustc_middle/src/ty/print/pretty.rs +++ b/compiler/rustc_middle/src/ty/print/pretty.rs @@ -587,7 +587,7 @@ fn pretty_print_type(mut self, ty: Ty<'tcx>) -> Result p!(")") } ty::FnDef(def_id, substs) => { - let sig = self.tcx().fn_sig(def_id).subst(self.tcx(), substs); + let sig = self.tcx().bound_fn_sig(def_id).subst(self.tcx(), substs); p!(print(sig), " {{", print_value_path(def_id, substs), "}}"); } ty::FnPtr(ref bare_fn) => p!(print(bare_fn)), @@ -774,13 +774,13 @@ fn pretty_print_opaque_impl_type( // Grab the "TraitA + TraitB" from `impl TraitA + TraitB`, // by looking up the projections associated with the def_id. - let bounds = self.tcx().explicit_item_bounds(def_id); + let bounds = self.tcx().bound_explicit_item_bounds(def_id); let mut traits = BTreeMap::new(); let mut fn_traits = BTreeMap::new(); let mut is_sized = false; - for (predicate, _) in bounds { + for predicate in bounds.transpose_iter().map(|e| e.map_bound(|(p, _)| *p)) { let predicate = predicate.subst(self.tcx(), substs); let bound_predicate = predicate.kind(); @@ -2676,7 +2676,7 @@ fn for_each_def(tcx: TyCtxt<'_>, mut collect_fn: impl for<'b> FnMut(&'b Ident, N // Iterate all local crate items no matter where they are defined. let hir = tcx.hir(); for id in hir.items() { - if matches!(hir.def_kind(id.def_id), DefKind::Use) { + if matches!(tcx.def_kind(id.def_id), DefKind::Use) { continue; }