@@ -31,7 +31,7 @@ use rustc_middle::ty::visit::TypeVisitableExt;
3131use rustc_middle:: ty:: {
3232 self , Binder , CanonicalUserTypeAnnotation , CanonicalUserTypeAnnotations , CoroutineArgsExt ,
3333 Dynamic , GenericArgsRef , OpaqueHiddenType , OpaqueTypeKey , RegionVid , Ty , TyCtxt , UserArgs ,
34- UserType , UserTypeAnnotationIndex ,
34+ UserTypeAnnotationIndex ,
3535} ;
3636use rustc_middle:: { bug, span_bug} ;
3737use rustc_mir_dataflow:: ResultsCursor ;
@@ -370,7 +370,10 @@ impl<'a, 'b, 'tcx> Visitor<'tcx> for TypeVerifier<'a, 'b, 'tcx> {
370370 } else {
371371 self . cx . ascribe_user_type (
372372 constant. const_ . ty ( ) ,
373- UserType :: TypeOf ( uv. def , UserArgs { args : uv. args , user_self_ty : None } ) ,
373+ ty:: UserType :: new ( ty:: UserTypeKind :: TypeOf ( uv. def , UserArgs {
374+ args : uv. args ,
375+ user_self_ty : None ,
376+ } ) ) ,
374377 locations. span ( self . cx . body ) ,
375378 ) ;
376379 }
@@ -991,9 +994,10 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
991994 for user_annotation in self . user_type_annotations {
992995 let CanonicalUserTypeAnnotation { span, ref user_ty, inferred_ty } = * user_annotation;
993996 let annotation = self . instantiate_canonical ( span, user_ty) ;
994- if let ty:: UserType :: TypeOf ( def, args) = annotation
997+ if let ty:: UserTypeKind :: TypeOf ( def, args) = annotation. kind
995998 && let DefKind :: InlineConst = tcx. def_kind ( def)
996999 {
1000+ assert ! ( annotation. bounds. is_empty( ) ) ;
9971001 self . check_inline_const ( inferred_ty, def. expect_local ( ) , args, span) ;
9981002 } else {
9991003 self . ascribe_user_type ( inferred_ty, annotation, span) ;
0 commit comments