Skip to content

Commit f3969c1

Browse files
committed
Test fixes and rebase conflicts
1 parent fea07cf commit f3969c1

File tree

10 files changed

+40
-18
lines changed

10 files changed

+40
-18
lines changed

src/libcore/cell.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ pub struct RefCell<T> {
267267
}
268268

269269
/// An enumeration of values returned from the `state` method on a `RefCell<T>`.
270-
#[derive(Copy, Clone, PartialEq)]
270+
#[derive(Copy, Clone, PartialEq, Debug)]
271271
#[unstable(feature = "std_misc")]
272272
pub enum BorrowState {
273273
/// The cell is currently being read, there is at least one active `borrow`.

src/libcore/char.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ pub fn from_u32(i: u32) -> Option<char> {
115115
///
116116
/// let c = char::from_digit(4, 10);
117117
///
118-
/// assert_eq!(c, '4')
118+
/// assert_eq!(c, Some('4'));
119119
/// ```
120120
#[inline]
121121
#[unstable(feature = "core", reason = "pending integer conventions")]
@@ -183,9 +183,9 @@ pub trait CharExt {
183183
/// ```
184184
/// let c = '1';
185185
///
186-
/// assert_eq!(1, c.to_digit(10));
186+
/// assert_eq!(c.to_digit(10), Some(1));
187187
///
188-
/// assert_eq!(15, 'f'.to_digit(16));
188+
/// assert_eq!('f'.to_digit(16), Some(15));
189189
/// ```
190190
#[unstable(feature = "core",
191191
reason = "pending integer conventions")]
@@ -260,7 +260,7 @@ pub trait CharExt {
260260
/// ```
261261
/// let quote: String = '"'.escape_default().collect();
262262
///
263-
/// assert_eq!(quote, r"\"");
263+
/// assert_eq!(quote, "\\\"");
264264
/// ```
265265
#[stable(feature = "rust1", since = "1.0.0")]
266266
fn escape_default(self) -> EscapeDefault;

src/libstd/sys/unix/os.rs

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,7 @@ pub fn chdir(p: &Path) -> IoResult<()> {
116116
}
117117

118118
pub struct SplitPaths<'a> {
119-
iter: iter::Map<&'a [u8], Path,
120-
slice::Split<'a, u8, fn(&u8) -> bool>,
119+
iter: iter::Map<slice::Split<'a, u8, fn(&u8) -> bool>,
121120
fn(&'a [u8]) -> Path>,
122121
}
123122

@@ -450,7 +449,16 @@ pub fn temp_dir() -> Path {
450449
}
451450

452451
pub fn home_dir() -> Option<Path> {
453-
getenv("HOME".as_os_str()).or_else(|| unsafe {
452+
return getenv("HOME".as_os_str()).or_else(|| unsafe {
453+
fallback()
454+
}).map(|os| {
455+
Path::new(os.into_vec())
456+
});
457+
458+
#[cfg(target_os = "android")]
459+
unsafe fn fallback() -> Option<OsString> { None }
460+
#[cfg(not(target_os = "android"))]
461+
unsafe fn fallback() -> Option<OsString> {
454462
let mut amt = match libc::sysconf(c::_SC_GETPW_R_SIZE_MAX) {
455463
n if n < 0 => 512 as usize,
456464
n => n as usize,
@@ -470,7 +478,5 @@ pub fn home_dir() -> Option<Path> {
470478
let bytes = ffi::c_str_to_bytes(&ptr).to_vec();
471479
return Some(OsStringExt::from_vec(bytes))
472480
}
473-
}).map(|os| {
474-
Path::new(os.into_vec())
475-
})
481+
}
476482
}

src/rustllvm/llvm-auto-clean-trigger

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# If this file is modified, then llvm will be forcibly cleaned and then rebuilt.
22
# The actual contents of this file do not matter, but to trigger a change on the
33
# build bots then the contents should be changed so git updates the mtime.
4-
2015-01-30
4+
2015-02-02

src/test/compile-fail/issue-2149.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ impl<A> vec_monad<A> for Vec<A> {
1616
fn bind<B, F>(&self, mut f: F) where F: FnMut(A) -> Vec<B> {
1717
let mut r = panic!();
1818
for elt in self { r = r + f(*elt); }
19-
//~^ ERROR the type of this value must be known
19+
//~^ ERROR binary operation `+` cannot be applied to type `collections::vec::Vec<B>`
2020
}
2121
}
2222
fn main() {

src/test/compile-fail/lint-unknown-feature-default.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
// Tests the default for the unused_features lint
1212

13+
#![deny(warnings)]
14+
1315
#![feature(this_is_not_a_feature)] //~ ERROR: unused or unknown feature
1416

1517
fn main() { }

src/test/compile-fail/use-as-where-use-ends-with-mod-sep.rs

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

11-
use std::any:: as foo; //~ ERROR expected identifier or `{` or `*`, found `as`
11+
use std::any:: as foo; //~ ERROR expected identifier, found keyword `as`
12+
//~^ ERROR: expected one of `::`, `;`, or `as`, found `foo`

src/test/compile-fail/use-mod-4.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
use foo::self;
12+
//~^ ERROR expected identifier, found keyword `self`
13+
14+
fn main() {}
15+

src/test/compile-fail/use-mod.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@ use foo::bar::{
1919
use {self};
2020
//~^ ERROR `self` import can only appear in an import list with a non-empty prefix
2121

22-
use foo::self;
23-
//~^ ERROR `self` imports are only allowed within a { } list
24-
2522
mod foo {
2623
pub mod bar {
2724
pub struct Bar;

src/test/run-make/tools.mk

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,9 @@ ifeq ($(shell uname),Darwin)
5959
else
6060
ifeq ($(shell uname),FreeBSD)
6161
EXTRACFLAGS := -lm -lpthread -lgcc_s
62+
else
6263
ifeq ($(shell uname),OpenBSD)
63-
EXTRACFLAGS := -lm -lpthread
64+
EXTRACFLAGS := -lm -lpthread
6465
else
6566
EXTRACFLAGS := -lm -lrt -ldl -lpthread
6667
endif

0 commit comments

Comments
 (0)