@@ -12,7 +12,7 @@ use crate::astconv::errors::prohibit_assoc_ty_binding;
1212use crate :: astconv:: generics:: { check_generic_arg_count, create_args_for_parent_generic_args} ;
1313use crate :: bounds:: Bounds ;
1414use crate :: collect:: HirPlaceholderCollector ;
15- use crate :: errors:: { AmbiguousLifetimeBound , TypeofReservedKeywordUsed } ;
15+ use crate :: errors:: AmbiguousLifetimeBound ;
1616use crate :: middle:: resolve_bound_vars as rbv;
1717use crate :: require_c_abi_if_c_variadic;
1818use rustc_ast:: TraitObjectSyntax ;
@@ -25,13 +25,13 @@ use rustc_hir as hir;
2525use rustc_hir:: def:: { CtorOf , DefKind , Namespace , Res } ;
2626use rustc_hir:: def_id:: { DefId , LocalDefId } ;
2727use rustc_hir:: intravisit:: { walk_generics, Visitor as _} ;
28- use rustc_hir:: { GenericArg , GenericArgs , OpaqueTyOrigin } ;
28+ use rustc_hir:: { GenericArg , GenericArgs } ;
2929use rustc_infer:: infer:: { InferCtxt , TyCtxtInferExt } ;
3030use rustc_infer:: traits:: ObligationCause ;
3131use rustc_middle:: middle:: stability:: AllowUnstable ;
3232use rustc_middle:: ty:: {
33- self , Const , GenericArgKind , GenericArgsRef , GenericParamDefKind , IsSuggestable , ParamEnv , Ty ,
34- TyCtxt , TypeVisitableExt ,
33+ self , Const , GenericArgKind , GenericArgsRef , GenericParamDefKind , ParamEnv , Ty , TyCtxt ,
34+ TypeVisitableExt ,
3535} ;
3636use rustc_session:: lint:: builtin:: AMBIGUOUS_ASSOCIATED_ITEMS ;
3737use rustc_span:: edit_distance:: find_best_match_for_name;
@@ -379,7 +379,6 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
379379
380380 let mut arg_count = check_generic_arg_count (
381381 tcx,
382- span,
383382 def_id,
384383 seg,
385384 generics,
@@ -773,9 +772,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
773772 speculative,
774773 & mut dup_bindings,
775774 binding. span ,
776- constness,
777775 only_self_bounds,
778- polarity,
779776 ) ;
780777 // Okay to ignore `Err` because of `ErrorGuaranteed` (see above).
781778 }
@@ -2491,7 +2488,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
24912488 let opaque_ty = tcx. hir ( ) . item ( item_id) ;
24922489
24932490 match opaque_ty. kind {
2494- hir:: ItemKind :: OpaqueTy ( & hir:: OpaqueTy { origin , .. } ) => {
2491+ hir:: ItemKind :: OpaqueTy ( & hir:: OpaqueTy { .. } ) => {
24952492 let local_def_id = item_id. owner_id . def_id ;
24962493 // If this is an RPITIT and we are using the new RPITIT lowering scheme, we
24972494 // generate the def_id of an associated type for the trait and return as
@@ -2501,7 +2498,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
25012498 } else {
25022499 local_def_id. to_def_id ( )
25032500 } ;
2504- self . impl_trait_ty_to_ty ( def_id, lifetimes, origin , in_trait)
2501+ self . impl_trait_ty_to_ty ( def_id, lifetimes, in_trait)
25052502 }
25062503 ref i => bug ! ( "`impl Trait` pointed to non-opaque type?? {:#?}" , i) ,
25072504 }
@@ -2537,21 +2534,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
25372534
25382535 Ty :: new_array_with_const_len ( tcx, self . ast_ty_to_ty ( ty) , length)
25392536 }
2540- hir:: TyKind :: Typeof ( e) => {
2541- let ty_erased = tcx. type_of ( e. def_id ) . instantiate_identity ( ) ;
2542- let ty = tcx. fold_regions ( ty_erased, |r, _| {
2543- if r. is_erased ( ) { tcx. lifetimes . re_static } else { r }
2544- } ) ;
2545- let span = ast_ty. span ;
2546- let ( ty, opt_sugg) = if let Some ( ty) = ty. make_suggestable ( tcx, false ) {
2547- ( ty, Some ( ( span, Applicability :: MachineApplicable ) ) )
2548- } else {
2549- ( ty, None )
2550- } ;
2551- tcx. dcx ( ) . emit_err ( TypeofReservedKeywordUsed { span, ty, opt_sugg } ) ;
2552-
2553- ty
2554- }
2537+ hir:: TyKind :: Typeof ( e) => tcx. type_of ( e. def_id ) . instantiate_identity ( ) ,
25552538 hir:: TyKind :: Infer => {
25562539 // Infer also appears as the type of arguments or return
25572540 // values in an ExprKind::Closure, or as
@@ -2571,7 +2554,6 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
25712554 & self ,
25722555 def_id : DefId ,
25732556 lifetimes : & [ hir:: GenericArg < ' _ > ] ,
2574- origin : OpaqueTyOrigin ,
25752557 in_trait : bool ,
25762558 ) -> Ty < ' tcx > {
25772559 debug ! ( "impl_trait_ty_to_ty(def_id={:?}, lifetimes={:?})" , def_id, lifetimes) ;
0 commit comments