Adopt for "Remove dereferencing of Box from codegen"
This commit is contained in:
parent
c58a11e935
commit
6d5e8f3843
10
src/base.rs
10
src/base.rs
@ -832,15 +832,7 @@ pub(crate) fn codegen_place<'tcx>(
|
|||||||
for elem in place.projection {
|
for elem in place.projection {
|
||||||
match elem {
|
match elem {
|
||||||
PlaceElem::Deref => {
|
PlaceElem::Deref => {
|
||||||
if cplace.layout().ty.is_box() {
|
cplace = cplace.place_deref(fx);
|
||||||
cplace = cplace
|
|
||||||
.place_field(fx, Field::new(0)) // Box<T> -> Unique<T>
|
|
||||||
.place_field(fx, Field::new(0)) // Unique<T> -> NonNull<T>
|
|
||||||
.place_field(fx, Field::new(0)) // NonNull<T> -> *mut T
|
|
||||||
.place_deref(fx);
|
|
||||||
} else {
|
|
||||||
cplace = cplace.place_deref(fx);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
PlaceElem::Field(field, _ty) => {
|
PlaceElem::Field(field, _ty) => {
|
||||||
cplace = cplace.place_field(fx, field);
|
cplace = cplace.place_field(fx, field);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user