File tree Expand file tree Collapse file tree 2 files changed +20
-1
lines changed
test/ui/rfc-2091-track-caller Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -121,6 +121,25 @@ impl<'tcx> Instance<'tcx> {
121121 fn_sig. inputs_and_output = tcx. intern_type_list ( & inputs_and_output) ;
122122 fn_sig
123123 } ) ;
124+ } else if let InstanceDef :: ReifyShim ( ..) = self . def {
125+ // Modify fn(...) to fn(_location: &core::panic::Location, ...)
126+ #[ cfg( not( bootstrap) ) ]
127+ {
128+ use rustc:: middle:: lang_items:: PanicLocationLangItem ;
129+ let panic_loc_item = tcx. require_lang_item ( PanicLocationLangItem , None ) ;
130+ let panic_loc_ty = tcx. type_of ( panic_loc_item) ;
131+
132+ fn_sig = fn_sig. map_bound ( |mut fn_sig| {
133+ let mut inputs_and_output = fn_sig. inputs_and_output . to_vec ( ) ;
134+ inputs_and_output. insert ( 0 , panic_loc_ty) ;
135+ fn_sig. inputs_and_output = tcx. intern_type_list ( & inputs_and_output) ;
136+ fn_sig
137+ } ) ;
138+ }
139+ #[ cfg( bootstrap) ]
140+ {
141+ bug ! ( "#[track_caller] isn't supported during bootstrap (yet)." ) ;
142+ }
124143 }
125144 fn_sig
126145 }
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ LL | #![feature(track_caller)]
66 |
77 = note: `#[warn(incomplete_features)]` on by default
88
9- thread 'rustc' panicked at 'index out of bounds: the len is 0 but the index is 0 ', $SRC_DIR/libcore/slice/mod .rs:LL:COL
9+ thread 'rustc' panicked at 'assertion failed: !value.needs_subst() ', src/librustc/traits/query/normalize_erasing_regions .rs:59:9
1010note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
1111
1212error: internal compiler error: unexpected panic
You can’t perform that action at this time.
0 commit comments