diff options
| author | bors <bors@rust-lang.org> | 2018-02-27 16:44:59 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2018-02-27 16:44:59 +0000 |
| commit | d3ae9a9e08edf12de0ed82af57ba2a56c26496ea (patch) | |
| tree | de72b3163b47f646b717f1f809d1315b9bf49da9 /src/test | |
| parent | 4d90ac38c0b61bb69470b61ea2cccea0df48d9e5 (diff) | |
| parent | 9853d20e4d054207c54b62e3fb700106652bcac9 (diff) | |
| download | rust-1.24.1.tar.gz rust-1.24.1.zip | |
Auto merge of #48445 - Mark-Simulacrum:stable-next, r=alexcrichton 1.24.1
[stable] 1.24.1 stable release The includes the following commits: - 6a600f827b632fb798b9ca52345130748fe86a30: Fixes #48251, unwinding through FFI no longer aborts - https://github.com/cuviper/rust/commit/b445a52ea322758fb7b60fab5f890ef8c0f8df9c: Fixes https://github.com/rust-lang/rust/issues/48308, fixing the error index generator - f8e00d0dc221564701ecdbb6dde57e0e9dd12900: Fixes https://github.com/rust-lang/rust/issues/48318 by emitting UTF-16 output on MSVC targets. - 2a0af8c448: Bumps the version number to 1.24.1. - 93220f0f45: Release notes - 6031718d8836f95bbfeddfaa63f1ee1d66e53f26: Cargo TLS warnings on Windows.
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/run-make/long-linker-command-lines-cmd-exe/foo.rs | 25 | ||||
| -rw-r--r-- | src/test/run-make/long-linker-command-lines/foo.rs | 21 | ||||
| -rw-r--r-- | src/test/run-pass/abort-on-c-abi.rs | 1 |
3 files changed, 38 insertions, 9 deletions
diff --git a/src/test/run-make/long-linker-command-lines-cmd-exe/foo.rs b/src/test/run-make/long-linker-command-lines-cmd-exe/foo.rs index f9168a82e22..67d8ad0b672 100644 --- a/src/test/run-make/long-linker-command-lines-cmd-exe/foo.rs +++ b/src/test/run-make/long-linker-command-lines-cmd-exe/foo.rs @@ -36,8 +36,11 @@ fn main() { let ok = tmpdir.join("ok"); let not_ok = tmpdir.join("not_ok"); if env::var("YOU_ARE_A_LINKER").is_ok() { - match env::args().find(|a| a.contains("@")) { - Some(file) => { fs::copy(&file[1..], &ok).unwrap(); } + match env::args_os().find(|a| a.to_string_lossy().contains("@")) { + Some(file) => { + let file = file.to_str().unwrap(); + fs::copy(&file[1..], &ok).unwrap(); + } None => { File::create(¬_ok).unwrap(); } } return @@ -84,11 +87,23 @@ fn main() { continue } - let mut contents = String::new(); - File::open(&ok).unwrap().read_to_string(&mut contents).unwrap(); + let mut contents = Vec::new(); + File::open(&ok).unwrap().read_to_end(&mut contents).unwrap(); for j in 0..i { - assert!(contents.contains(&format!("{}{}", lib_name, j))); + let exp = format!("{}{}", lib_name, j); + let exp = if cfg!(target_env = "msvc") { + let mut out = Vec::with_capacity(exp.len() * 2); + for c in exp.encode_utf16() { + // encode in little endian + out.push(c as u8); + out.push((c >> 8) as u8); + } + out + } else { + exp.into_bytes() + }; + assert!(contents.windows(exp.len()).any(|w| w == &exp[..])); } break diff --git a/src/test/run-make/long-linker-command-lines/foo.rs b/src/test/run-make/long-linker-command-lines/foo.rs index e6fd6b65366..2ac240982af 100644 --- a/src/test/run-make/long-linker-command-lines/foo.rs +++ b/src/test/run-make/long-linker-command-lines/foo.rs @@ -27,7 +27,8 @@ fn main() { let tmpdir = PathBuf::from(env::var_os("TMPDIR").unwrap()); let ok = tmpdir.join("ok"); if env::var("YOU_ARE_A_LINKER").is_ok() { - if let Some(file) = env::args().find(|a| a.contains("@")) { + if let Some(file) = env::args_os().find(|a| a.to_string_lossy().contains("@")) { + let file = file.to_str().expect("non-utf8 file argument"); fs::copy(&file[1..], &ok).unwrap(); } return @@ -76,11 +77,23 @@ fn main() { continue } - let mut contents = String::new(); - File::open(&ok).unwrap().read_to_string(&mut contents).unwrap(); + let mut contents = Vec::new(); + File::open(&ok).unwrap().read_to_end(&mut contents).unwrap(); for j in 0..i { - assert!(contents.contains(&format!("{}{}", lib_name, j))); + let exp = format!("{}{}", lib_name, j); + let exp = if cfg!(target_env = "msvc") { + let mut out = Vec::with_capacity(exp.len() * 2); + for c in exp.encode_utf16() { + // encode in little endian + out.push(c as u8); + out.push((c >> 8) as u8); + } + out + } else { + exp.into_bytes() + }; + assert!(contents.windows(exp.len()).any(|w| w == &exp[..])); } break diff --git a/src/test/run-pass/abort-on-c-abi.rs b/src/test/run-pass/abort-on-c-abi.rs index 63fd934b0d0..40c4ec20151 100644 --- a/src/test/run-pass/abort-on-c-abi.rs +++ b/src/test/run-pass/abort-on-c-abi.rs @@ -12,6 +12,7 @@ // we never unwind through them. // ignore-emscripten no processes +// ignore-test FIXME rust-lang/rust#48251 -- temporarily disabled use std::{env, panic}; use std::io::prelude::*; |
