Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
BoxyUwU committed Aug 7, 2021
1 parent d777cb8 commit 5f61271
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions compiler/rustc_typeck/src/collect/type_of.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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())
}
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/const-generics/enum-variants.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// check-pass
pub enum Foo<const N: usize> {
enum Foo<const N: usize> {
Variant,
Variant2(),
Variant3{},
Expand Down

0 comments on commit 5f61271

Please sign in to comment.