Skip to content

Commit 80766d8

Browse files
committed
---
yaml --- r: 4894 b: refs/heads/master c: aae2127 h: refs/heads/master v: v3
1 parent 49f7853 commit 80766d8

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 6841f3827a9d05c63699bfe94a7db66f4847e0c4
2+
refs/heads/master: aae212727d40140181ca6f481b7e4bc75a64c796

trunk/src/comp/middle/shape.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,8 +308,13 @@ fn shape_of(ccx: &@crate_ctxt, t: ty::t) -> [u8] {
308308
ty::ty_str. {
309309
s += [shape_evec, 1u8, 1u8, 0u8, shape_u8];
310310
}
311-
ty::ty_istr. { s += [shape_ivec, 1u8, 1u8, 0u8, shape_u8]; }
312-
311+
ty::ty_istr. {
312+
s += [shape_ivec];
313+
add_bool(s, true); // type is POD
314+
let unit_ty = ty::mk_mach(ccx.tcx, ast::ty_u8);
315+
add_size_hint(ccx, s, unit_ty);
316+
add_substr(s, shape_of(ccx, unit_ty));
317+
}
313318

314319
ty::ty_tag(did, tps) {
315320
alt tag_kind(ccx, did) {

trunk/src/test/run-pass/istr.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,14 @@ fn test_heap_assign() {
1616
s = ~"AAAA";
1717
}
1818

19+
fn test_heap_log() {
20+
let s = ~"a big ol' string";
21+
log s;
22+
}
23+
1924
fn main() {
2025
test_stack_assign();
2126
test_heap_lit();
2227
test_heap_assign();
28+
test_heap_log();
2329
}

0 commit comments

Comments
 (0)