@@ -461,17 +461,17 @@ impl<'a, 'mir, 'tcx> Machine<'a, 'mir, 'tcx> for Evaluator<'tcx> {
461461 ) -> EvalResult < ' tcx , Cow < ' tcx , Allocation < Borrow , Self :: AllocExtra > > > {
462462 let attrs = tcx. get_attrs ( def_id) ;
463463 let link_name = match attr:: first_attr_value_str_by_name ( & attrs, "link_name" ) {
464- Some ( name) => name. as_str ( ) ,
465- None => tcx. item_name ( def_id) . as_str ( ) ,
464+ Some ( name) => name. as_str ( ) . get ( ) ,
465+ None => tcx. item_name ( def_id) . as_str ( ) . get ( ) ,
466466 } ;
467467
468- let alloc = match & link_name[ .. ] {
468+ let alloc = match link_name {
469469 "__cxa_thread_atexit_impl" => {
470470 // This should be all-zero, pointer-sized.
471471 let size = tcx. data_layout . pointer_size ;
472472 let data = vec ! [ 0 ; size. bytes( ) as usize ] ;
473473 let extra = AllocationExtra :: memory_allocated ( size, memory_extra) ;
474- Allocation :: from_bytes ( & data[ .. ] , tcx. data_layout . pointer_align . abi , extra)
474+ Allocation :: from_bytes ( & data, tcx. data_layout . pointer_align . abi , extra)
475475 }
476476 _ => return err ! ( Unimplemented (
477477 format!( "can't access foreign static: {}" , link_name) ,
0 commit comments