@@ -12,7 +12,7 @@ use crate::astconv::errors::prohibit_assoc_ty_binding;
12
12
use crate :: astconv:: generics:: { check_generic_arg_count, create_args_for_parent_generic_args} ;
13
13
use crate :: bounds:: Bounds ;
14
14
use crate :: collect:: HirPlaceholderCollector ;
15
- use crate :: errors:: { AmbiguousLifetimeBound , TypeofReservedKeywordUsed } ;
15
+ use crate :: errors:: AmbiguousLifetimeBound ;
16
16
use crate :: middle:: resolve_bound_vars as rbv;
17
17
use crate :: require_c_abi_if_c_variadic;
18
18
use rustc_ast:: TraitObjectSyntax ;
@@ -30,8 +30,8 @@ use rustc_infer::infer::{InferCtxt, TyCtxtInferExt};
30
30
use rustc_infer:: traits:: ObligationCause ;
31
31
use rustc_middle:: middle:: stability:: AllowUnstable ;
32
32
use 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 ,
35
35
} ;
36
36
use rustc_session:: lint:: builtin:: AMBIGUOUS_ASSOCIATED_ITEMS ;
37
37
use rustc_span:: edit_distance:: find_best_match_for_name;
@@ -2539,21 +2539,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
2539
2539
2540
2540
Ty :: new_array_with_const_len ( tcx, self . ast_ty_to_ty ( ty) , length)
2541
2541
}
2542
- hir:: TyKind :: Typeof ( e) => {
2543
- let ty_erased = tcx. type_of ( e. def_id ) . instantiate_identity ( ) ;
2544
- let ty = tcx. fold_regions ( ty_erased, |r, _| {
2545
- if r. is_erased ( ) { tcx. lifetimes . re_static } else { r }
2546
- } ) ;
2547
- let span = ast_ty. span ;
2548
- let ( ty, opt_sugg) = if let Some ( ty) = ty. make_suggestable ( tcx, false ) {
2549
- ( ty, Some ( ( span, Applicability :: MachineApplicable ) ) )
2550
- } else {
2551
- ( ty, None )
2552
- } ;
2553
- tcx. dcx ( ) . emit_err ( TypeofReservedKeywordUsed { span, ty, opt_sugg } ) ;
2554
-
2555
- ty
2556
- }
2542
+ hir:: TyKind :: Typeof ( e) => tcx. type_of ( e. def_id ) . instantiate_identity ( ) ,
2557
2543
hir:: TyKind :: Infer => {
2558
2544
// Infer also appears as the type of arguments or return
2559
2545
// values in an ExprKind::Closure, or as
0 commit comments