File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
src/librustc_mir/interpret Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -179,12 +179,16 @@ impl<'tcx> super::Machine<'tcx> for CompileTimeFunctionEvaluator {
179
179
fn ptr_op < ' a > (
180
180
_ecx : & EvalContext < ' a , ' tcx , Self > ,
181
181
_bin_op : mir:: BinOp ,
182
- _left : PrimVal ,
182
+ left : PrimVal ,
183
183
_left_ty : Ty < ' tcx > ,
184
- _right : PrimVal ,
184
+ right : PrimVal ,
185
185
_right_ty : Ty < ' tcx > ,
186
186
) -> EvalResult < ' tcx , Option < ( PrimVal , bool ) > > {
187
- Err ( ConstEvalError :: NeedsRfc ( "Pointer arithmetic or comparison" . to_string ( ) ) . into ( ) )
187
+ if left. is_bytes ( ) && right. is_bytes ( ) {
188
+ Ok ( None )
189
+ } else {
190
+ Err ( ConstEvalError :: NeedsRfc ( "Pointer arithmetic or comparison" . to_string ( ) ) . into ( ) )
191
+ }
188
192
}
189
193
190
194
fn mark_static_initialized ( m : !) -> EvalResult < ' tcx > {
You can’t perform that action at this time.
0 commit comments