Skip to content

Commit df9cf18

Browse files
committed
auto merge of #13188 : FlaPer87/rust/master, r=alexcrichton
2 parents 02d186a + a9c6061 commit df9cf18

File tree

20 files changed

+153
-5125
lines changed

20 files changed

+153
-5125
lines changed

src/librustc/driver/driver.rs

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -168,17 +168,6 @@ impl Input {
168168
}
169169
}
170170

171-
// FIXME: remove unwrap_ after snapshot
172-
#[cfg(stage0)]
173-
fn unwrap_<T>(t: T) -> T {
174-
t
175-
}
176-
177-
#[cfg(not(stage0))]
178-
fn unwrap_<T, E>(r: Result<T, E>) -> T {
179-
r.unwrap()
180-
}
181-
182171

183172
pub fn phase_1_parse_input(sess: &Session, cfg: ast::CrateConfig, input: &Input)
184173
-> ast::Crate {
@@ -200,7 +189,7 @@ pub fn phase_1_parse_input(sess: &Session, cfg: ast::CrateConfig, input: &Input)
200189
let mut stdout = io::BufferedWriter::new(io::stdout());
201190
let mut json = json::PrettyEncoder::new(&mut stdout);
202191
// unwrapping so IoError isn't ignored
203-
unwrap_(krate.encode(&mut json));
192+
krate.encode(&mut json).unwrap();
204193
}
205194

206195
if sess.show_span() {
@@ -276,7 +265,7 @@ pub fn phase_2_configure_and_expand(sess: &Session,
276265
let mut stdout = io::BufferedWriter::new(io::stdout());
277266
let mut json = json::PrettyEncoder::new(&mut stdout);
278267
// unwrapping so IoError isn't ignored
279-
unwrap_(krate.encode(&mut json));
268+
krate.encode(&mut json).unwrap();
280269
}
281270

282271
(krate, map)

src/librustc/metadata/decoder.rs

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -47,17 +47,6 @@ use syntax::crateid::CrateId;
4747

4848
pub type Cmd = @crate_metadata;
4949

50-
// FIXME: remove unwrap_ after a snapshot
51-
#[cfg(stage0)]
52-
fn unwrap_<T>(t: T) -> T {
53-
t
54-
}
55-
56-
#[cfg(not(stage0))]
57-
fn unwrap_<T, E>(r: Result<T, E>) -> T {
58-
r.unwrap()
59-
}
60-
6150
// A function that takes a def_id relative to the crate being searched and
6251
// returns a def_id relative to the compilation environment, i.e. if we hit a
6352
// def_id for an item defined in another crate, somebody needs to figure out
@@ -70,15 +59,15 @@ fn lookup_hash<'a>(d: ebml::Doc<'a>, eq_fn: |&[u8]| -> bool,
7059
let table = reader::get_doc(index, tag_index_table);
7160
let hash_pos = table.start + (hash % 256 * 4) as uint;
7261
let pos = u64_from_be_bytes(d.data, hash_pos, 4) as uint;
73-
let tagged_doc = unwrap_(reader::doc_at(d.data, pos));
62+
let tagged_doc = reader::doc_at(d.data, pos).unwrap();
7463

7564
let belt = tag_index_buckets_bucket_elt;
7665

7766
let mut ret = None;
7867
reader::tagged_docs(tagged_doc.doc, belt, |elt| {
7968
let pos = u64_from_be_bytes(elt.data, elt.start, 4) as uint;
8069
if eq_fn(elt.data.slice(elt.start + 4, elt.end)) {
81-
ret = Some(unwrap_(reader::doc_at(d.data, pos)).doc);
70+
ret = Some(reader::doc_at(d.data, pos).unwrap().doc);
8271
false
8372
} else {
8473
true
@@ -864,7 +853,7 @@ pub fn get_item_variances(cdata: Cmd, id: ast::NodeId) -> ty::ItemVariances {
864853
let item_doc = lookup_item(id, data);
865854
let variance_doc = reader::get_doc(item_doc, tag_item_variances);
866855
let mut decoder = reader::Decoder(variance_doc);
867-
unwrap_(Decodable::decode(&mut decoder))
856+
Decodable::decode(&mut decoder).unwrap()
868857
}
869858

870859
pub fn get_provided_trait_methods(intr: Rc<IdentInterner>, cdata: Cmd,

src/librustc/metadata/encoder.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,6 @@ pub enum InlinedItemRef<'a> {
6262
IIForeignRef(&'a ast::ForeignItem)
6363
}
6464

65-
// FIXME: remove this Encoder type after a snapshot
66-
#[cfg(stage0)]
67-
pub type Encoder<'a> = writer::Encoder<'a>;
68-
69-
#[cfg(not(stage0))]
7065
pub type Encoder<'a> = writer::Encoder<'a, MemWriter>;
7166

7267
pub type EncodeInlinedItem<'a> = 'a |ecx: &EncodeContext,

0 commit comments

Comments
 (0)