This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +7
-9
lines changed
compiler/rustc_mir_build/src/thir/cx
src/test/ui/const-generics/issues Expand file tree Collapse file tree 2 files changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -203,14 +203,12 @@ impl<'tcx> Cx<'tcx> {
203203 let res = self . typeck_results ( ) . qpath_res ( qpath, source. hir_id ) ;
204204 let ty = self . typeck_results ( ) . node_type ( source. hir_id ) ;
205205 let ty:: Adt ( adt_def, substs) = ty. kind ( ) else {
206- return ExprKind :: Cast { source : self . mirror_expr ( source) } ;
207- } ;
208- let Res :: Def (
209- DefKind :: Ctor ( CtorOf :: Variant , CtorKind :: Const ) ,
210- variant_ctor_id,
211- ) = res else {
212- return ExprKind :: Cast { source : self . mirror_expr ( source) } ;
213- } ;
206+ return ExprKind :: Cast { source : self . mirror_expr ( source) } ;
207+ } ;
208+
209+ let Res :: Def ( DefKind :: Ctor ( CtorOf :: Variant , CtorKind :: Const ) , variant_ctor_id) = res else {
210+ return ExprKind :: Cast { source : self . mirror_expr ( source) } ;
211+ } ;
214212
215213 let idx = adt_def. variant_index_with_ctor_id ( variant_ctor_id) ;
216214 let ( discr_did, discr_offset) = adt_def. discriminant_def_for_variant ( idx) ;
Original file line number Diff line number Diff line change 1- //build-pass
1+ // build-pass
22
33pub enum Register < const N : u16 > {
44 Field0 = 40 ,
You can’t perform that action at this time.
0 commit comments