File tree 2 files changed +20
-1
lines changed
test/ui/rfc-2091-track-caller
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> {
121
121
fn_sig. inputs_and_output = tcx. intern_type_list ( & inputs_and_output) ;
122
122
fn_sig
123
123
} ) ;
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
+ }
124
143
}
125
144
fn_sig
126
145
}
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ LL | #![feature(track_caller)]
6
6
|
7
7
= note: `#[warn(incomplete_features)]` on by default
8
8
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
10
10
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
11
11
12
12
error: internal compiler error: unexpected panic
You can’t perform that action at this time.
0 commit comments