@@ -5,13 +5,13 @@ use rustc_abi as abi;
55use rustc_abi:: {
66 Align , BackendRepr , FIRST_VARIANT , FieldIdx , Primitive , Size , TagEncoding , VariantIdx , Variants ,
77} ;
8+ use rustc_hir:: LangItem ;
89use rustc_middle:: mir:: interpret:: { Pointer , Scalar , alloc_range} ;
910use rustc_middle:: mir:: { self , ConstValue } ;
1011use rustc_middle:: ty:: layout:: { LayoutOf , TyAndLayout } ;
1112use rustc_middle:: ty:: { self , Ty } ;
1213use rustc_middle:: { bug, span_bug} ;
1314use rustc_session:: config:: { AnnotateMoves , DebugInfo , OptLevel } ;
14- use rustc_span:: { Symbol , sym} ;
1515use tracing:: { debug, instrument} ;
1616
1717use super :: place:: { PlaceRef , PlaceValue } ;
@@ -1039,8 +1039,8 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
10391039 match * operand {
10401040 mir:: Operand :: Copy ( ref place) | mir:: Operand :: Move ( ref place) => {
10411041 let kind = match operand {
1042- mir:: Operand :: Move ( _) => sym :: compiler_move ,
1043- mir:: Operand :: Copy ( _) => sym :: compiler_copy ,
1042+ mir:: Operand :: Move ( _) => LangItem :: CompilerMove ,
1043+ mir:: Operand :: Copy ( _) => LangItem :: CompilerCopy ,
10441044 _ => unreachable ! ( ) ,
10451045 } ;
10461046
@@ -1086,7 +1086,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
10861086 & self ,
10871087 bx : & Bx ,
10881088 place : mir:: PlaceRef < ' tcx > ,
1089- kind : Symbol ,
1089+ kind : LangItem ,
10901090 ) -> Option < ty:: Instance < ' tcx > > {
10911091 let tcx = bx. tcx ( ) ;
10921092 let sess = tcx. sess ;
@@ -1116,9 +1116,8 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
11161116 return None ;
11171117 }
11181118
1119- // Look up the DefId for compiler_move or compiler_copy (skip if it's missing for some
1120- // reason).
1121- let def_id = tcx. get_diagnostic_item ( kind) ?;
1119+ // Look up the DefId for compiler_move or compiler_copy lang item
1120+ let def_id = tcx. lang_items ( ) . get ( kind) ?;
11221121
11231122 // Create generic args: compiler_move<T, SIZE> or compiler_copy<T, SIZE>
11241123 let size_const = ty:: Const :: from_target_usize ( tcx, ty_size) ;
0 commit comments