Skip to content

Commit

Permalink
type_of AnonConst AssocTy does not require parent
Browse files Browse the repository at this point in the history
  • Loading branch information
lcnr committed Mar 23, 2020
1 parent 645fedd commit 6a7106c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/librustc_typeck/collect/type_of.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down

0 comments on commit 6a7106c

Please sign in to comment.