librustc_mir: don't allocate vectors where slices will do.
This commit is contained in:
parent
f5abfb1569
commit
71370c87f7
@ -117,7 +117,7 @@ impl<'tcx> MutVisitor<'tcx> for DerefArgVisitor<'tcx> {
|
||||
place,
|
||||
Place {
|
||||
local: self_arg(),
|
||||
projection: self.tcx().intern_place_elems(&vec![ProjectionElem::Deref]),
|
||||
projection: self.tcx().intern_place_elems(&[ProjectionElem::Deref]),
|
||||
},
|
||||
self.tcx,
|
||||
);
|
||||
@ -153,7 +153,7 @@ impl<'tcx> MutVisitor<'tcx> for PinArgVisitor<'tcx> {
|
||||
place,
|
||||
Place {
|
||||
local: self_arg(),
|
||||
projection: self.tcx().intern_place_elems(&vec![ProjectionElem::Field(
|
||||
projection: self.tcx().intern_place_elems(&[ProjectionElem::Field(
|
||||
Field::new(0),
|
||||
self.ref_gen_ty,
|
||||
)]),
|
||||
|
@ -51,7 +51,7 @@ impl<'tcx> MutVisitor<'tcx> for InstCombineVisitor<'tcx> {
|
||||
let new_place = match rvalue {
|
||||
Rvalue::Ref(_, _, place) => {
|
||||
if let &[ref proj_l @ .., proj_r] = place.projection.as_ref() {
|
||||
place.projection = self.tcx().intern_place_elems(&vec![proj_r.clone()]);
|
||||
place.projection = self.tcx().intern_place_elems(&[proj_r.clone()]);
|
||||
|
||||
Place {
|
||||
// Replace with dummy
|
||||
|
Loading…
Reference in New Issue
Block a user