diff options
| author | Bastian Kauschke <bastian_kauschke@hotmail.de> | 2020-03-23 10:58:07 +0100 |
|---|---|---|
| committer | Bastian Kauschke <bastian_kauschke@hotmail.de> | 2020-03-23 10:58:07 +0100 |
| commit | 6a7106cb328e0e43b2a0e1c07dc5c0cfbd1b31b9 (patch) | |
| tree | e00e7c04df074e6bcf52d37bae5fcb208832a0e4 | |
| parent | 645fedd183a341b5ab5553d4d35ce9140276371f (diff) | |
| download | rust-6a7106cb328e0e43b2a0e1c07dc5c0cfbd1b31b9.tar.gz rust-6a7106cb328e0e43b2a0e1c07dc5c0cfbd1b31b9.zip | |
type_of AnonConst AssocTy does not require parent
| -rw-r--r-- | src/librustc_typeck/collect/type_of.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/librustc_typeck/collect/type_of.rs b/src/librustc_typeck/collect/type_of.rs index eec87f3e3b0..f085486900d 100644 --- a/src/librustc_typeck/collect/type_of.rs +++ b/src/librustc_typeck/collect/type_of.rs @@ -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), |
