X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=compiler%2Frustc_typeck%2Fsrc%2Fcollect%2Ftype_of.rs;h=5bb3f92e2f80b2ed5800c1a5a6d54bbc70f31412;hb=7907385999b4a83d37ed31d334f3ed9ca02983a1;hp=fa06ec09fce22c6e7ed0960af0240f2752ff2275;hpb=113f079a97ac3a1ab2fabbae274508cbcb248060;p=rust.git diff --git a/compiler/rustc_typeck/src/collect/type_of.rs b/compiler/rustc_typeck/src/collect/type_of.rs index fa06ec09fce..5bb3f92e2f8 100644 --- a/compiler/rustc_typeck/src/collect/type_of.rs +++ b/compiler/rustc_typeck/src/collect/type_of.rs @@ -337,8 +337,8 @@ pub(super) fn type_of(tcx: TyCtxt<'_>, def_id: DefId) -> Ty<'_> { icx.to_ty(ty) } } - ItemKind::TyAlias(self_ty, _) - | ItemKind::Impl(hir::Impl { self_ty, .. }) => icx.to_ty(self_ty), + ItemKind::TyAlias(self_ty, _) => icx.to_ty(self_ty), + ItemKind::Impl(hir::Impl { self_ty, .. }) => icx.to_ty(*self_ty), ItemKind::Fn(..) => { let substs = InternalSubsts::identity_for_item(tcx, def_id.to_def_id()); tcx.mk_fn_def(def_id.to_def_id(), substs) @@ -531,7 +531,7 @@ pub(super) fn type_of(tcx: TyCtxt<'_>, def_id: DefId) -> Ty<'_> { /// In particular, definitions of opaque types can only use other generics as arguments, /// and they cannot repeat an argument. Example: /// -/// ```rust +/// ```ignore (illustrative) /// type Foo = impl Bar; /// /// // Okay -- `Foo` is applied to two distinct, generic types.