Skip to content

Commit e135298

Browse files
committed
---
yaml --- r: 73276 b: refs/heads/dist-snap c: eb3f47a h: refs/heads/master v: v3
1 parent 953a374 commit e135298

File tree

6 files changed

+34
-29
lines changed

6 files changed

+34
-29
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: 17dfebf883053ea84ef3fcf6b928d4a210c1012e
10+
refs/heads/dist-snap: eb3f47a40a5578f50a9071b430ad95840640a344
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1313
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/src/libcore/hash.rs

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -76,16 +76,12 @@ pub trait Streaming {
7676
fn reset(&mut self);
7777
}
7878

79-
fn transmute_for_stage0<'a>(bytes: &'a [u8]) -> &'a [u8] {
80-
bytes
81-
}
82-
8379
impl<A:IterBytes> Hash for A {
8480
#[inline(always)]
8581
fn hash_keyed(&self, k0: u64, k1: u64) -> u64 {
8682
let mut s = State::new(k0, k1);
8783
for self.iter_bytes(true) |bytes| {
88-
s.input(transmute_for_stage0(bytes));
84+
s.input(bytes);
8985
}
9086
s.result_u64()
9187
}
@@ -95,10 +91,10 @@ fn hash_keyed_2<A: IterBytes,
9591
B: IterBytes>(a: &A, b: &B, k0: u64, k1: u64) -> u64 {
9692
let mut s = State::new(k0, k1);
9793
for a.iter_bytes(true) |bytes| {
98-
s.input(transmute_for_stage0(bytes));
94+
s.input(bytes);
9995
}
10096
for b.iter_bytes(true) |bytes| {
101-
s.input(transmute_for_stage0(bytes));
97+
s.input(bytes);
10298
}
10399
s.result_u64()
104100
}
@@ -108,13 +104,13 @@ fn hash_keyed_3<A: IterBytes,
108104
C: IterBytes>(a: &A, b: &B, c: &C, k0: u64, k1: u64) -> u64 {
109105
let mut s = State::new(k0, k1);
110106
for a.iter_bytes(true) |bytes| {
111-
s.input(transmute_for_stage0(bytes));
107+
s.input(bytes);
112108
}
113109
for b.iter_bytes(true) |bytes| {
114-
s.input(transmute_for_stage0(bytes));
110+
s.input(bytes);
115111
}
116112
for c.iter_bytes(true) |bytes| {
117-
s.input(transmute_for_stage0(bytes));
113+
s.input(bytes);
118114
}
119115
s.result_u64()
120116
}
@@ -132,16 +128,16 @@ fn hash_keyed_4<A: IterBytes,
132128
-> u64 {
133129
let mut s = State::new(k0, k1);
134130
for a.iter_bytes(true) |bytes| {
135-
s.input(transmute_for_stage0(bytes));
131+
s.input(bytes);
136132
}
137133
for b.iter_bytes(true) |bytes| {
138-
s.input(transmute_for_stage0(bytes));
134+
s.input(bytes);
139135
}
140136
for c.iter_bytes(true) |bytes| {
141-
s.input(transmute_for_stage0(bytes));
137+
s.input(bytes);
142138
}
143139
for d.iter_bytes(true) |bytes| {
144-
s.input(transmute_for_stage0(bytes));
140+
s.input(bytes);
145141
}
146142
s.result_u64()
147143
}
@@ -161,19 +157,19 @@ fn hash_keyed_5<A: IterBytes,
161157
-> u64 {
162158
let mut s = State::new(k0, k1);
163159
for a.iter_bytes(true) |bytes| {
164-
s.input(transmute_for_stage0(bytes));
160+
s.input(bytes);
165161
}
166162
for b.iter_bytes(true) |bytes| {
167-
s.input(transmute_for_stage0(bytes));
163+
s.input(bytes);
168164
}
169165
for c.iter_bytes(true) |bytes| {
170-
s.input(transmute_for_stage0(bytes));
166+
s.input(bytes);
171167
}
172168
for d.iter_bytes(true) |bytes| {
173-
s.input(transmute_for_stage0(bytes));
169+
s.input(bytes);
174170
}
175171
for e.iter_bytes(true) |bytes| {
176-
s.input(transmute_for_stage0(bytes));
172+
s.input(bytes);
177173
}
178174
s.result_u64()
179175
}

branches/dist-snap/src/librustc/driver/driver.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ pub fn compile_rest(sess: Session,
239239
let (llmod, link_meta) = {
240240

241241
let ty_cx = ty::mk_ctxt(sess, def_map, ast_map, freevars,
242-
region_map, rp_set, lang_items);
242+
region_map, rp_set, lang_items, crate);
243243

244244
// passes are timed inside typeck
245245
let (method_map, vtable_map) = typeck::check_crate(

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

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@ struct ctxt_ {
232232
diag: @syntax::diagnostic::span_handler,
233233
interner: @mut HashMap<intern_key, ~t_box_>,
234234
next_id: @mut uint,
235+
legacy_modes: bool,
235236
cstore: @mut metadata::cstore::CStore,
236237
sess: session::Session,
237238
def_map: resolve::DefMap,
@@ -905,12 +906,24 @@ pub fn mk_ctxt(s: session::Session,
905906
freevars: freevars::freevar_map,
906907
region_maps: @mut middle::region::RegionMaps,
907908
region_paramd_items: middle::region::region_paramd_items,
908-
lang_items: middle::lang_items::LanguageItems)
909+
lang_items: middle::lang_items::LanguageItems,
910+
crate: @ast::crate)
909911
-> ctxt {
912+
let mut legacy_modes = false;
913+
for crate.node.attrs.each |attribute| {
914+
match attribute.node.value.node {
915+
ast::meta_word(w) if *w == ~"legacy_modes" => {
916+
legacy_modes = true;
917+
}
918+
_ => {}
919+
}
920+
}
921+
910922
@ctxt_ {
911923
diag: s.diagnostic(),
912924
interner: @mut HashMap::new(),
913925
next_id: @mut primitives::LAST_PRIMITIVE_ID,
926+
legacy_modes: legacy_modes,
914927
cstore: s.cstore,
915928
sess: s,
916929
def_map: dm,

branches/dist-snap/src/librustc/middle/typeck/infer/test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ fn setup_env(test_name: &str, source_string: &str) -> Env {
6767
cfg, parse_sess);
6868

6969
let tcx = ty::mk_ctxt(sess, dm, amap, freevars, region_map,
70-
region_paramd_items, lang_items);
70+
region_paramd_items, lang_items, crate);
7171

7272
let infcx = infer::new_infer_ctxt(tcx);
7373

branches/dist-snap/src/libstd/fileinput.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -210,9 +210,7 @@ impl FileInput {
210210
pub fn next_file(&self) -> bool {
211211
// No more files
212212

213-
// unsafe block can be removed after the next snapshot
214-
// (next one after 2013-05-03)
215-
if unsafe { self.fi.files.is_empty() } {
213+
if self.fi.files.is_empty() {
216214
self.fi.current_reader = None;
217215
return false;
218216
}
@@ -324,9 +322,7 @@ impl io::Reader for FileInput {
324322
fn eof(&self) -> bool {
325323
// we've run out of files, and current_reader is either None or eof.
326324

327-
// unsafe block can be removed after the next snapshot
328-
// (next one after 2013-05-03)
329-
(unsafe { self.fi.files.is_empty() }) &&
325+
self.fi.files.is_empty() &&
330326
match self.fi.current_reader { None => true, Some(r) => r.eof() }
331327

332328
}

0 commit comments

Comments
 (0)