Skip to content

Commit acef292

Browse files
committed
Test fixes and rebase conflicts
1 parent 3fa3557 commit acef292

File tree

21 files changed

+63
-70
lines changed

21 files changed

+63
-70
lines changed

src/doc/guide-ownership.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -462,19 +462,19 @@ When talking about lifetime elision, we use the term 'input lifetime' and
462462
of a function, and an 'output lifetime' is a lifetime associated with the return
463463
value of a function. For example, this function has an input lifetime:
464464

465-
```
465+
```{rust,ignore}
466466
fn foo<'a>(bar: &'a str)
467467
```
468468

469469
This one has an output lifetime:
470470

471-
```
471+
```{rust,ignore}
472472
fn foo<'a>() -> &'a str
473473
```
474474

475475
This one has both:
476476

477-
```
477+
```{rust,ignore}
478478
fn foo<'a>(bar: &'a str) -> &'a str
479479
```
480480

src/libcollections/bit.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2541,7 +2541,7 @@ mod bitv_bench {
25412541
for _ in range(0u, 100) {
25422542
bitv |= 1 << ((r.next_u32() as uint) % u32::BITS);
25432543
}
2544-
black_box(&bitv)
2544+
black_box(&bitv);
25452545
});
25462546
}
25472547

@@ -2553,7 +2553,7 @@ mod bitv_bench {
25532553
for _ in range(0u, 100) {
25542554
bitv.set((r.next_u32() as uint) % BENCH_BITS, true);
25552555
}
2556-
black_box(&bitv)
2556+
black_box(&bitv);
25572557
});
25582558
}
25592559

src/libcollections/dlist.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1064,6 +1064,7 @@ mod tests {
10641064
}
10651065

10661066
#[allow(deprecated)]
1067+
#[test]
10671068
fn test_append() {
10681069
{
10691070
let mut m = DList::new();

src/libcollections/str.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2828,7 +2828,7 @@ mod bench {
28282828
let s = "ศไทย中华Việt Nam; Mary had a little lamb, Little lamb";
28292829

28302830
b.iter(|| {
2831-
for ch in s.chars() { black_box(ch) }
2831+
for ch in s.chars() { black_box(ch); }
28322832
});
28332833
}
28342834

@@ -2856,7 +2856,7 @@ mod bench {
28562856
let s = "ศไทย中华Việt Nam; Mary had a little lamb, Little lamb";
28572857

28582858
b.iter(|| {
2859-
for ch in s.chars().rev() { black_box(ch) }
2859+
for ch in s.chars().rev() { black_box(ch); }
28602860
});
28612861
}
28622862

src/libcollections/string.rs

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1102,24 +1102,6 @@ mod tests {
11021102
String::from_str("\u{FFFD}𐒋\u{FFFD}"));
11031103
}
11041104

1105-
#[test]
1106-
fn test_from_buf_len() {
1107-
unsafe {
1108-
let a = vec![65u8, 65, 65, 65, 65, 65, 65, 0];
1109-
assert_eq!(String::from_raw_buf_len(a.as_ptr(), 3), String::from_str("AAA"));
1110-
}
1111-
}
1112-
1113-
#[test]
1114-
fn test_from_buf() {
1115-
unsafe {
1116-
let a = vec![65, 65, 65, 65, 65, 65, 65, 0];
1117-
let b = a.as_ptr();
1118-
let c = String::from_raw_buf(b);
1119-
assert_eq!(c, String::from_str("AAAAAAA"));
1120-
}
1121-
}
1122-
11231105
#[test]
11241106
fn test_push_bytes() {
11251107
let mut s = String::from_str("ABC");

src/libgraphviz/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,7 @@ pub fn render_opts<'a, N:Clone+'a, E:Clone+'a, G:Labeller<'a,N,E>+GraphWalk<'a,N
587587
mod tests {
588588
use self::NodeLabels::*;
589589
use super::{Id, Labeller, Nodes, Edges, GraphWalk, render};
590-
use super::LabelText::{mod, LabelStr, EscStr};
590+
use super::LabelText::{self, LabelStr, EscStr};
591591
use std::io::IoResult;
592592
use std::borrow::IntoCow;
593593
use std::iter::repeat;

src/librustc_trans/back/write.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ use syntax::codemap;
2222
use syntax::diagnostic;
2323
use syntax::diagnostic::{Emitter, Handler, Level, mk_handler};
2424

25-
use std::ffi::{mod, CString};
25+
use std::ffi::{self, CString};
2626
use std::io::Command;
2727
use std::io::fs;
2828
use std::iter::Unfold;
@@ -32,7 +32,7 @@ use std::mem;
3232
use std::sync::{Arc, Mutex};
3333
use std::sync::mpsc::channel;
3434
use std::thread;
35-
use libc::{mod, c_uint, c_int, c_void};
35+
use libc::{self, c_uint, c_int, c_void};
3636

3737
#[derive(Clone, Copy, PartialEq, PartialOrd, Ord, Eq)]
3838
pub enum OutputType {

src/librustc_trans/trans/base.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ use util::nodemap::NodeMap;
8888

8989
use arena::TypedArena;
9090
use libc::{c_uint, uint64_t};
91-
use std::ffi::{mod, CString};
91+
use std::ffi::{self, CString};
9292
use std::cell::{Cell, RefCell};
9393
use std::collections::HashSet;
9494
use std::mem;

src/librustc_typeck/check/_match.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,8 +195,13 @@ pub fn check_pat<'a, 'tcx>(pcx: &pat_ctxt<'a, 'tcx>,
195195
ast::PatRegion(ref inner, mutbl) => {
196196
let inner_ty = fcx.infcx().next_ty_var();
197197

198-
let mutbl = ty::deref(fcx.infcx().shallow_resolve(expected), true)
199-
.map(|mt| mt.mutbl).unwrap_or(ast::MutImmutable);
198+
// SNAP c894171 remove this `if`-`else` entirely after next snapshot
199+
let mutbl = if mutbl == ast::MutImmutable {
200+
ty::deref(fcx.infcx().shallow_resolve(expected), true)
201+
.map(|mt| mt.mutbl).unwrap_or(ast::MutImmutable)
202+
} else {
203+
mutbl
204+
};
200205

201206
let mt = ty::mt { ty: inner_ty, mutbl: mutbl };
202207
let region = fcx.infcx().next_region_var(infer::PatternRegion(pat.span));

src/librustc_typeck/check/callee.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ use super::TupleArgumentsFlag;
2222
use super::write_call;
2323

2424
use middle::infer;
25-
use middle::ty::{mod, Ty};
25+
use middle::ty::{self, Ty};
2626
use syntax::ast;
2727
use syntax::codemap::Span;
2828
use syntax::parse::token;

0 commit comments

Comments
 (0)