@@ -12,7 +12,7 @@ use rustc_middle::ty::adjustment::{
12
12
Adjust , Adjustment , AutoBorrow , AutoBorrowMutability , PointerCast ,
13
13
} ;
14
14
use rustc_middle:: ty:: subst:: { InternalSubsts , SubstsRef } ;
15
- use rustc_middle:: ty:: { self , AdtKind , Ty , TypeFoldable } ;
15
+ use rustc_middle:: ty:: { self , AdtKind , Ty } ;
16
16
use rustc_span:: Span ;
17
17
18
18
impl < ' tcx > Mirror < ' tcx > for & ' tcx hir:: Expr < ' tcx > {
@@ -718,7 +718,8 @@ fn convert_path_expr<'a, 'tcx>(
718
718
719
719
Res :: Def ( DefKind :: Ctor ( _, CtorKind :: Const ) , def_id) => {
720
720
let user_provided_types = cx. tables . user_provided_types ( ) ;
721
- let user_ty = user_provided_types. get ( expr. hir_id ) . copied ( ) ;
721
+ let user_provided_type = user_provided_types. get ( expr. hir_id ) . copied ( ) ;
722
+ debug ! ( "convert_path_expr: user_provided_type={:?}" , user_provided_type) ;
722
723
let ty = cx. tables ( ) . node_type ( expr. hir_id ) ;
723
724
match ty. kind {
724
725
// A unit struct/variant which is used as a value.
@@ -727,17 +728,10 @@ fn convert_path_expr<'a, 'tcx>(
727
728
adt_def,
728
729
variant_index : adt_def. variant_index_with_ctor_id ( def_id) ,
729
730
substs,
730
- user_ty,
731
+ user_ty : user_provided_type ,
731
732
fields : vec ! [ ] ,
732
733
base : None ,
733
734
} ,
734
- _ if ty. references_error ( ) => {
735
- // Handle degenerate input without ICE (#67377).
736
- ExprKind :: Literal {
737
- literal : ty:: Const :: zero_sized ( cx. tcx , cx. tcx . types . err ) ,
738
- user_ty : None ,
739
- }
740
- }
741
735
_ => bug ! ( "unexpected ty: {:?}" , ty) ,
742
736
}
743
737
}
0 commit comments