mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 23:34:48 +00:00
type_of AnonConst AssocTy does not require parent
This commit is contained in:
parent
645fedd183
commit
6a7106cb32
@ -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),
|
||||
|
Loading…
Reference in New Issue
Block a user