File tree 2 files changed +7
-9
lines changed
compiler/rustc_mir_build/src/thir/cx
src/test/ui/const-generics/issues
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> {
203
203
let res = self . typeck_results ( ) . qpath_res ( qpath, source. hir_id ) ;
204
204
let ty = self . typeck_results ( ) . node_type ( source. hir_id ) ;
205
205
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
+ } ;
214
212
215
213
let idx = adt_def. variant_index_with_ctor_id ( variant_ctor_id) ;
216
214
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
2
2
3
3
pub enum Register < const N : u16 > {
4
4
Field0 = 40 ,
You can’t perform that action at this time.
0 commit comments