Skip to content

Commit

Permalink
Auto merge of #23796 - alexcrichton:rollup, r=alexcrichton
Browse files Browse the repository at this point in the history
  • Loading branch information
bors committed Mar 27, 2015
2 parents 0c9de81 + d3a4f36 commit 5520801
Show file tree
Hide file tree
Showing 1,616 changed files with 7,967 additions and 8,427 deletions.
2 changes: 0 additions & 2 deletions src/compiletest/compiletest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@

#![feature(box_syntax)]
#![feature(collections)]
#![feature(int_uint)]
#![feature(old_io)]
#![feature(old_path)]
#![feature(rustc_private)]
#![feature(unboxed_closures)]
#![feature(std_misc)]
Expand Down
8 changes: 4 additions & 4 deletions src/compiletest/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ use std::io::prelude::*;
use std::path::Path;

pub struct ExpectedError {
pub line: uint,
pub line: usize,
pub kind: String,
pub msg: String,
}

#[derive(PartialEq, Debug)]
enum WhichLine { ThisLine, FollowPrevious(uint), AdjustBackward(uint) }
enum WhichLine { ThisLine, FollowPrevious(usize), AdjustBackward(usize) }

/// Looks for either "//~| KIND MESSAGE" or "//~^^... KIND MESSAGE"
/// The former is a "follow" that inherits its target from the preceding line;
Expand Down Expand Up @@ -58,8 +58,8 @@ pub fn load_errors(testfile: &Path) -> Vec<ExpectedError> {
}).collect()
}

fn parse_expected(last_nonfollow_error: Option<uint>,
line_num: uint,
fn parse_expected(last_nonfollow_error: Option<usize>,
line_num: usize,
line: &str) -> Option<(WhichLine, ExpectedError)> {
let start = match line.find("//~") { Some(i) => i, None => return None };
let (follow, adjusts) = if line.char_at(start + 3) == '|' {
Expand Down
10 changes: 5 additions & 5 deletions src/compiletest/header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ pub fn parse_name_value_directive(line: &str, directive: &str)
}
}

pub fn gdb_version_to_int(version_string: &str) -> int {
pub fn gdb_version_to_int(version_string: &str) -> isize {
let error_string = format!(
"Encountered GDB version string with unexpected format: {}",
version_string);
Expand All @@ -369,17 +369,17 @@ pub fn gdb_version_to_int(version_string: &str) -> int {
panic!("{}", error_string);
}

let major: int = components[0].parse().ok().expect(&error_string);
let minor: int = components[1].parse().ok().expect(&error_string);
let major: isize = components[0].parse().ok().expect(&error_string);
let minor: isize = components[1].parse().ok().expect(&error_string);

return major * 1000 + minor;
}

pub fn lldb_version_to_int(version_string: &str) -> int {
pub fn lldb_version_to_int(version_string: &str) -> isize {
let error_string = format!(
"Encountered LLDB version string with unexpected format: {}",
version_string);
let error_string = error_string;
let major: int = version_string.parse().ok().expect(&error_string);
let major: isize = version_string.parse().ok().expect(&error_string);
return major;
}
10 changes: 4 additions & 6 deletions src/compiletest/procsrv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,25 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#![allow(deprecated)] // for old path, for dynamic_lib

use std::dynamic_lib::DynamicLibrary;
use std::io::prelude::*;
use std::old_path::Path;
use std::path::PathBuf;
use std::process::{ExitStatus, Command, Child, Output, Stdio};

fn add_target_env(cmd: &mut Command, lib_path: &str, aux_path: Option<&str>) {
// Need to be sure to put both the lib_path and the aux path in the dylib
// search path for the child.
let mut path = DynamicLibrary::search_path();
match aux_path {
Some(p) => path.insert(0, Path::new(p)),
Some(p) => path.insert(0, PathBuf::from(p)),
None => {}
}
path.insert(0, Path::new(lib_path));
path.insert(0, PathBuf::from(lib_path));

// Add the new dylib search path var
let var = DynamicLibrary::envvar();
let newpath = DynamicLibrary::create_path(&path);
let newpath = String::from_utf8(newpath).unwrap();
let newpath = newpath.to_str().unwrap().to_string();
cmd.env(var, &newpath);
}

Expand Down
12 changes: 6 additions & 6 deletions src/compiletest/runtest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -758,7 +758,7 @@ fn run_debuginfo_lldb_test(config: &Config, props: &TestProps, testfile: &Path)
struct DebuggerCommands {
commands: Vec<String>,
check_lines: Vec<String>,
breakpoint_lines: Vec<uint>,
breakpoint_lines: Vec<usize>,
}

fn parse_debugger_commands(file_path: &Path, debugger_prefix: &str)
Expand Down Expand Up @@ -1036,7 +1036,7 @@ fn is_compiler_error_or_warning(line: &str) -> bool {
scan_string(line, "warning", &mut i));
}

fn scan_until_char(haystack: &str, needle: char, idx: &mut uint) -> bool {
fn scan_until_char(haystack: &str, needle: char, idx: &mut usize) -> bool {
if *idx >= haystack.len() {
return false;
}
Expand All @@ -1048,7 +1048,7 @@ fn scan_until_char(haystack: &str, needle: char, idx: &mut uint) -> bool {
return true;
}

fn scan_char(haystack: &str, needle: char, idx: &mut uint) -> bool {
fn scan_char(haystack: &str, needle: char, idx: &mut usize) -> bool {
if *idx >= haystack.len() {
return false;
}
Expand All @@ -1060,7 +1060,7 @@ fn scan_char(haystack: &str, needle: char, idx: &mut uint) -> bool {
return true;
}

fn scan_integer(haystack: &str, idx: &mut uint) -> bool {
fn scan_integer(haystack: &str, idx: &mut usize) -> bool {
let mut i = *idx;
while i < haystack.len() {
let ch = haystack.char_at(i);
Expand All @@ -1076,7 +1076,7 @@ fn scan_integer(haystack: &str, idx: &mut uint) -> bool {
return true;
}

fn scan_string(haystack: &str, needle: &str, idx: &mut uint) -> bool {
fn scan_string(haystack: &str, needle: &str, idx: &mut usize) -> bool {
let mut haystack_i = *idx;
let mut needle_i = 0;
while needle_i < needle.len() {
Expand Down Expand Up @@ -1725,7 +1725,7 @@ fn disassemble_extract(config: &Config, _props: &TestProps,
}


fn count_extracted_lines(p: &Path) -> uint {
fn count_extracted_lines(p: &Path) -> usize {
let mut x = Vec::new();
File::open(&p.with_extension("ll")).unwrap().read_to_end(&mut x).unwrap();
let x = str::from_utf8(&x).unwrap();
Expand Down
33 changes: 17 additions & 16 deletions src/compiletest/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,33 +13,34 @@ use common::Config;

/// Conversion table from triple OS name to Rust SYSNAME
const OS_TABLE: &'static [(&'static str, &'static str)] = &[
("mingw32", "windows"),
("win32", "windows"),
("windows", "windows"),
("darwin", "macos"),
("android", "android"),
("linux", "linux"),
("freebsd", "freebsd"),
("dragonfly", "dragonfly"),
("bitrig", "bitrig"),
("darwin", "macos"),
("dragonfly", "dragonfly"),
("freebsd", "freebsd"),
("ios", "ios"),
("linux", "linux"),
("mingw32", "windows"),
("openbsd", "openbsd"),
("win32", "windows"),
("windows", "windows"),
];

const ARCH_TABLE: &'static [(&'static str, &'static str)] = &[
("i386", "x86"),
("i686", "x86"),
("aarch64", "aarch64"),
("amd64", "x86_64"),
("x86_64", "x86_64"),
("sparc", "sparc"),
("powerpc", "powerpc"),
("arm64", "aarch64"),
("arm", "arm"),
("aarch64", "aarch64"),
("arm64", "aarch64"),
("hexagon", "hexagon"),
("i386", "x86"),
("i686", "x86"),
("mips", "mips"),
("xcore", "xcore"),
("msp430", "msp430"),
("hexagon", "hexagon"),
("powerpc", "powerpc"),
("s390x", "systemz"),
("sparc", "sparc"),
("x86_64", "x86_64"),
("xcore", "xcore"),
];

pub fn get_os(triple: &str) -> &'static str {
Expand Down
Loading

0 comments on commit 5520801

Please sign in to comment.