mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-16 17:53:30 +00:00
Avoid extra ref/deref cycles when converting &T to *T
This commit is contained in:
parent
eaf4c5c784
commit
a3d2d35fcb
@ -194,7 +194,8 @@ fn apply_adjustments<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
|
||||
// a different region or mutability, but we don't care here. It might
|
||||
// also be just in case we need to unsize. But if there are no nested
|
||||
// adjustments then it should be a no-op).
|
||||
Some(ty::AutoPtr(_, _, None)) if adj.autoderefs == 1 => {
|
||||
Some(ty::AutoPtr(_, _, None)) |
|
||||
Some(ty::AutoUnsafe(_, None)) if adj.autoderefs == 1 => {
|
||||
match datum.ty.sty {
|
||||
// Don't skip a conversion from Box<T> to &T, etc.
|
||||
ty::ty_rptr(..) => {
|
||||
|
Loading…
Reference in New Issue
Block a user