@@ -8,6 +8,7 @@ use crate::traits::*;
88use crate :: MemFlags ;
99
1010use rustc_middle:: mir;
11+ use rustc_middle:: mir:: Operand ;
1112use rustc_middle:: ty:: cast:: { CastTy , IntTy } ;
1213use rustc_middle:: ty:: layout:: { HasTyCtxt , LayoutOf } ;
1314use rustc_middle:: ty:: { self , adjustment:: PointerCast , Instance , Ty , TyCtxt } ;
@@ -401,6 +402,10 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
401402 self . codegen_place_to_pointer ( bx, place, mk_ref)
402403 }
403404
405+ mir:: Rvalue :: VirtualRef ( place) => {
406+ let operand = self . codegen_operand ( & mut bx, & Operand :: Copy ( place) ) ;
407+ ( bx, operand)
408+ }
404409 mir:: Rvalue :: AddressOf ( mutability, place) => {
405410 let mk_ptr = move |tcx : TyCtxt < ' tcx > , ty : Ty < ' tcx > | {
406411 tcx. mk_ptr ( ty:: TypeAndMut { ty, mutbl : mutability } )
@@ -755,6 +760,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
755760 pub fn rvalue_creates_operand ( & self , rvalue : & mir:: Rvalue < ' tcx > , span : Span ) -> bool {
756761 match * rvalue {
757762 mir:: Rvalue :: Ref ( ..) |
763+ mir:: Rvalue :: VirtualRef ( ..) |
758764 mir:: Rvalue :: AddressOf ( ..) |
759765 mir:: Rvalue :: Len ( ..) |
760766 mir:: Rvalue :: Cast ( ..) | // (*)
0 commit comments