@@ -3,7 +3,6 @@ use crate::thir::cx::region::Scope;
3
3
use crate :: thir:: cx:: Cx ;
4
4
use crate :: thir:: util:: UserAnnotatedTyHelpers ;
5
5
use itertools:: Itertools ;
6
- use rustc_ast:: LitKind ;
7
6
use rustc_data_structures:: stack:: ensure_sufficient_stack;
8
7
use rustc_hir as hir;
9
8
use rustc_hir:: def:: { CtorKind , CtorOf , DefKind , Res } ;
@@ -22,8 +21,7 @@ use rustc_middle::ty::{
22
21
self , AdtKind , InlineConstArgs , InlineConstArgsParts , ScalarInt , Ty , UpvarArgs , UserType ,
23
22
} ;
24
23
use rustc_middle:: { bug, span_bug} ;
25
- use rustc_span:: source_map:: Spanned ;
26
- use rustc_span:: { sym, Span , DUMMY_SP } ;
24
+ use rustc_span:: { sym, Span } ;
27
25
use rustc_target:: abi:: { FieldIdx , FIRST_VARIANT } ;
28
26
use tracing:: { debug, info, instrument, trace} ;
29
27
@@ -899,14 +897,10 @@ impl<'tcx> Cx<'tcx> {
899
897
let hir_id = self . tcx . local_def_id_to_hir_id ( def_id. expect_local ( ) ) ;
900
898
let generics = self . tcx . generics_of ( hir_id. owner ) ;
901
899
let Some ( & index) = generics. param_def_id_to_index . get ( & def_id) else {
902
- let guar = self . tcx . dcx ( ) . has_errors ( ) . unwrap ( ) ;
903
- // We already errored about a late bound const
904
-
905
- let lit = self
906
- . tcx
907
- . hir_arena
908
- . alloc ( Spanned { span : DUMMY_SP , node : LitKind :: Err ( guar) } ) ;
909
- return ExprKind :: Literal { lit, neg : false } ;
900
+ span_bug ! (
901
+ expr. span,
902
+ "Should have already errored about late bound consts: {def_id:?}"
903
+ ) ;
910
904
} ;
911
905
let name = self . tcx . hir ( ) . name ( hir_id) ;
912
906
let param = ty:: ParamConst :: new ( index, name) ;
0 commit comments