Skip to content

Commit cb6fafb

Browse files
committed
Auto merge of #58316 - Centril:rollup, r=Centril
Rollup of 18 pull requests Successful merges: - #58091 (Transition compiletest to Rust 2018) - #58115 (Transition rustdoc to 2018 edition) - #58120 (Transition build_helper to 2018 edition) - #58222 (librustc_allocator => 2018) - #58233 (librustc_save_analysis => 2018) - #58245 (librustc_lint => 2018) - #58247 (librustc_passes => 2018) - #58251 (Transition librustc_traits to 2018 edition) - #58255 (librustc_metadata => 2018) - #58256 (librustc_cratesio_shim => 2018) - #58257 (librustc_target => 2018) - #58259 (librustc_codegen_utils => 2018) - #58260 (librustc_borrowck => 2018) - #58261 (librustc_incremental => 2018) - #58265 (librustc_mir => 2018) - #58275 (libcore, liballoc: disable tests in Miri) - #58285 (error_index_generator => 2018) - #58312 (librustc_data_structures => 2018) Failed merges: r? @ghost
2 parents a2ec156 + 068a926 commit cb6fafb

File tree

401 files changed

+1381
-1328
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

401 files changed

+1381
-1328
lines changed

src/build_helper/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
name = "build_helper"
33
version = "0.1.0"
44
authors = ["The Rust Project Developers"]
5+
edition = "2018"
56

67
[lib]
78
name = "build_helper"

src/build_helper/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![deny(rust_2018_idioms)]
2+
13
use std::fs::File;
24
use std::path::{Path, PathBuf};
35
use std::process::{Command, Stdio};

src/liballoc/tests/arc.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![cfg(not(miri))]
2+
13
use std::any::Any;
24
use std::sync::{Arc, Weak};
35
use std::cell::RefCell;

src/liballoc/tests/binary_heap.rs

+1
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,7 @@ fn assert_covariance() {
282282
//
283283
// Destructors must be called exactly once per element.
284284
#[test]
285+
#[cfg(not(miri))]
285286
fn panic_safe() {
286287
static DROP_COUNTER: AtomicUsize = AtomicUsize::new(0);
287288

src/liballoc/tests/btree/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![cfg(not(miri))]
2+
13
mod map;
24
mod set;
35

src/liballoc/tests/heap.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![cfg(not(miri))]
2+
13
use std::alloc::{Global, Alloc, Layout, System};
24

35
/// https://github.com/rust-lang/rust/issues/45955

src/liballoc/tests/rc.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![cfg(not(miri))]
2+
13
use std::any::Any;
24
use std::rc::{Rc, Weak};
35
use std::cell::RefCell;

src/liballoc/tests/slice.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![cfg(not(miri))]
2+
13
use std::cell::Cell;
24
use std::cmp::Ordering::{self, Equal, Greater, Less};
35
use std::mem;

src/liballoc/tests/str.rs

+21
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ fn test_rfind() {
3131
}
3232

3333
#[test]
34+
#[cfg(not(miri))]
3435
fn test_collect() {
3536
let empty = "";
3637
let s: String = empty.chars().collect();
@@ -118,6 +119,7 @@ fn test_concat_for_different_types() {
118119
#[test]
119120
fn test_concat_for_different_lengths() {
120121
let empty: &[&str] = &[];
122+
#[cfg(not(miri))]
121123
test_concat!("", empty);
122124
test_concat!("a", ["a"]);
123125
test_concat!("ab", ["a", "b"]);
@@ -146,6 +148,7 @@ fn test_join_for_different_types() {
146148
#[test]
147149
fn test_join_for_different_lengths() {
148150
let empty: &[&str] = &[];
151+
#[cfg(not(miri))]
149152
test_join!("", empty, "-");
150153
test_join!("a", ["a"], "-");
151154
test_join!("a-b", ["a", "b"], "-");
@@ -159,13 +162,15 @@ fn test_join_for_different_lengths_with_long_separator() {
159162
assert_eq!("~~~~~".len(), 15);
160163

161164
let empty: &[&str] = &[];
165+
#[cfg(not(miri))]
162166
test_join!("", empty, "~~~~~");
163167
test_join!("a", ["a"], "~~~~~");
164168
test_join!("a~~~~~b", ["a", "b"], "~~~~~");
165169
test_join!("~~~~~a~~~~~bc", ["", "a", "bc"], "~~~~~");
166170
}
167171

168172
#[test]
173+
#[cfg(not(miri))]
169174
fn test_unsafe_slice() {
170175
assert_eq!("ab", unsafe {"abc".get_unchecked(0..2)});
171176
assert_eq!("bc", unsafe {"abc".get_unchecked(1..3)});
@@ -238,6 +243,7 @@ fn test_replacen() {
238243
#[test]
239244
fn test_replace() {
240245
let a = "a";
246+
#[cfg(not(miri))]
241247
assert_eq!("".replace(a, "b"), "");
242248
assert_eq!("a".replace(a, "b"), "b");
243249
assert_eq!("ab".replace(a, "b"), "bb");
@@ -297,6 +303,7 @@ fn test_replace_pattern() {
297303
// The current implementation of SliceIndex fails to handle methods
298304
// orthogonally from range types; therefore, it is worth testing
299305
// all of the indexing operations on each input.
306+
#[cfg(not(miri))]
300307
mod slice_index {
301308
// Test a slicing operation **that should succeed,**
302309
// testing it on all of the indexing methods.
@@ -679,6 +686,7 @@ fn test_str_slice_rangetoinclusive_ok() {
679686

680687
#[test]
681688
#[should_panic]
689+
#[cfg(not(miri))]
682690
fn test_str_slice_rangetoinclusive_notok() {
683691
let s = "abcαβγ";
684692
&s[..=3];
@@ -694,6 +702,7 @@ fn test_str_slicemut_rangetoinclusive_ok() {
694702

695703
#[test]
696704
#[should_panic]
705+
#[cfg(not(miri))]
697706
fn test_str_slicemut_rangetoinclusive_notok() {
698707
let mut s = "abcαβγ".to_owned();
699708
let s: &mut str = &mut s;
@@ -883,6 +892,7 @@ fn test_as_bytes() {
883892

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

973983
#[test]
974984
#[should_panic]
985+
#[cfg(not(miri))]
975986
fn test_split_at_boundscheck() {
976987
let s = "ศไทย中华Việt Nam";
977988
s.split_at(1);
@@ -1066,6 +1077,7 @@ fn test_rev_iterator() {
10661077
}
10671078

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

10791091
#[test]
1092+
#[cfg(not(miri))]
10801093
fn test_chars_rev_decoding() {
10811094
let mut bytes = [0; 4];
10821095
for c in (0..0x110000).filter_map(std::char::from_u32) {
@@ -1306,6 +1319,7 @@ fn test_splitator() {
13061319
}
13071320

13081321
#[test]
1322+
#[cfg(not(miri))]
13091323
fn test_str_default() {
13101324
use std::default::Default;
13111325

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

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

13771392
#[test]
1393+
#[cfg(not(miri))]
13781394
fn strslice_issue_16589() {
13791395
assert!("bananas".contains("nana"));
13801396

@@ -1384,13 +1400,15 @@ fn strslice_issue_16589() {
13841400
}
13851401

13861402
#[test]
1403+
#[cfg(not(miri))]
13871404
fn strslice_issue_16878() {
13881405
assert!(!"1234567ah012345678901ah".contains("hah"));
13891406
assert!(!"00abc01234567890123456789abc".contains("bcabc"));
13901407
}
13911408

13921409

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

15291547
#[test]
15301548
fn to_lowercase() {
1549+
#[cfg(not(miri))]
15311550
assert_eq!("".to_lowercase(), "");
15321551
assert_eq!("AÉDžaé ".to_lowercase(), "aédžaé ");
15331552

@@ -1561,6 +1580,7 @@ fn to_lowercase() {
15611580

15621581
#[test]
15631582
fn to_uppercase() {
1583+
#[cfg(not(miri))]
15641584
assert_eq!("".to_uppercase(), "");
15651585
assert_eq!("aéDžßfiᾀ".to_uppercase(), "AÉDŽSSFIἈΙ");
15661586
}
@@ -1592,6 +1612,7 @@ fn test_cow_from() {
15921612
}
15931613

15941614
#[test]
1615+
#[cfg(not(miri))]
15951616
fn test_repeat() {
15961617
assert_eq!("".repeat(3), "");
15971618
assert_eq!("abc".repeat(0), "");

src/liballoc/tests/string.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![cfg(not(miri))]
2+
13
use std::borrow::Cow;
24
use std::collections::CollectionAllocErr::*;
35
use std::mem::size_of;

src/liballoc/tests/vec.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![cfg(not(miri))]
2+
13
use std::borrow::Cow;
24
use std::mem::size_of;
35
use std::{usize, isize};

src/liballoc/tests/vec_deque.rs

+7
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ fn test_index() {
108108

109109
#[test]
110110
#[should_panic]
111+
#[cfg(not(miri))]
111112
fn test_index_out_of_bounds() {
112113
let mut deq = VecDeque::new();
113114
for i in 1..4 {
@@ -906,20 +907,24 @@ fn test_append() {
906907
// normal append
907908
a.append(&mut b);
908909
assert_eq!(a.iter().cloned().collect::<Vec<_>>(), [1, 2, 3, 4, 5, 6]);
910+
#[cfg(not(miri))]
909911
assert_eq!(b.iter().cloned().collect::<Vec<_>>(), []);
910912

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

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

922926
#[test]
927+
#[cfg(not(miri))]
923928
fn test_append_permutations() {
924929
fn construct_vec_deque(
925930
push_back: usize,
@@ -1120,6 +1125,7 @@ fn test_reserve_exact_2() {
11201125
}
11211126

11221127
#[test]
1128+
#[cfg(not(miri))]
11231129
fn test_try_reserve() {
11241130

11251131
// These are the interesting cases:
@@ -1221,6 +1227,7 @@ fn test_try_reserve() {
12211227
}
12221228

12231229
#[test]
1230+
#[cfg(not(miri))]
12241231
fn test_try_reserve_exact() {
12251232

12261233
// This is exactly the same as test_try_reserve with the method changed.

src/libcore/tests/cell.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![cfg(not(miri))]
2+
13
use core::cell::*;
24
use core::default::Default;
35
use std::mem::drop;

src/libcore/tests/fmt/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![cfg(not(miri))]
2+
13
mod builders;
24
mod float;
35
mod num;

src/libcore/tests/hash/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![cfg(not(miri))]
2+
13
mod sip;
24

35
use std::hash::{Hash, Hasher};

src/libcore/tests/iter.rs

+8
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ fn test_iterator_step_by() {
190190
}
191191

192192
#[test]
193+
#[cfg(not(miri))]
193194
fn test_iterator_step_by_nth() {
194195
let mut it = (0..16).step_by(5);
195196
assert_eq!(it.nth(0), Some(0));
@@ -208,6 +209,7 @@ fn test_iterator_step_by_nth() {
208209
}
209210

210211
#[test]
212+
#[cfg(not(miri))]
211213
fn test_iterator_step_by_nth_overflow() {
212214
#[cfg(target_pointer_width = "8")]
213215
type Bigger = u16;
@@ -253,12 +255,14 @@ fn test_iterator_step_by_nth_overflow() {
253255

254256
#[test]
255257
#[should_panic]
258+
#[cfg(not(miri))]
256259
fn test_iterator_step_by_zero() {
257260
let mut it = (0..).step_by(0);
258261
it.next();
259262
}
260263

261264
#[test]
265+
#[cfg(not(miri))]
262266
fn test_iterator_step_by_size_hint() {
263267
struct StubSizeHint(usize, Option<usize>);
264268
impl Iterator for StubSizeHint {
@@ -1413,6 +1417,7 @@ fn test_rposition() {
14131417

14141418
#[test]
14151419
#[should_panic]
1420+
#[cfg(not(miri))]
14161421
fn test_rposition_panic() {
14171422
let v: [(Box<_>, Box<_>); 4] =
14181423
[(box 0, box 0), (box 0, box 0),
@@ -1652,6 +1657,7 @@ fn test_range_inclusive_nth() {
16521657
}
16531658

16541659
#[test]
1660+
#[cfg(not(miri))]
16551661
fn test_range_step() {
16561662
#![allow(deprecated)]
16571663

@@ -1675,13 +1681,15 @@ fn test_range_step() {
16751681
}
16761682

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

16841691
#[test]
1692+
#[cfg(not(miri))]
16851693
fn test_range_inclusive_step() {
16861694
assert_eq!((0..=50).step_by(10).collect::<Vec<_>>(), [0, 10, 20, 30, 40, 50]);
16871695
assert_eq!((0..=5).step_by(1).collect::<Vec<_>>(), [0, 1, 2, 3, 4, 5]);

src/libcore/tests/num/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![cfg(not(miri))]
2+
13
use core::convert::{TryFrom, TryInto};
24
use core::cmp::PartialEq;
35
use core::fmt::Debug;

src/libcore/tests/option.rs

+3
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ fn test_option_dance() {
6969
}
7070

7171
#[test] #[should_panic]
72+
#[cfg(not(miri))]
7273
fn test_option_too_much_dance() {
7374
struct A;
7475
let mut y = Some(A);
@@ -129,13 +130,15 @@ fn test_unwrap() {
129130

130131
#[test]
131132
#[should_panic]
133+
#[cfg(not(miri))]
132134
fn test_unwrap_panic1() {
133135
let x: Option<isize> = None;
134136
x.unwrap();
135137
}
136138

137139
#[test]
138140
#[should_panic]
141+
#[cfg(not(miri))]
139142
fn test_unwrap_panic2() {
140143
let x: Option<String> = None;
141144
x.unwrap();

src/libcore/tests/ptr.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![cfg(not(miri))]
2+
13
use core::ptr::*;
24
use core::cell::RefCell;
35

0 commit comments

Comments
 (0)