Skip to content

Commit f7d2e9b

Browse files
author
Oliver Schneider
committed
fix fallout from invalid map key type error
1 parent a943a05 commit f7d2e9b

File tree

7 files changed

+16
-13
lines changed

7 files changed

+16
-13
lines changed

src/librustdoc/html/render.rs

+5-4
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ thread_local!(pub static CURRENT_LOCATION_KEY: RefCell<Vec<String>> =
253253
pub fn run(mut krate: clean::Crate,
254254
external_html: &ExternalHtml,
255255
dst: Path,
256-
passes: HashSet<String>) -> io::IoResult<()> {
256+
passes: HashSet<String>) -> json::EncodeResult {
257257
let mut cx = Context {
258258
dst: dst,
259259
src_root: krate.src.dir_path(),
@@ -1084,7 +1084,7 @@ impl Context {
10841084
/// This currently isn't parallelized, but it'd be pretty easy to add
10851085
/// parallelization to this function.
10861086
fn krate(mut self, mut krate: clean::Crate,
1087-
stability: stability_summary::ModuleSummary) -> io::IoResult<()> {
1087+
stability: stability_summary::ModuleSummary) -> json::EncodeResult {
10881088
let mut item = match krate.module.take() {
10891089
Some(i) => i,
10901090
None => return Ok(())
@@ -1110,9 +1110,10 @@ impl Context {
11101110
};
11111111
let html_dst = &this.dst.join("stability.html");
11121112
let mut html_out = BufferedWriter::new(try!(File::create(html_dst)));
1113-
layout::render(&mut html_out, &this.layout, &page,
1113+
try!(layout::render(&mut html_out, &this.layout, &page,
11141114
&Sidebar{ cx: this, item: &item },
1115-
&stability)
1115+
&stability));
1116+
Ok(())
11161117
}));
11171118

11181119
// render the crate documentation

src/librustdoc/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@ fn json_input(input: &str) -> Result<Output, String> {
468468
/// Outputs the crate/plugin json as a giant json blob at the specified
469469
/// destination.
470470
fn json_output(krate: clean::Crate, res: Vec<plugins::PluginJson> ,
471-
dst: Path) -> io::IoResult<()> {
471+
dst: Path) -> json::EncodeResult {
472472
// {
473473
// "schema": version,
474474
// "crate": { parsed crate ... },

src/libsyntax/ast.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1682,6 +1682,6 @@ mod test {
16821682
exported_macros: Vec::new(),
16831683
};
16841684
// doesn't matter which encoder we use....
1685-
let _f = &e as &serialize::Encodable<json::Encoder, io::IoError>;
1685+
let _f = &e as &serialize::Encodable<json::Encoder, json::EncoderError>;
16861686
}
16871687
}

src/libtest/lib.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -850,7 +850,8 @@ pub fn fmt_bench_samples(bs: &BenchSamples) -> String {
850850
}
851851

852852
// A simple console test runner
853-
pub fn run_tests_console(opts: &TestOpts, tests: Vec<TestDescAndFn> ) -> io::IoResult<bool> {
853+
pub fn run_tests_console(opts: &TestOpts, tests: Vec<TestDescAndFn> )
854+
-> Result<bool, json::EncoderError> {
854855

855856
fn callback<T: Writer>(event: &TestEvent, st: &mut ConsoleTestState<T>) -> io::IoResult<()> {
856857
match (*event).clone() {
@@ -914,7 +915,7 @@ pub fn run_tests_console(opts: &TestOpts, tests: Vec<TestDescAndFn> ) -> io::IoR
914915
pth.display()).as_slice()));
915916
}
916917
}
917-
return st.write_run_finish(&opts.ratchet_metrics, opts.ratchet_noise_percent);
918+
return Ok(try!(st.write_run_finish(&opts.ratchet_metrics, opts.ratchet_noise_percent)));
918919
}
919920

920921
#[test]
@@ -1207,7 +1208,7 @@ impl MetricMap {
12071208
}
12081209

12091210
/// Write MetricDiff to a file.
1210-
pub fn save(&self, p: &Path) -> io::IoResult<()> {
1211+
pub fn save(&self, p: &Path) -> json::EncodeResult {
12111212
let mut file = try!(File::create(p));
12121213
let MetricMap(ref map) = *self;
12131214
let mut enc = json::PrettyEncoder::new(&mut file);

src/test/compile-fail/variance-trait-matching-2.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@ extern crate serialize;
1212

1313
use std::io;
1414
use serialize::{Encodable, Encoder};
15+
use serialize::json;
1516

1617
pub fn buffer_encode<'a,
17-
T:Encodable<serialize::json::Encoder<'a>,io::IoError>>(
18+
T:Encodable<json::Encoder<'a>,json::EncoderError>>(
1819
to_encode_object: &T)
1920
-> Vec<u8> {
2021
let mut m = Vec::new();

src/test/run-pass/issue-11881.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ enum WireProtocol {
3939

4040
fn encode_json<'a,
4141
T: Encodable<json::Encoder<'a>,
42-
std::io::IoError>>(val: &T,
43-
wr: &'a mut SeekableMemWriter) {
42+
json::EncoderError>>(val: &T,
43+
wr: &'a mut SeekableMemWriter) {
4444
let mut encoder = json::Encoder::new(wr);
4545
val.encode(&mut encoder);
4646
}

src/test/run-pass/issue-15924.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ struct Foo<T> {
2121
}
2222

2323
#[unsafe_destructor]
24-
impl<'a, T: Encodable<json::Encoder<'a>, IoError>> Drop for Foo<T> {
24+
impl<'a, T: Encodable<json::Encoder<'a>, json::EncoderError>> Drop for Foo<T> {
2525
fn drop(&mut self) {
2626
json::encode(&self.v);
2727
}

0 commit comments

Comments
 (0)