Skip to content

Commit ac531e6

Browse files
committed
---
yaml --- r: 23123 b: refs/heads/master c: 770a212 h: refs/heads/master i: 23121: f2c528b 23119: 4e512e6 v: v3
1 parent 3874adf commit ac531e6

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: b9b0d374d3fee6ba204943edff750e5d5739c82a
2+
refs/heads/master: 770a21272b392aff2ad3468496c08ae983026298
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: cd6f24f9d14ac90d167386a56e7a6ac1f0318195
55
refs/heads/try: ffbe0e0e00374358b789b0037bcb3a577cd218be

trunk/src/rustc/middle/trans/base.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3515,6 +3515,12 @@ fn trans_struct(block_context: block, span: span, fields: ~[ast::field],
35153515
}
35163516
}
35173517

3518+
// Add the drop flag if necessary.
3519+
if ty::ty_dtor(block_context.tcx(), class_id).is_some() {
3520+
let llflagptr = GEPi(block_context, dest_address, ~[0, 0]);
3521+
Store(block_context, C_u8(1), llflagptr);
3522+
}
3523+
35183524
// Now translate each field.
35193525
let mut temp_cleanups = ~[];
35203526
for fields.each |field| {
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
struct foo {
2+
x: ~str;
3+
drop { #error["%s", self.x]; }
4+
}
5+
6+
fn main() {
7+
let _z = foo { x: ~"Hello" };
8+
}

0 commit comments

Comments
 (0)