Skip to content

Commit a57b96d

Browse files
committed
Auto merge of #6786 - ehuss:remove-is_nightly-test-checks, r=dwijnand
Testsuite: remove some unnecessary is_nightly checks.
2 parents b3b65c3 + 50277e8 commit a57b96d

File tree

14 files changed

+27
-87
lines changed

14 files changed

+27
-87
lines changed

tests/testsuite/build.rs

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use crate::support::paths::{root, CargoPathExt};
66
use crate::support::registry::Package;
77
use crate::support::ProjectBuilder;
88
use crate::support::{
9-
basic_bin_manifest, basic_lib_manifest, basic_manifest, is_nightly, rustc_host, sleep_ms,
9+
basic_bin_manifest, basic_lib_manifest, basic_manifest, rustc_host, sleep_ms,
1010
};
1111
use crate::support::{main_file, project, Execs};
1212
use cargo::util::paths::dylib_path_envvar;
@@ -2706,10 +2706,6 @@ fn example_as_dylib() {
27062706

27072707
#[test]
27082708
fn example_as_proc_macro() {
2709-
if !is_nightly() {
2710-
return;
2711-
}
2712-
27132709
let p = project()
27142710
.file(
27152711
"Cargo.toml",
@@ -2725,7 +2721,18 @@ fn example_as_proc_macro() {
27252721
"#,
27262722
)
27272723
.file("src/lib.rs", "")
2728-
.file("examples/ex.rs", "#![feature(proc_macro)]")
2724+
.file(
2725+
"examples/ex.rs",
2726+
r#"
2727+
extern crate proc_macro;
2728+
use proc_macro::TokenStream;
2729+
2730+
#[proc_macro]
2731+
pub fn eat(_item: TokenStream) -> TokenStream {
2732+
"".parse().unwrap()
2733+
}
2734+
"#,
2735+
)
27292736
.build();
27302737

27312738
p.cargo("build --example=ex").run();

tests/testsuite/cross_compile.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ fn plugin_deps() {
149149
return;
150150
}
151151
if !is_nightly() {
152+
// plugins are unstable
152153
return;
153154
}
154155

@@ -241,6 +242,7 @@ fn plugin_to_the_max() {
241242
return;
242243
}
243244
if !is_nightly() {
245+
// plugins are unstable
244246
return;
245247
}
246248

@@ -396,6 +398,7 @@ fn plugin_with_extra_dylib_dep() {
396398
return;
397399
}
398400
if !is_nightly() {
401+
// plugins are unstable
399402
return;
400403
}
401404

tests/testsuite/custom_target.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ use crate::support::{basic_manifest, project};
44
#[test]
55
fn custom_target_minimal() {
66
if !is_nightly() {
7+
// Requires features no_core, lang_items
78
return;
89
}
910
let p = project()
@@ -53,6 +54,7 @@ fn custom_target_minimal() {
5354
#[test]
5455
fn custom_target_dependency() {
5556
if !is_nightly() {
57+
// Requires features no_core, lang_items, optin_builtin_traits
5658
return;
5759
}
5860
let p = project()

tests/testsuite/doc.rs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -886,9 +886,6 @@ fn document_only_lib() {
886886

887887
#[test]
888888
fn plugins_no_use_target() {
889-
if !is_nightly() {
890-
return;
891-
}
892889
let p = project()
893890
.file(
894891
"Cargo.toml",
@@ -1148,11 +1145,6 @@ fn doc_workspace_open_binary_and_library() {
11481145

11491146
#[test]
11501147
fn doc_edition() {
1151-
if !is_nightly() {
1152-
// Stable rustdoc won't have the edition option. Remove this once it
1153-
// is stabilized.
1154-
return;
1155-
}
11561148
let p = project()
11571149
.file(
11581150
"Cargo.toml",
@@ -1181,9 +1173,6 @@ fn doc_edition() {
11811173

11821174
#[test]
11831175
fn doc_target_edition() {
1184-
if !is_nightly() {
1185-
return;
1186-
}
11871176
let p = project()
11881177
.file(
11891178
"Cargo.toml",

tests/testsuite/edition.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
1-
use crate::support::{basic_lib_manifest, is_nightly, project};
1+
use crate::support::{basic_lib_manifest, project};
22

33
#[test]
44
fn edition_works_for_build_script() {
5-
if !is_nightly() {
6-
return;
7-
}
8-
95
let p = project()
106
.file(
117
"Cargo.toml",

tests/testsuite/fix.rs

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ use std::fs::File;
33
use git2;
44

55
use crate::support::git;
6-
use crate::support::is_nightly;
76
use crate::support::{basic_manifest, project};
87

98
use std::io::Write;
@@ -267,15 +266,11 @@ fn do_not_fix_non_relevant_deps() {
267266

268267
#[test]
269268
fn prepare_for_2018() {
270-
if !is_nightly() {
271-
return;
272-
}
273269
let p = project()
274270
.file(
275271
"src/lib.rs",
276272
r#"
277273
#![allow(unused)]
278-
#![feature(rust_2018_preview)]
279274
280275
mod foo {
281276
pub const FOO: &str = "fooo";
@@ -311,15 +306,10 @@ fn prepare_for_2018() {
311306

312307
#[test]
313308
fn local_paths() {
314-
if !is_nightly() {
315-
return;
316-
}
317309
let p = project()
318310
.file(
319311
"src/lib.rs",
320312
r#"
321-
#![feature(rust_2018_preview)]
322-
323313
use test::foo;
324314
325315
mod test {
@@ -350,9 +340,6 @@ fn local_paths() {
350340

351341
#[test]
352342
fn upgrade_extern_crate() {
353-
if !is_nightly() {
354-
return;
355-
}
356343
let p = project()
357344
.file(
358345
"Cargo.toml",
@@ -403,15 +390,11 @@ fn upgrade_extern_crate() {
403390

404391
#[test]
405392
fn specify_rustflags() {
406-
if !is_nightly() {
407-
return;
408-
}
409393
let p = project()
410394
.file(
411395
"src/lib.rs",
412396
r#"
413397
#![allow(unused)]
414-
#![feature(rust_2018_preview)]
415398
416399
mod foo {
417400
pub const FOO: &str = "fooo";
@@ -874,15 +857,10 @@ information about transitioning to the 2018 edition see:
874857

875858
#[test]
876859
fn fix_overlapping() {
877-
if !is_nightly() {
878-
return;
879-
}
880860
let p = project()
881861
.file(
882862
"src/lib.rs",
883863
r#"
884-
#![feature(rust_2018_preview)]
885-
886864
pub fn foo<T>() {}
887865
pub struct A;
888866
@@ -912,9 +890,6 @@ fn fix_overlapping() {
912890

913891
#[test]
914892
fn fix_idioms() {
915-
if !is_nightly() {
916-
return;
917-
}
918893
let p = project()
919894
.file(
920895
"Cargo.toml",
@@ -1196,9 +1171,6 @@ fn only_warn_for_relevant_crates() {
11961171

11971172
#[test]
11981173
fn fix_to_broken_code() {
1199-
if !is_nightly() {
1200-
return;
1201-
}
12021174
let p = project()
12031175
.file(
12041176
"foo/Cargo.toml",

tests/testsuite/install.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -770,11 +770,6 @@ fn installs_from_cwd_by_default() {
770770

771771
#[test]
772772
fn installs_from_cwd_with_2018_warnings() {
773-
if !support::is_nightly() {
774-
// Stable rust won't have the edition option. Remove this once it
775-
// is stabilized.
776-
return;
777-
}
778773
let p = project()
779774
.file(
780775
"Cargo.toml",

tests/testsuite/package.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use std::path::Path;
66
use crate::support::cargo_process;
77
use crate::support::registry::Package;
88
use crate::support::{
9-
basic_manifest, git, is_nightly, path2url, paths, project, publish::validate_crate_contents,
9+
basic_manifest, git, path2url, paths, project, publish::validate_crate_contents,
1010
registry,
1111
};
1212
use git2;
@@ -972,11 +972,6 @@ fn test_edition() {
972972

973973
#[test]
974974
fn edition_with_metadata() {
975-
if !is_nightly() {
976-
// --edition is nightly-only
977-
return;
978-
}
979-
980975
let p = project()
981976
.file(
982977
"Cargo.toml",

tests/testsuite/plugins.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ use crate::support::{is_nightly, rustc_host};
44
#[test]
55
fn plugin_to_the_max() {
66
if !is_nightly() {
7+
// plugins are unstable
78
return;
89
}
910

@@ -103,6 +104,7 @@ fn plugin_to_the_max() {
103104
#[test]
104105
fn plugin_with_dynamic_native_dependency() {
105106
if !is_nightly() {
107+
// plugins are unstable
106108
return;
107109
}
108110

@@ -335,6 +337,7 @@ fn native_plugin_dependency_with_custom_ar_linker() {
335337
#[test]
336338
fn panic_abort_plugins() {
337339
if !is_nightly() {
340+
// requires rustc_private
338341
return;
339342
}
340343

@@ -382,6 +385,7 @@ fn panic_abort_plugins() {
382385
#[test]
383386
fn shared_panic_abort_plugins() {
384387
if !is_nightly() {
388+
// requires rustc_private
385389
return;
386390
}
387391

tests/testsuite/proc_macro.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,7 @@ fn impl_and_derive() {
204204
#[test]
205205
fn plugin_and_proc_macro() {
206206
if !is_nightly() {
207+
// plugins are unstable
207208
return;
208209
}
209210

0 commit comments

Comments
 (0)