Skip to content

Commit 60541cd

Browse files
committed
Test fixes and rebase conflicts
1 parent 62137b6 commit 60541cd

File tree

14 files changed

+56
-50
lines changed

14 files changed

+56
-50
lines changed

src/libcoretest/slice.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
use std::slice::{Found, NotFound};
11+
use std::slice::BinarySearchResult::{Found, NotFound};
1212

1313
#[test]
1414
fn binary_search_not_found() {

src/librustc/middle/borrowck/fragments.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,8 +277,8 @@ pub fn fixup_fragment_sets<'tcx>(this: &MoveData<'tcx>, tcx: &ty::ctxt<'tcx>) {
277277

278278
fn non_member(elem: MovePathIndex, set: &[MovePathIndex]) -> bool {
279279
match set.binary_search_elem(&elem) {
280-
slice::Found(_) => false,
281-
slice::NotFound(_) => true,
280+
slice::BinarySearchResult::Found(_) => false,
281+
slice::BinarySearchResult::NotFound(_) => true,
282282
}
283283
}
284284
}

src/librustc/middle/region.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ impl CodeExtent {
7272
}
7373
}
7474

75-
The region maps encode information about region relationships.
76-
75+
/// The region maps encode information about region relationships.
76+
///
7777
/// - `scope_map` maps from a scope id to the enclosing scope id; this is
7878
/// usually corresponding to the lexical nesting, though in the case of
7979
/// closures the parent scope is the innermost conditional expression or repeating

src/librustc/middle/typeck/astconv.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -741,7 +741,7 @@ fn ast_ty_to_trait_ref<'tcx,AC,RS>(this: &AC,
741741

742742
_ => {
743743
span_note!(this.tcx().sess, ty.span,
744-
"perhaps you forget parentheses? (per RFC 248)");
744+
"perhaps you forgot parentheses? (per RFC 248)");
745745
}
746746
}
747747
Err(ErrorReported)

src/librustdoc/lib.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ use std::io::File;
3535
use std::io;
3636
use std::rc::Rc;
3737
use externalfiles::ExternalHtml;
38-
use serialize::{json, Decodable, Encodable};
38+
use serialize::{Decodable, Encodable};
39+
use serialize::json::{mod, Json};
3940

4041
// reexported from `clean` so it can be easily updated with the mod itself
4142
pub use clean::SCHEMA_VERSION;
@@ -425,11 +426,11 @@ fn json_input(input: &str) -> Result<Output, String> {
425426
};
426427
match json::from_reader(&mut input) {
427428
Err(s) => Err(s.to_string()),
428-
Ok(json::Object(obj)) => {
429+
Ok(Json::Object(obj)) => {
429430
let mut obj = obj;
430431
// Make sure the schema is what we expect
431432
match obj.remove(&"schema".to_string()) {
432-
Some(json::String(version)) => {
433+
Some(Json::String(version)) => {
433434
if version.as_slice() != SCHEMA_VERSION {
434435
return Err(format!(
435436
"sorry, but I only understand version {}",
@@ -468,7 +469,7 @@ fn json_output(krate: clean::Crate, res: Vec<plugins::PluginJson> ,
468469
// "plugins": { output of plugins ... }
469470
// }
470471
let mut json = std::collections::TreeMap::new();
471-
json.insert("schema".to_string(), json::String(SCHEMA_VERSION.to_string()));
472+
json.insert("schema".to_string(), Json::String(SCHEMA_VERSION.to_string()));
472473
let plugins_json = res.into_iter()
473474
.filter_map(|opt| {
474475
match opt {
@@ -495,8 +496,8 @@ fn json_output(krate: clean::Crate, res: Vec<plugins::PluginJson> ,
495496
};
496497

497498
json.insert("crate".to_string(), crate_json);
498-
json.insert("plugins".to_string(), json::Object(plugins_json));
499+
json.insert("plugins".to_string(), Json::Object(plugins_json));
499500

500501
let mut file = try!(File::create(&dst));
501-
json::Object(json).to_writer(&mut file)
502+
Json::Object(json).to_writer(&mut file)
502503
}

src/libserialize/json.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,7 @@ for custom mappings.
113113
114114
```rust
115115
extern crate serialize;
116-
use serialize::json::ToJson;
117-
use serialize::json;
116+
use serialize::json::{mod, ToJson, Json};
118117
119118
// A custom data structure
120119
struct ComplexNum {
@@ -125,7 +124,7 @@ struct ComplexNum {
125124
// JSON value representation
126125
impl ToJson for ComplexNum {
127126
fn to_json(&self) -> json::Json {
128-
json::String(format!("{}+{}i", self.a, self.b))
127+
Json::String(format!("{}+{}i", self.a, self.b))
129128
}
130129
}
131130
@@ -154,8 +153,7 @@ fn main() {
154153
```rust
155154
extern crate serialize;
156155
use std::collections::TreeMap;
157-
use serialize::json::ToJson;
158-
use serialize::json;
156+
use serialize::json::{mod, ToJson, Json};
159157
160158
// Only generate `Decodable` trait implementation
161159
#[deriving(Decodable)]
@@ -173,7 +171,7 @@ impl ToJson for TestStruct {
173171
d.insert("data_int".to_string(), self.data_int.to_json());
174172
d.insert("data_str".to_string(), self.data_str.to_json());
175173
d.insert("data_vector".to_string(), self.data_vector.to_json());
176-
json::Object(d)
174+
Json::Object(d)
177175
}
178176
}
179177
@@ -184,7 +182,7 @@ fn main() {
184182
data_str: "toto".to_string(),
185183
data_vector: vec![2,3,4,5],
186184
};
187-
let json_obj: json::Json = input_data.to_json();
185+
let json_obj: Json = input_data.to_json();
188186
let json_str: String = json_obj.to_string();
189187
190188
// Deserialize like before

src/libstd/macros.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -205,11 +205,12 @@ macro_rules! debug_assert_eq(
205205
///
206206
/// ```rust
207207
/// fn foo(x: Option<int>) {
208-
/// match x {
209-
/// Some(n) if n >= 0 => println!("Some(Non-negative)"),
210-
/// Some(n) if n < 0 => println!("Some(Negative)"),
211-
/// Some(_) => unreachable!(), // compile error if commented out
212-
/// None => println!("None")
208+
/// match x {
209+
/// Some(n) if n >= 0 => println!("Some(Non-negative)"),
210+
/// Some(n) if n < 0 => println!("Some(Negative)"),
211+
/// Some(_) => unreachable!(), // compile error if commented out
212+
/// None => println!("None")
213+
/// }
213214
/// }
214215
/// ```
215216
///

src/libsyntax/ext/quote.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ use parse::token::*;
1717
use parse::token;
1818
use ptr::P;
1919

20-
//! Quasiquoting works via token trees.
21-
//!
22-
//! This is registered as a set of expression syntax extension called quote!
23-
//! that lifts its argument token-tree to an AST representing the
24-
//! construction of the same token tree, with token::SubstNt interpreted
25-
//! as antiquotes (splices).
20+
/// Quasiquoting works via token trees.
21+
///
22+
/// This is registered as a set of expression syntax extension called quote!
23+
/// that lifts its argument token-tree to an AST representing the
24+
/// construction of the same token tree, with token::SubstNt interpreted
25+
/// as antiquotes (splices).
2626
2727
pub mod rt {
2828
use ast;

src/libtest/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1106,9 +1106,9 @@ fn calc_result(desc: &TestDesc, task_succeeded: bool) -> TestResult {
11061106
impl ToJson for Metric {
11071107
fn to_json(&self) -> json::Json {
11081108
let mut map = TreeMap::new();
1109-
map.insert("value".to_string(), json::F64(self.value));
1110-
map.insert("noise".to_string(), json::F64(self.noise));
1111-
json::Object(map)
1109+
map.insert("value".to_string(), json::Json::F64(self.value));
1110+
map.insert("noise".to_string(), json::Json::F64(self.noise));
1111+
json::Json::Object(map)
11121112
}
11131113
}
11141114

src/libunicode/normalize.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ fn bsearch_table<T>(c: char, r: &'static [(char, &'static [T])]) -> Option<&'sta
2525
else if val < c { Less }
2626
else { Greater }
2727
}) {
28-
slice::Found(idx) => {
28+
slice::BinarySearchResult::Found(idx) => {
2929
let (_, result) = r[idx];
3030
Some(result)
3131
}
32-
slice::NotFound(_) => None
32+
slice::BinarySearchResult::NotFound(_) => None
3333
}
3434
}
3535

@@ -88,11 +88,11 @@ pub fn compose(a: char, b: char) -> Option<char> {
8888
else if val < b { Less }
8989
else { Greater }
9090
}) {
91-
slice::Found(idx) => {
91+
slice::BinarySearchResult::Found(idx) => {
9292
let (_, result) = candidates[idx];
9393
Some(result)
9494
}
95-
slice::NotFound(_) => None
95+
slice::BinarySearchResult::NotFound(_) => None
9696
}
9797
}
9898
}

0 commit comments

Comments
 (0)