Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
b-naber committed Jun 24, 2022
1 parent f39c0d6 commit bf48b62
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
14 changes: 6 additions & 8 deletions compiler/rustc_mir_build/src/thir/cx/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,14 +203,12 @@ impl<'tcx> Cx<'tcx> {
let res = self.typeck_results().qpath_res(qpath, source.hir_id);
let ty = self.typeck_results().node_type(source.hir_id);
let ty::Adt(adt_def, substs) = ty.kind() else {
return ExprKind::Cast { source: self.mirror_expr(source)};
};
let Res::Def(
DefKind::Ctor(CtorOf::Variant, CtorKind::Const),
variant_ctor_id,
) = res else {
return ExprKind::Cast { source: self.mirror_expr(source)};
};
return ExprKind::Cast { source: self.mirror_expr(source)};
};

let Res::Def(DefKind::Ctor(CtorOf::Variant, CtorKind::Const), variant_ctor_id) = res else {
return ExprKind::Cast { source: self.mirror_expr(source)};
};

let idx = adt_def.variant_index_with_ctor_id(variant_ctor_id);
let (discr_did, discr_offset) = adt_def.discriminant_def_for_variant(idx);
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/const-generics/issues/issue-97634.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//build-pass
// build-pass

pub enum Register<const N: u16> {
Field0 = 40,
Expand Down

0 comments on commit bf48b62

Please sign in to comment.