Skip to content

Commit

Permalink
Avoid extra ref/deref cycles when converting &T to *T
Browse files Browse the repository at this point in the history
  • Loading branch information
dotdash committed Feb 3, 2015
1 parent eaf4c5c commit a3d2d35
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/librustc_trans/trans/expr.rs
Expand Up @@ -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(..) => {
Expand Down

0 comments on commit a3d2d35

Please sign in to comment.