Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 18 pull requests #58316

Merged
merged 39 commits into from
Feb 9, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
3ad0aab
Transition build_helper to 2018 edition
h-michael Feb 3, 2019
fab032a
Transition compiletest to Rust 2018
phansch Feb 3, 2019
a6f2f7f
Transition rustdoc to 2018 edition
h-michael Feb 3, 2019
44b2cc0
librustc_allocator => 2018
taiki-e Feb 6, 2019
ba0fbd7
librustc_save_analysis => 2018
taiki-e Feb 6, 2019
f03704b
Transition librustc_traits to 2018 edition
h-michael Feb 7, 2019
81613ad
disable tests in Miri
RalfJung Feb 7, 2019
725af30
librustc_mir => 2018
taiki-e Feb 7, 2019
efa8fb0
error_index_generator => 2018
taiki-e Feb 8, 2019
7815c9b
Revert removed #![feature(nll)]
taiki-e Feb 8, 2019
d251452
Use real try blocks
taiki-e Feb 8, 2019
c9bc85e
Remove #[macro_use] extern crate bitflags
taiki-e Feb 8, 2019
6140134
librustc_lint => 2018
taiki-e Feb 8, 2019
bf531bd
librustc_passes => 2018
taiki-e Feb 8, 2019
7267bc2
librustc_metadata => 2018
taiki-e Feb 8, 2019
fed677e
librustc_cratesio_shim => 2018
taiki-e Feb 8, 2019
a7241c8
librustc_target => 2018
taiki-e Feb 8, 2019
0e622a8
librustc_codegen_utils => 2018
taiki-e Feb 8, 2019
a2c4a36
librustc_borrowck => 2018
taiki-e Feb 8, 2019
4f2e97e
librustc_incremental => 2018
taiki-e Feb 8, 2019
3e2b5a4
librustc_data_structures => 2018
taiki-e Feb 8, 2019
dbd73f6
Rollup merge of #58091 - phansch:compiletest2018, r=Centril
Centril Feb 8, 2019
f674779
Rollup merge of #58115 - h-michael:rustdoc-2018, r=Centril
Centril Feb 8, 2019
6f5941e
Rollup merge of #58120 - h-michael:build_helper-theme-2018, r=Centril
Centril Feb 8, 2019
5b4cf9b
Rollup merge of #58222 - taiki-e:librustc_allocator-2018, r=Centril
Centril Feb 8, 2019
2b8ed1e
Rollup merge of #58233 - taiki-e:librustc_save_analysis-2018, r=Centril
Centril Feb 8, 2019
543f457
Rollup merge of #58245 - taiki-e:librustc_lint-2018, r=Centril
Centril Feb 8, 2019
50df4d1
Rollup merge of #58247 - taiki-e:librustc_passes-2018, r=Centril
Centril Feb 8, 2019
379a048
Rollup merge of #58251 - h-michael:librustc_traits-2018, r=Centril
Centril Feb 8, 2019
8cbee1c
Rollup merge of #58255 - taiki-e:librustc_metadata-2018, r=Centril
Centril Feb 8, 2019
21509b8
Rollup merge of #58256 - taiki-e:librustc_cratesio_shim-2018, r=Centril
Centril Feb 8, 2019
869135c
Rollup merge of #58257 - taiki-e:librustc_target-2018, r=Centril
Centril Feb 8, 2019
d7a4dd1
Rollup merge of #58259 - taiki-e:librustc_codegen_utils-2018, r=Centril
Centril Feb 8, 2019
c3d365f
Rollup merge of #58260 - taiki-e:librustc_borrowck-2018, r=Centril
Centril Feb 8, 2019
4476e4f
Rollup merge of #58261 - taiki-e:librustc_incremental-2018, r=Centril
Centril Feb 8, 2019
c3b4102
Rollup merge of #58265 - taiki-e:librustc_mir-2018, r=matthewjasper
Centril Feb 8, 2019
9708644
Rollup merge of #58275 - RalfJung:miri-test-libcore, r=Mark-Simulacrum
Centril Feb 8, 2019
5e208f6
Rollup merge of #58285 - taiki-e:error_index_generator-2018, r=Centril
Centril Feb 8, 2019
068a926
Rollup merge of #58312 - taiki-e:librustc_data_structures-2018, r=Cen…
Centril Feb 8, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions src/build_helper/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name = "build_helper"
version = "0.1.0"
authors = ["The Rust Project Developers"]
edition = "2018"

[lib]
name = "build_helper"
Expand Down
2 changes: 2 additions & 0 deletions src/build_helper/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![deny(rust_2018_idioms)]

use std::fs::File;
use std::path::{Path, PathBuf};
use std::process::{Command, Stdio};
Expand Down
2 changes: 2 additions & 0 deletions src/liballoc/tests/arc.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![cfg(not(miri))]

use std::any::Any;
use std::sync::{Arc, Weak};
use std::cell::RefCell;
Expand Down
1 change: 1 addition & 0 deletions src/liballoc/tests/binary_heap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@ fn assert_covariance() {
//
// Destructors must be called exactly once per element.
#[test]
#[cfg(not(miri))]
fn panic_safe() {
static DROP_COUNTER: AtomicUsize = AtomicUsize::new(0);

Expand Down
2 changes: 2 additions & 0 deletions src/liballoc/tests/btree/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![cfg(not(miri))]

mod map;
mod set;

Expand Down
2 changes: 2 additions & 0 deletions src/liballoc/tests/heap.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![cfg(not(miri))]

use std::alloc::{Global, Alloc, Layout, System};

/// https://github.com/rust-lang/rust/issues/45955
Expand Down
2 changes: 2 additions & 0 deletions src/liballoc/tests/rc.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![cfg(not(miri))]

use std::any::Any;
use std::rc::{Rc, Weak};
use std::cell::RefCell;
Expand Down
2 changes: 2 additions & 0 deletions src/liballoc/tests/slice.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![cfg(not(miri))]

use std::cell::Cell;
use std::cmp::Ordering::{self, Equal, Greater, Less};
use std::mem;
Expand Down
21 changes: 21 additions & 0 deletions src/liballoc/tests/str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ fn test_rfind() {
}

#[test]
#[cfg(not(miri))]
fn test_collect() {
let empty = "";
let s: String = empty.chars().collect();
Expand Down Expand Up @@ -118,6 +119,7 @@ fn test_concat_for_different_types() {
#[test]
fn test_concat_for_different_lengths() {
let empty: &[&str] = &[];
#[cfg(not(miri))]
test_concat!("", empty);
test_concat!("a", ["a"]);
test_concat!("ab", ["a", "b"]);
Expand Down Expand Up @@ -146,6 +148,7 @@ fn test_join_for_different_types() {
#[test]
fn test_join_for_different_lengths() {
let empty: &[&str] = &[];
#[cfg(not(miri))]
test_join!("", empty, "-");
test_join!("a", ["a"], "-");
test_join!("a-b", ["a", "b"], "-");
Expand All @@ -159,13 +162,15 @@ fn test_join_for_different_lengths_with_long_separator() {
assert_eq!("~~~~~".len(), 15);

let empty: &[&str] = &[];
#[cfg(not(miri))]
test_join!("", empty, "~~~~~");
test_join!("a", ["a"], "~~~~~");
test_join!("a~~~~~b", ["a", "b"], "~~~~~");
test_join!("~~~~~a~~~~~bc", ["", "a", "bc"], "~~~~~");
}

#[test]
#[cfg(not(miri))]
fn test_unsafe_slice() {
assert_eq!("ab", unsafe {"abc".get_unchecked(0..2)});
assert_eq!("bc", unsafe {"abc".get_unchecked(1..3)});
Expand Down Expand Up @@ -238,6 +243,7 @@ fn test_replacen() {
#[test]
fn test_replace() {
let a = "a";
#[cfg(not(miri))]
assert_eq!("".replace(a, "b"), "");
assert_eq!("a".replace(a, "b"), "b");
assert_eq!("ab".replace(a, "b"), "bb");
Expand Down Expand Up @@ -297,6 +303,7 @@ fn test_replace_pattern() {
// The current implementation of SliceIndex fails to handle methods
// orthogonally from range types; therefore, it is worth testing
// all of the indexing operations on each input.
#[cfg(not(miri))]
mod slice_index {
// Test a slicing operation **that should succeed,**
// testing it on all of the indexing methods.
Expand Down Expand Up @@ -679,6 +686,7 @@ fn test_str_slice_rangetoinclusive_ok() {

#[test]
#[should_panic]
#[cfg(not(miri))]
fn test_str_slice_rangetoinclusive_notok() {
let s = "abcαβγ";
&s[..=3];
Expand All @@ -694,6 +702,7 @@ fn test_str_slicemut_rangetoinclusive_ok() {

#[test]
#[should_panic]
#[cfg(not(miri))]
fn test_str_slicemut_rangetoinclusive_notok() {
let mut s = "abcαβγ".to_owned();
let s: &mut str = &mut s;
Expand Down Expand Up @@ -883,6 +892,7 @@ fn test_as_bytes() {

#[test]
#[should_panic]
#[cfg(not(miri))]
fn test_as_bytes_fail() {
// Don't double free. (I'm not sure if this exercises the
// original problem code path anymore.)
Expand Down Expand Up @@ -972,6 +982,7 @@ fn test_split_at_mut() {

#[test]
#[should_panic]
#[cfg(not(miri))]
fn test_split_at_boundscheck() {
let s = "ศไทย中华Việt Nam";
s.split_at(1);
Expand Down Expand Up @@ -1066,6 +1077,7 @@ fn test_rev_iterator() {
}

#[test]
#[cfg(not(miri))]
fn test_chars_decoding() {
let mut bytes = [0; 4];
for c in (0..0x110000).filter_map(std::char::from_u32) {
Expand All @@ -1077,6 +1089,7 @@ fn test_chars_decoding() {
}

#[test]
#[cfg(not(miri))]
fn test_chars_rev_decoding() {
let mut bytes = [0; 4];
for c in (0..0x110000).filter_map(std::char::from_u32) {
Expand Down Expand Up @@ -1306,6 +1319,7 @@ fn test_splitator() {
}

#[test]
#[cfg(not(miri))]
fn test_str_default() {
use std::default::Default;

Expand Down Expand Up @@ -1365,6 +1379,7 @@ fn test_bool_from_str() {
assert_eq!("not even a boolean".parse::<bool>().ok(), None);
}

#[cfg(not(miri))]
fn check_contains_all_substrings(s: &str) {
assert!(s.contains(""));
for i in 0..s.len() {
Expand All @@ -1375,6 +1390,7 @@ fn check_contains_all_substrings(s: &str) {
}

#[test]
#[cfg(not(miri))]
fn strslice_issue_16589() {
assert!("bananas".contains("nana"));

Expand All @@ -1384,13 +1400,15 @@ fn strslice_issue_16589() {
}

#[test]
#[cfg(not(miri))]
fn strslice_issue_16878() {
assert!(!"1234567ah012345678901ah".contains("hah"));
assert!(!"00abc01234567890123456789abc".contains("bcabc"));
}


#[test]
#[cfg(not(miri))]
fn test_strslice_contains() {
let x = "There are moments, Jeeves, when one asks oneself, 'Do trousers matter?'";
check_contains_all_substrings(x);
Expand Down Expand Up @@ -1528,6 +1546,7 @@ fn trim_ws() {

#[test]
fn to_lowercase() {
#[cfg(not(miri))]
assert_eq!("".to_lowercase(), "");
assert_eq!("AÉDžaé ".to_lowercase(), "aédžaé ");

Expand Down Expand Up @@ -1561,6 +1580,7 @@ fn to_lowercase() {

#[test]
fn to_uppercase() {
#[cfg(not(miri))]
assert_eq!("".to_uppercase(), "");
assert_eq!("aéDžßfiᾀ".to_uppercase(), "AÉDŽSSFIἈΙ");
}
Expand Down Expand Up @@ -1592,6 +1612,7 @@ fn test_cow_from() {
}

#[test]
#[cfg(not(miri))]
fn test_repeat() {
assert_eq!("".repeat(3), "");
assert_eq!("abc".repeat(0), "");
Expand Down
2 changes: 2 additions & 0 deletions src/liballoc/tests/string.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![cfg(not(miri))]

use std::borrow::Cow;
use std::collections::CollectionAllocErr::*;
use std::mem::size_of;
Expand Down
2 changes: 2 additions & 0 deletions src/liballoc/tests/vec.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![cfg(not(miri))]

use std::borrow::Cow;
use std::mem::size_of;
use std::{usize, isize};
Expand Down
7 changes: 7 additions & 0 deletions src/liballoc/tests/vec_deque.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ fn test_index() {

#[test]
#[should_panic]
#[cfg(not(miri))]
fn test_index_out_of_bounds() {
let mut deq = VecDeque::new();
for i in 1..4 {
Expand Down Expand Up @@ -906,20 +907,24 @@ fn test_append() {
// normal append
a.append(&mut b);
assert_eq!(a.iter().cloned().collect::<Vec<_>>(), [1, 2, 3, 4, 5, 6]);
#[cfg(not(miri))]
assert_eq!(b.iter().cloned().collect::<Vec<_>>(), []);

// append nothing to something
a.append(&mut b);
assert_eq!(a.iter().cloned().collect::<Vec<_>>(), [1, 2, 3, 4, 5, 6]);
#[cfg(not(miri))]
assert_eq!(b.iter().cloned().collect::<Vec<_>>(), []);

// append something to nothing
b.append(&mut a);
assert_eq!(b.iter().cloned().collect::<Vec<_>>(), [1, 2, 3, 4, 5, 6]);
#[cfg(not(miri))]
assert_eq!(a.iter().cloned().collect::<Vec<_>>(), []);
}

#[test]
#[cfg(not(miri))]
fn test_append_permutations() {
fn construct_vec_deque(
push_back: usize,
Expand Down Expand Up @@ -1120,6 +1125,7 @@ fn test_reserve_exact_2() {
}

#[test]
#[cfg(not(miri))]
fn test_try_reserve() {

// These are the interesting cases:
Expand Down Expand Up @@ -1221,6 +1227,7 @@ fn test_try_reserve() {
}

#[test]
#[cfg(not(miri))]
fn test_try_reserve_exact() {

// This is exactly the same as test_try_reserve with the method changed.
Expand Down
2 changes: 2 additions & 0 deletions src/libcore/tests/cell.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![cfg(not(miri))]

use core::cell::*;
use core::default::Default;
use std::mem::drop;
Expand Down
2 changes: 2 additions & 0 deletions src/libcore/tests/fmt/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![cfg(not(miri))]

mod builders;
mod float;
mod num;
Expand Down
2 changes: 2 additions & 0 deletions src/libcore/tests/hash/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![cfg(not(miri))]

mod sip;

use std::hash::{Hash, Hasher};
Expand Down
8 changes: 8 additions & 0 deletions src/libcore/tests/iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ fn test_iterator_step_by() {
}

#[test]
#[cfg(not(miri))]
fn test_iterator_step_by_nth() {
let mut it = (0..16).step_by(5);
assert_eq!(it.nth(0), Some(0));
Expand All @@ -208,6 +209,7 @@ fn test_iterator_step_by_nth() {
}

#[test]
#[cfg(not(miri))]
fn test_iterator_step_by_nth_overflow() {
#[cfg(target_pointer_width = "8")]
type Bigger = u16;
Expand Down Expand Up @@ -253,12 +255,14 @@ fn test_iterator_step_by_nth_overflow() {

#[test]
#[should_panic]
#[cfg(not(miri))]
fn test_iterator_step_by_zero() {
let mut it = (0..).step_by(0);
it.next();
}

#[test]
#[cfg(not(miri))]
fn test_iterator_step_by_size_hint() {
struct StubSizeHint(usize, Option<usize>);
impl Iterator for StubSizeHint {
Expand Down Expand Up @@ -1413,6 +1417,7 @@ fn test_rposition() {

#[test]
#[should_panic]
#[cfg(not(miri))]
fn test_rposition_panic() {
let v: [(Box<_>, Box<_>); 4] =
[(box 0, box 0), (box 0, box 0),
Expand Down Expand Up @@ -1652,6 +1657,7 @@ fn test_range_inclusive_nth() {
}

#[test]
#[cfg(not(miri))]
fn test_range_step() {
#![allow(deprecated)]

Expand All @@ -1675,13 +1681,15 @@ fn test_range_step() {
}

#[test]
#[cfg(not(miri))]
fn test_step_by_skip() {
assert_eq!((0..640).step_by(128).skip(1).collect::<Vec<_>>(), [128, 256, 384, 512]);
assert_eq!((0..=50).step_by(10).nth(3), Some(30));
assert_eq!((200..=255u8).step_by(10).nth(3), Some(230));
}

#[test]
#[cfg(not(miri))]
fn test_range_inclusive_step() {
assert_eq!((0..=50).step_by(10).collect::<Vec<_>>(), [0, 10, 20, 30, 40, 50]);
assert_eq!((0..=5).step_by(1).collect::<Vec<_>>(), [0, 1, 2, 3, 4, 5]);
Expand Down
2 changes: 2 additions & 0 deletions src/libcore/tests/num/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![cfg(not(miri))]

use core::convert::{TryFrom, TryInto};
use core::cmp::PartialEq;
use core::fmt::Debug;
Expand Down
3 changes: 3 additions & 0 deletions src/libcore/tests/option.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ fn test_option_dance() {
}

#[test] #[should_panic]
#[cfg(not(miri))]
fn test_option_too_much_dance() {
struct A;
let mut y = Some(A);
Expand Down Expand Up @@ -129,13 +130,15 @@ fn test_unwrap() {

#[test]
#[should_panic]
#[cfg(not(miri))]
fn test_unwrap_panic1() {
let x: Option<isize> = None;
x.unwrap();
}

#[test]
#[should_panic]
#[cfg(not(miri))]
fn test_unwrap_panic2() {
let x: Option<String> = None;
x.unwrap();
Expand Down
2 changes: 2 additions & 0 deletions src/libcore/tests/ptr.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![cfg(not(miri))]

use core::ptr::*;
use core::cell::RefCell;

Expand Down
Loading