Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit adafc2f

Browse files
committedMar 17, 2016
---
yaml --- r: 282025 b: refs/heads/stable c: ccc5e07 h: refs/heads/master i: 282023: 6931641
1 parent 841bede commit adafc2f

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed
 

‎[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ refs/heads/tmp: e06d2ad9fcd5027bcaac5b08fc9aa39a49d0ecd3
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3030
refs/tags/homu-tmp: 3c795e08d6f4a532f12f3f8e1837db5e0647f8b0
3131
refs/tags/1.0.0-beta: 8cbb92b53468ee2b0c2d3eeb8567005953d40828
32-
refs/heads/stable: 1de6a9682f16a893cd5651db28e26a1cd92fd459
32+
refs/heads/stable: ccc5e0732a95861de755cf14bec05d873bfa7481
3333
refs/tags/1.0.0: 55bd4f8ff2b323f317ae89e254ce87162d52a375
3434
refs/tags/1.1.0: bc3c16f09287e5545c1d3f76b7abd54f2eca868b
3535
refs/tags/1.2.0: f557861f822c34f07270347b94b5280de20a597e

‎branches/stable/src/librustc_mir/build/expr/as_rvalue.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,13 @@ impl<'a,'tcx> Builder<'a,'tcx> {
7373
})
7474
}
7575
ExprKind::Cast { source } => {
76-
let source = unpack!(block = this.as_operand(block, source));
77-
block.and(Rvalue::Cast(CastKind::Misc, source, expr.ty))
76+
let source = this.hir.mirror(source);
77+
if source.ty == expr.ty {
78+
this.expr_as_rvalue(block, source)
79+
} else {
80+
let source = unpack!(block = this.as_operand(block, source));
81+
block.and(Rvalue::Cast(CastKind::Misc, source, expr.ty))
82+
}
7883
}
7984
ExprKind::ReifyFnPointer { source } => {
8085
let source = unpack!(block = this.as_operand(block, source));

0 commit comments

Comments
 (0)
Please sign in to comment.