Skip to content

Commit cc7ec4b

Browse files
committed
---
yaml --- r: 273278 b: refs/heads/beta c: 82fad1d h: refs/heads/master
1 parent 9952605 commit cc7ec4b

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ refs/tags/0.9: 36870b185fc5f5486636d4515f0e22677493f225
2323
refs/tags/0.10: ac33f2b15782272ae348dbd7b14b8257b2148b5a
2424
refs/tags/0.11.0: e1247cb1d0d681be034adb4b558b5a0c0d5720f9
2525
refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
26-
refs/heads/beta: 3e98220a1cc9059807961472a9132157cdf3c047
26+
refs/heads/beta: 82fad1dfc70c641c28f8a422934b89bf983925b8
2727
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
2828
refs/heads/tmp: e06d2ad9fcd5027bcaac5b08fc9aa39a49d0ecd3
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f

branches/beta/src/librustc_trans/trans/mir/rvalue.rs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ impl<'bcx, 'tcx> MirContext<'bcx, 'tcx> {
5454
bcx
5555
}
5656

57-
mir::Rvalue::Cast(mir::CastKind::Unsize, ref operand, cast_ty) => {
57+
mir::Rvalue::Cast(mir::CastKind::Unsize, ref source, cast_ty) => {
5858
if common::type_is_fat_ptr(bcx.tcx(), cast_ty) {
5959
// into-coerce of a thin pointer to a fat pointer - just
6060
// use the operand path.
@@ -67,7 +67,7 @@ impl<'bcx, 'tcx> MirContext<'bcx, 'tcx> {
6767
// this to be eliminated by MIR translation, but
6868
// `CoerceUnsized` can be passed by a where-clause,
6969
// so the (generic) MIR may not be able to expand it.
70-
let operand = self.trans_operand(&bcx, operand);
70+
let operand = self.trans_operand(&bcx, source);
7171
bcx.with_block(|bcx| {
7272
match operand.val {
7373
OperandValue::FatPtr(..) => unreachable!(),
@@ -92,6 +92,7 @@ impl<'bcx, 'tcx> MirContext<'bcx, 'tcx> {
9292
}
9393
}
9494
});
95+
self.set_operand_dropped(&bcx, source);
9596
bcx
9697
}
9798

@@ -127,8 +128,8 @@ impl<'bcx, 'tcx> MirContext<'bcx, 'tcx> {
127128
adt::trans_field_ptr(bcx, &repr, val, disr, i)
128129
});
129130
self.store_operand(&bcx, lldest_i, op);
130-
self.set_operand_dropped(&bcx, operand);
131131
}
132+
self.set_operand_dropped(&bcx, operand);
132133
}
133134
},
134135
_ => {
@@ -166,8 +167,8 @@ impl<'bcx, 'tcx> MirContext<'bcx, 'tcx> {
166167
// not be structs but arrays.
167168
let dest = bcx.gepi(dest.llval, &[0, i]);
168169
self.store_operand(&bcx, dest, op);
169-
self.set_operand_dropped(&bcx, operand);
170170
}
171+
self.set_operand_dropped(&bcx, operand);
171172
}
172173
}
173174
}
@@ -216,8 +217,8 @@ impl<'bcx, 'tcx> MirContext<'bcx, 'tcx> {
216217
assert!(rvalue_creates_operand(rvalue), "cannot trans {:?} to operand", rvalue);
217218

218219
match *rvalue {
219-
mir::Rvalue::Cast(ref kind, ref operand, cast_ty) => {
220-
let operand = self.trans_operand(&bcx, operand);
220+
mir::Rvalue::Cast(ref kind, ref source, cast_ty) => {
221+
let operand = self.trans_operand(&bcx, source);
221222
debug!("cast operand is {:?}", operand);
222223
let cast_ty = bcx.monomorphize(&cast_ty);
223224

@@ -250,6 +251,7 @@ impl<'bcx, 'tcx> MirContext<'bcx, 'tcx> {
250251
// example,
251252
// &'a fmt::Debug+Send => &'a fmt::Debug,
252253
// and is a no-op at the LLVM level
254+
self.set_operand_dropped(&bcx, source);
253255
operand.val
254256
}
255257
OperandValue::Immediate(lldata) => {
@@ -258,6 +260,7 @@ impl<'bcx, 'tcx> MirContext<'bcx, 'tcx> {
258260
base::unsize_thin_ptr(bcx, lldata,
259261
operand.ty, cast_ty)
260262
});
263+
self.set_operand_dropped(&bcx, source);
261264
OperandValue::FatPtr(lldata, llextra)
262265
}
263266
OperandValue::Ref(_) => {

0 commit comments

Comments
 (0)