diff options
| author | Ellen <supbscripter@gmail.com> | 2021-08-07 20:55:37 +0100 |
|---|---|---|
| committer | Ellen <supbscripter@gmail.com> | 2021-08-07 20:55:37 +0100 |
| commit | 5f61271e382cfab7159a6dedcf673cafaab51e5a (patch) | |
| tree | 00f5d0c0e33afc4213a286ce6b28ff94a8000de2 /compiler | |
| parent | d777cb84e2d27a5f44eab94854b74fea33034bb4 (diff) | |
| download | rust-5f61271e382cfab7159a6dedcf673cafaab51e5a.tar.gz rust-5f61271e382cfab7159a6dedcf673cafaab51e5a.zip | |
fmt
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/rustc_typeck/src/collect/type_of.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_typeck/src/collect/type_of.rs b/compiler/rustc_typeck/src/collect/type_of.rs index 7083b11f7d0..b9483d6f987 100644 --- a/compiler/rustc_typeck/src/collect/type_of.rs +++ b/compiler/rustc_typeck/src/collect/type_of.rs @@ -192,9 +192,9 @@ pub(super) fn opt_const_param_of(tcx: TyCtxt<'_>, def_id: LocalDefId) -> Option< let res = segment.res.filter(|&r| r != Res::Err).unwrap_or(path.res); use def::CtorOf; let generics = match res { - Res::Def(DefKind::Ctor(CtorOf::Variant, _), def_id) => { - tcx.generics_of(tcx.parent(def_id).and_then(|def_id| tcx.parent(def_id)).unwrap()) - } + Res::Def(DefKind::Ctor(CtorOf::Variant, _), def_id) => tcx.generics_of( + tcx.parent(def_id).and_then(|def_id| tcx.parent(def_id)).unwrap(), + ), Res::Def(DefKind::Variant | DefKind::Ctor(CtorOf::Struct, _), def_id) => { tcx.generics_of(tcx.parent(def_id).unwrap()) } |
