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

+1-1
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

+2-2
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

+2-2
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

+1-1
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

+7-6
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

+5-7
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

+6-5
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

+6-6
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

+3-3
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

+4-4
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
}

src/libunicode/tables.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -6249,11 +6249,11 @@ pub mod normalization {
62496249
else if hi < c { Less }
62506250
else { Greater }
62516251
}) {
6252-
slice::Found(idx) => {
6252+
slice::BinarySearchResult::Found(idx) => {
62536253
let (_, _, result) = r[idx];
62546254
result
62556255
}
6256-
slice::NotFound(_) => 0
6256+
slice::BinarySearchResult::NotFound(_) => 0
62576257
}
62586258
}
62596259

@@ -6392,8 +6392,8 @@ pub mod conversions {
63926392
else if key < c { Less }
63936393
else { Greater }
63946394
}) {
6395-
slice::Found(i) => Some(i),
6396-
slice::NotFound(_) => None,
6395+
slice::BinarySearchResult::Found(i) => Some(i),
6396+
slice::BinarySearchResult::NotFound(_) => None,
63976397
}
63986398
}
63996399

@@ -6945,11 +6945,11 @@ pub mod charwidth {
69456945
else if hi < c { Less }
69466946
else { Greater }
69476947
}) {
6948-
slice::Found(idx) => {
6948+
slice::BinarySearchResult::Found(idx) => {
69496949
let (_, _, r_ncjk, r_cjk) = r[idx];
69506950
if is_cjk { r_cjk } else { r_ncjk }
69516951
}
6952-
slice::NotFound(_) => 1
6952+
slice::BinarySearchResult::NotFound(_) => 1
69536953
}
69546954
}
69556955

@@ -7160,11 +7160,11 @@ pub mod grapheme {
71607160
else if hi < c { Less }
71617161
else { Greater }
71627162
}) {
7163-
slice::Found(idx) => {
7163+
slice::BinarySearchResult::Found(idx) => {
71647164
let (_, _, cat) = r[idx];
71657165
cat
71667166
}
7167-
slice::NotFound(_) => GC_Any
7167+
slice::BinarySearchResult::NotFound(_) => GC_Any
71687168
}
71697169
}
71707170

src/test/compile-fail/hrtb-precedence-of-plus-error-message.rs

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ struct Foo<'a> {
3030
d: fn() -> Bar+'a,
3131
//~^ ERROR E0171
3232
//~^^ NOTE perhaps you forgot parentheses
33+
//~^^^ WARN deprecated syntax
3334
}
3435

3536
fn main() { }

src/test/run-pass/hrtb-precedence-of-plus-where-clause.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,15 @@
1313
// Test that `F : Fn(int) -> int + Send` is interpreted as two
1414
// distinct bounds on `F`.
1515

16-
fn foo<F>(f: F)
16+
fn foo1<F>(f: F)
1717
where F : FnOnce(int) -> int + Send
1818
{
1919
bar(f);
20+
}
21+
22+
fn foo2<F>(f: F)
23+
where F : FnOnce(int) -> int + Send
24+
{
2025
baz(f);
2126
}
2227

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

+4-4
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ extern crate collections;
1313
extern crate serialize;
1414

1515
use std::collections::HashMap;
16-
use serialize::json;
16+
use serialize::json::{mod, Json};
1717
use std::option;
1818

1919
enum object {
@@ -24,7 +24,7 @@ enum object {
2424
fn lookup(table: json::Object, key: String, default: String) -> String
2525
{
2626
match table.find(&key.to_string()) {
27-
option::Some(&json::String(ref s)) => {
27+
option::Some(&Json::String(ref s)) => {
2828
s.to_string()
2929
}
3030
option::Some(value) => {
@@ -40,7 +40,7 @@ fn lookup(table: json::Object, key: String, default: String) -> String
4040
fn add_interface(_store: int, managed_ip: String, data: json::Json) -> (String, object)
4141
{
4242
match &data {
43-
&json::Object(ref interface) => {
43+
&Json::Object(ref interface) => {
4444
let name = lookup(interface.clone(),
4545
"ifDescr".to_string(),
4646
"".to_string());
@@ -59,7 +59,7 @@ fn add_interfaces(store: int, managed_ip: String, device: HashMap<String, json::
5959
-> Vec<(String, object)> {
6060
match device["interfaces".to_string()]
6161
{
62-
json::Array(ref interfaces) =>
62+
Json::Array(ref interfaces) =>
6363
{
6464
interfaces.iter().map(|interface| {
6565
add_interface(store, managed_ip.clone(), (*interface).clone())

0 commit comments

Comments
 (0)