@@ -8,6 +8,7 @@ use crate::traits::*;
8
8
use crate :: MemFlags ;
9
9
10
10
use rustc_middle:: mir;
11
+ use rustc_middle:: mir:: Operand ;
11
12
use rustc_middle:: ty:: cast:: { CastTy , IntTy } ;
12
13
use rustc_middle:: ty:: layout:: { HasTyCtxt , LayoutOf } ;
13
14
use rustc_middle:: ty:: { self , adjustment:: PointerCast , Instance , Ty , TyCtxt } ;
@@ -401,6 +402,10 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
401
402
self . codegen_place_to_pointer ( bx, place, mk_ref)
402
403
}
403
404
405
+ mir:: Rvalue :: VirtualRef ( place) => {
406
+ let operand = self . codegen_operand ( & mut bx, & Operand :: Copy ( place) ) ;
407
+ ( bx, operand)
408
+ }
404
409
mir:: Rvalue :: AddressOf ( mutability, place) => {
405
410
let mk_ptr = move |tcx : TyCtxt < ' tcx > , ty : Ty < ' tcx > | {
406
411
tcx. mk_ptr ( ty:: TypeAndMut { ty, mutbl : mutability } )
@@ -755,6 +760,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
755
760
pub fn rvalue_creates_operand ( & self , rvalue : & mir:: Rvalue < ' tcx > , span : Span ) -> bool {
756
761
match * rvalue {
757
762
mir:: Rvalue :: Ref ( ..) |
763
+ mir:: Rvalue :: VirtualRef ( ..) |
758
764
mir:: Rvalue :: AddressOf ( ..) |
759
765
mir:: Rvalue :: Len ( ..) |
760
766
mir:: Rvalue :: Cast ( ..) | // (*)
0 commit comments