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

Lines changed: 1 addition & 0 deletions
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

Lines changed: 2 additions & 0 deletions
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

Lines changed: 2 additions & 0 deletions
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

Lines changed: 1 addition & 0 deletions
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

Lines changed: 2 additions & 0 deletions
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

Lines changed: 2 additions & 0 deletions
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

Lines changed: 2 additions & 0 deletions
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

Lines changed: 2 additions & 0 deletions
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

Lines changed: 21 additions & 0 deletions
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

Lines changed: 2 additions & 0 deletions
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;

0 commit comments

Comments
 (0)