@@ -28,8 +28,8 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
2828 // (as opposed to through a place), we have to remember to erase any tag
2929 // that might still hang around!
3030
31- let intrinsic_name = this. tcx . item_name ( instance. def_id ( ) ) . as_str ( ) ;
32- match intrinsic_name. get ( ) {
31+ let intrinsic_name = & * this. tcx . item_name ( instance. def_id ( ) ) . as_str ( ) ;
32+ match intrinsic_name {
3333 "arith_offset" => {
3434 let offset = this. read_scalar ( args[ 1 ] ) ?. to_isize ( this) ?;
3535 let ptr = this. read_scalar ( args[ 0 ] ) ?. not_undef ( ) ?;
@@ -228,7 +228,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
228228 "log10f32" | "log2f32" | "floorf32" | "ceilf32" | "truncf32" | "roundf32" => {
229229 // FIXME: Using host floats.
230230 let f = f32:: from_bits ( this. read_scalar ( args[ 0 ] ) ?. to_u32 ( ) ?) ;
231- let f = match intrinsic_name. get ( ) {
231+ let f = match intrinsic_name {
232232 "sinf32" => f. sin ( ) ,
233233 "fabsf32" => f. abs ( ) ,
234234 "cosf32" => f. cos ( ) ,
@@ -251,7 +251,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
251251 "log10f64" | "log2f64" | "floorf64" | "ceilf64" | "truncf64" | "roundf64" => {
252252 // FIXME: Using host floats.
253253 let f = f64:: from_bits ( this. read_scalar ( args[ 0 ] ) ?. to_u64 ( ) ?) ;
254- let f = match intrinsic_name. get ( ) {
254+ let f = match intrinsic_name {
255255 "sinf64" => f. sin ( ) ,
256256 "fabsf64" => f. abs ( ) ,
257257 "cosf64" => f. cos ( ) ,
@@ -273,7 +273,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
273273 "fadd_fast" | "fsub_fast" | "fmul_fast" | "fdiv_fast" | "frem_fast" => {
274274 let a = this. read_immediate ( args[ 0 ] ) ?;
275275 let b = this. read_immediate ( args[ 1 ] ) ?;
276- let op = match intrinsic_name. get ( ) {
276+ let op = match intrinsic_name {
277277 "fadd_fast" => mir:: BinOp :: Add ,
278278 "fsub_fast" => mir:: BinOp :: Sub ,
279279 "fmul_fast" => mir:: BinOp :: Mul ,
@@ -287,7 +287,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
287287 "minnumf32" | "maxnumf32" => {
288288 let a = this. read_scalar ( args[ 0 ] ) ?. to_f32 ( ) ?;
289289 let b = this. read_scalar ( args[ 1 ] ) ?. to_f32 ( ) ?;
290- let res = if intrinsic_name. get ( ) . starts_with ( "min" ) {
290+ let res = if intrinsic_name. starts_with ( "min" ) {
291291 a. min ( b)
292292 } else {
293293 a. max ( b)
@@ -298,7 +298,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
298298 "minnumf64" | "maxnumf64" => {
299299 let a = this. read_scalar ( args[ 0 ] ) ?. to_f64 ( ) ?;
300300 let b = this. read_scalar ( args[ 1 ] ) ?. to_f64 ( ) ?;
301- let res = if intrinsic_name. get ( ) . starts_with ( "min" ) {
301+ let res = if intrinsic_name. starts_with ( "min" ) {
302302 a. min ( b)
303303 } else {
304304 a. max ( b)
@@ -509,15 +509,15 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
509509 "unchecked_add" | "unchecked_sub" | "unchecked_mul" => {
510510 let l = this. read_immediate ( args[ 0 ] ) ?;
511511 let r = this. read_immediate ( args[ 1 ] ) ?;
512- let op = match intrinsic_name. get ( ) {
512+ let op = match intrinsic_name {
513513 "unchecked_add" => mir:: BinOp :: Add ,
514514 "unchecked_sub" => mir:: BinOp :: Sub ,
515515 "unchecked_mul" => mir:: BinOp :: Mul ,
516516 _ => bug ! ( ) ,
517517 } ;
518518 let ( res, overflowed, _ty) = this. overflowing_binary_op ( op, l, r) ?;
519519 if overflowed {
520- throw_ub_format ! ( "Overflowing arithmetic in {}" , intrinsic_name. get ( ) ) ;
520+ throw_ub_format ! ( "Overflowing arithmetic in {}" , intrinsic_name) ;
521521 }
522522 this. write_scalar ( res, dest) ?;
523523 }
0 commit comments