Skip to content

Commit 06d0708

Browse files
committed
---
yaml --- r: 72126 b: refs/heads/dist-snap c: 3ffaaab h: refs/heads/master v: v3
1 parent be58f60 commit 06d0708

File tree

3 files changed

+14
-7
lines changed

3 files changed

+14
-7
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
99
refs/heads/incoming: b50030718cf28f2a5a81857a26b57442734fe854
10-
refs/heads/dist-snap: af42d37547c15732a7c9d358c0a14967aef75e96
10+
refs/heads/dist-snap: 3ffaaab9e9e3a2437fd9ed5b04cf3ba3695cc2d2
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1313
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/src/librustc/middle/ty.rs

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ pub type ctxt = @ctxt_;
232232

233233
struct ctxt_ {
234234
diag: @syntax::diagnostic::span_handler,
235-
interner: @mut HashMap<intern_key, t_box>,
235+
interner: @mut HashMap<intern_key, ~t_box_>,
236236
next_id: @mut uint,
237237
vecs_implicitly_copyable: bool,
238238
legacy_modes: bool,
@@ -320,7 +320,7 @@ enum tbox_flag {
320320
needs_subst = 1 | 2 | 8
321321
}
322322

323-
type t_box = @t_box_;
323+
type t_box = &'static t_box_;
324324

325325
struct t_box_ {
326326
sty: sty,
@@ -903,7 +903,7 @@ fn mk_t(cx: ctxt, +st: sty) -> t { mk_t_with_id(cx, st, None) }
903903
fn mk_t_with_id(cx: ctxt, +st: sty, o_def_id: Option<ast::def_id>) -> t {
904904
let key = intern_key { sty: to_unsafe_ptr(&st), o_def_id: o_def_id };
905905
match cx.interner.find(&key) {
906-
Some(&t) => unsafe { return cast::reinterpret_cast(&t); },
906+
Some(t) => unsafe { return cast::transmute(&t.sty); },
907907
_ => ()
908908
}
909909

@@ -973,21 +973,27 @@ fn mk_t_with_id(cx: ctxt, +st: sty, o_def_id: Option<ast::def_id>) -> t {
973973
}
974974
}
975975

976-
let t = @t_box_ {
976+
let t = ~t_box_ {
977977
sty: st,
978978
id: *cx.next_id,
979979
flags: flags,
980980
o_def_id: o_def_id
981981
};
982+
983+
let sty_ptr = to_unsafe_ptr(&t.sty);
984+
982985
let key = intern_key {
983-
sty: to_unsafe_ptr(&t.sty),
986+
sty: sty_ptr,
984987
o_def_id: o_def_id
985988
};
986989

987990
cx.interner.insert(key, t);
988991

989992
*cx.next_id += 1;
990-
unsafe { cast::reinterpret_cast(&t) }
993+
994+
unsafe {
995+
cast::transmute::<*sty, t>(sty_ptr)
996+
}
991997
}
992998

993999
pub fn mk_nil(cx: ctxt) -> t { mk_t(cx, ty_nil) }

branches/dist-snap/src/test/bench/core-map.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ fn vector<M: Map<uint, uint>>(map: &mut M, n_keys: uint, dist: &[uint]) {
8888
}
8989
}
9090

91+
#[fixed_stack_segment]
9192
fn main() {
9293
let args = os::args();
9394
let n_keys = {

0 commit comments

Comments
 (0)