From 5f61271e382cfab7159a6dedcf673cafaab51e5a Mon Sep 17 00:00:00 2001 From: Ellen Date: Sat, 7 Aug 2021 20:55:37 +0100 Subject: [PATCH] fmt --- compiler/rustc_typeck/src/collect/type_of.rs | 6 +++--- src/test/ui/const-generics/enum-variants.rs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/compiler/rustc_typeck/src/collect/type_of.rs b/compiler/rustc_typeck/src/collect/type_of.rs index 7083b11f7d0a..b9483d6f9876 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()) } diff --git a/src/test/ui/const-generics/enum-variants.rs b/src/test/ui/const-generics/enum-variants.rs index a82db1c4b321..5c6c4a8efac1 100644 --- a/src/test/ui/const-generics/enum-variants.rs +++ b/src/test/ui/const-generics/enum-variants.rs @@ -1,5 +1,5 @@ // check-pass -pub enum Foo { +enum Foo { Variant, Variant2(), Variant3{},