Test fixes and rebase conflicts

This commit is contained in:
Alex Crichton 2015-02-02 11:04:58 -08:00
parent fea07cfd3f
commit 9ece22ee00
12 changed files with 50 additions and 24 deletions

View File

@ -11,7 +11,7 @@
use common::Config;
#[cfg(target_os = "windows")]
use std::os::getenv;
use std::env;
/// Conversion table from triple OS name to Rust SYSNAME
static OS_TABLE: &'static [(&'static str, &'static str)] = &[
@ -40,11 +40,11 @@ pub fn make_new_path(path: &str) -> String {
// Windows just uses PATH as the library search path, so we have to
// maintain the current value while adding our own
match getenv(lib_path_env_var()) {
Some(curr) => {
match env::var_string(lib_path_env_var()) {
Ok(curr) => {
format!("{}{}{}", path, path_div(), curr)
}
None => path.to_string()
Err(..) => path.to_string()
}
}

View File

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

View File

@ -115,7 +115,7 @@ pub fn from_u32(i: u32) -> Option<char> {
///
/// let c = char::from_digit(4, 10);
///
/// assert_eq!(c, '4')
/// assert_eq!(c, Some('4'));
/// ```
#[inline]
#[unstable(feature = "core", reason = "pending integer conventions")]
@ -183,9 +183,9 @@ pub trait CharExt {
/// ```
/// let c = '1';
///
/// assert_eq!(1, c.to_digit(10));
/// assert_eq!(c.to_digit(10), Some(1));
///
/// assert_eq!(15, 'f'.to_digit(16));
/// assert_eq!('f'.to_digit(16), Some(15));
/// ```
#[unstable(feature = "core",
reason = "pending integer conventions")]
@ -260,7 +260,7 @@ pub trait CharExt {
/// ```
/// let quote: String = '"'.escape_default().collect();
///
/// assert_eq!(quote, r"\"");
/// assert_eq!(quote, "\\\"");
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
fn escape_default(self) -> EscapeDefault;

View File

@ -116,8 +116,7 @@ pub fn chdir(p: &Path) -> IoResult<()> {
}
pub struct SplitPaths<'a> {
iter: iter::Map<&'a [u8], Path,
slice::Split<'a, u8, fn(&u8) -> bool>,
iter: iter::Map<slice::Split<'a, u8, fn(&u8) -> bool>,
fn(&'a [u8]) -> Path>,
}
@ -450,7 +449,16 @@ pub fn temp_dir() -> Path {
}
pub fn home_dir() -> Option<Path> {
getenv("HOME".as_os_str()).or_else(|| unsafe {
return getenv("HOME".as_os_str()).or_else(|| unsafe {
fallback()
}).map(|os| {
Path::new(os.into_vec())
});
#[cfg(target_os = "android")]
unsafe fn fallback() -> Option<OsString> { None }
#[cfg(not(target_os = "android"))]
unsafe fn fallback() -> Option<OsString> {
let mut amt = match libc::sysconf(c::_SC_GETPW_R_SIZE_MAX) {
n if n < 0 => 512 as usize,
n => n as usize,
@ -470,7 +478,5 @@ pub fn home_dir() -> Option<Path> {
let bytes = ffi::c_str_to_bytes(&ptr).to_vec();
return Some(OsStringExt::from_vec(bytes))
}
}).map(|os| {
Path::new(os.into_vec())
})
}
}

View File

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

View File

@ -16,7 +16,7 @@ impl<A> vec_monad<A> for Vec<A> {
fn bind<B, F>(&self, mut f: F) where F: FnMut(A) -> Vec<B> {
let mut r = panic!();
for elt in self { r = r + f(*elt); }
//~^ ERROR the type of this value must be known
//~^ ERROR binary operation `+` cannot be applied to type `collections::vec::Vec<B>`
}
}
fn main() {

View File

@ -10,6 +10,8 @@
// Tests the default for the unused_features lint
#![deny(warnings)]
#![feature(this_is_not_a_feature)] //~ ERROR: unused or unknown feature
fn main() { }

View File

@ -8,4 +8,5 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use std::any:: as foo; //~ ERROR expected identifier or `{` or `*`, found `as`
use std::any:: as foo; //~ ERROR expected identifier, found keyword `as`
//~^ ERROR: expected one of `::`, `;`, or `as`, found `foo`

View File

@ -0,0 +1,15 @@
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use foo::self;
//~^ ERROR expected identifier, found keyword `self`
fn main() {}

View File

@ -19,9 +19,6 @@ use foo::bar::{
use {self};
//~^ ERROR `self` import can only appear in an import list with a non-empty prefix
use foo::self;
//~^ ERROR `self` imports are only allowed within a { } list
mod foo {
pub mod bar {
pub struct Bar;

View File

@ -53,14 +53,15 @@ endif
# Extra flags needed to compile a working executable with the standard library
ifdef IS_WINDOWS
EXTRACFLAGS := -lws2_32
EXTRACFLAGS := -lws2_32 -luserenv
else
ifeq ($(shell uname),Darwin)
else
ifeq ($(shell uname),FreeBSD)
EXTRACFLAGS := -lm -lpthread -lgcc_s
else
ifeq ($(shell uname),OpenBSD)
EXTRACFLAGS := -lm -lpthread
EXTRACFLAGS := -lm -lpthread
else
EXTRACFLAGS := -lm -lrt -ldl -lpthread
endif

View File

@ -18,7 +18,11 @@ fn main() {
assert!(home_dir() == Some(Path::new("/home/MountainView")));
remove_var("HOME");
assert!(home_dir().is_some());
if cfg!(target_os = "android") {
assert!(home_dir().is_none());
} else {
assert!(home_dir().is_some());
}
}
#[cfg(windows)]