]> git.lizzy.rs Git - rust.git/commitdiff
type_of AnonConst AssocTy does not require parent
authorBastian Kauschke <bastian_kauschke@hotmail.de>
Mon, 23 Mar 2020 09:58:07 +0000 (10:58 +0100)
committerBastian Kauschke <bastian_kauschke@hotmail.de>
Mon, 23 Mar 2020 09:58:07 +0000 (10:58 +0100)
src/librustc_typeck/collect/type_of.rs

index eec87f3e3b08be8fbfc82fed96d0120d3cbc0459..f085486900d744e0fef718916ad1cf76cb14698c 100644 (file)
@@ -259,7 +259,7 @@ pub(super) fn type_of(tcx: TyCtxt<'_>, def_id: DefId) -> Ty<'_> {
                         // default to the path resolution.
                         let res = segment.res.filter(|&r| r != Res::Err).unwrap_or(path.res);
                         let generics = match res {
-                            Res::Def(DefKind::Ctor(..) | DefKind::AssocTy, def_id) => {
+                            Res::Def(DefKind::Ctor(..), def_id) => {
                                 tcx.generics_of(tcx.parent(def_id).unwrap())
                             }
                             Res::Def(_, def_id) => tcx.generics_of(def_id),