diff --git a/tests/testsuite/build.rs b/tests/testsuite/build.rs index 2d1e47424..e60bf21c4 100644 --- a/tests/testsuite/build.rs +++ b/tests/testsuite/build.rs @@ -6,7 +6,7 @@ use crate::support::paths::{root, CargoPathExt}; use crate::support::registry::Package; use crate::support::ProjectBuilder; use crate::support::{ - basic_bin_manifest, basic_lib_manifest, basic_manifest, is_nightly, rustc_host, sleep_ms, + basic_bin_manifest, basic_lib_manifest, basic_manifest, rustc_host, sleep_ms, }; use crate::support::{main_file, project, Execs}; use cargo::util::paths::dylib_path_envvar; @@ -2706,10 +2706,6 @@ fn example_as_dylib() { #[test] fn example_as_proc_macro() { - if !is_nightly() { - return; - } - let p = project() .file( "Cargo.toml", @@ -2725,7 +2721,18 @@ fn example_as_proc_macro() { "#, ) .file("src/lib.rs", "") - .file("examples/ex.rs", "#![feature(proc_macro)]") + .file( + "examples/ex.rs", + r#" + extern crate proc_macro; + use proc_macro::TokenStream; + + #[proc_macro] + pub fn eat(_item: TokenStream) -> TokenStream { + "".parse().unwrap() + } + "#, + ) .build(); p.cargo("build --example=ex").run(); diff --git a/tests/testsuite/cross_compile.rs b/tests/testsuite/cross_compile.rs index 686b28414..6e9623aba 100644 --- a/tests/testsuite/cross_compile.rs +++ b/tests/testsuite/cross_compile.rs @@ -149,6 +149,7 @@ fn plugin_deps() { return; } if !is_nightly() { + // plugins are unstable return; } @@ -241,6 +242,7 @@ fn plugin_to_the_max() { return; } if !is_nightly() { + // plugins are unstable return; } @@ -396,6 +398,7 @@ fn plugin_with_extra_dylib_dep() { return; } if !is_nightly() { + // plugins are unstable return; } diff --git a/tests/testsuite/custom_target.rs b/tests/testsuite/custom_target.rs index d05661aca..2b392f8ac 100644 --- a/tests/testsuite/custom_target.rs +++ b/tests/testsuite/custom_target.rs @@ -4,6 +4,7 @@ use crate::support::{basic_manifest, project}; #[test] fn custom_target_minimal() { if !is_nightly() { + // Requires features no_core, lang_items return; } let p = project() @@ -53,6 +54,7 @@ fn custom_target_minimal() { #[test] fn custom_target_dependency() { if !is_nightly() { + // Requires features no_core, lang_items, optin_builtin_traits return; } let p = project() diff --git a/tests/testsuite/doc.rs b/tests/testsuite/doc.rs index b073a070c..210db61f3 100644 --- a/tests/testsuite/doc.rs +++ b/tests/testsuite/doc.rs @@ -903,9 +903,6 @@ fn document_only_lib() { #[test] fn plugins_no_use_target() { - if !is_nightly() { - return; - } let p = project() .file( "Cargo.toml", @@ -1165,11 +1162,6 @@ fn doc_workspace_open_binary_and_library() { #[test] fn doc_edition() { - if !is_nightly() { - // Stable rustdoc won't have the edition option. Remove this once it - // is stabilized. - return; - } let p = project() .file( "Cargo.toml", @@ -1198,9 +1190,6 @@ fn doc_edition() { #[test] fn doc_target_edition() { - if !is_nightly() { - return; - } let p = project() .file( "Cargo.toml", diff --git a/tests/testsuite/edition.rs b/tests/testsuite/edition.rs index 3652318be..69f45c421 100644 --- a/tests/testsuite/edition.rs +++ b/tests/testsuite/edition.rs @@ -1,11 +1,7 @@ -use crate::support::{basic_lib_manifest, is_nightly, project}; +use crate::support::{basic_lib_manifest, project}; #[test] fn edition_works_for_build_script() { - if !is_nightly() { - return; - } - let p = project() .file( "Cargo.toml", diff --git a/tests/testsuite/fix.rs b/tests/testsuite/fix.rs index 574ef5a2b..a1c335f8c 100644 --- a/tests/testsuite/fix.rs +++ b/tests/testsuite/fix.rs @@ -3,7 +3,6 @@ use std::fs::File; use git2; use crate::support::git; -use crate::support::is_nightly; use crate::support::{basic_manifest, project}; use std::io::Write; @@ -267,15 +266,11 @@ fn do_not_fix_non_relevant_deps() { #[test] fn prepare_for_2018() { - if !is_nightly() { - return; - } let p = project() .file( "src/lib.rs", r#" #![allow(unused)] - #![feature(rust_2018_preview)] mod foo { pub const FOO: &str = "fooo"; @@ -311,15 +306,10 @@ fn prepare_for_2018() { #[test] fn local_paths() { - if !is_nightly() { - return; - } let p = project() .file( "src/lib.rs", r#" - #![feature(rust_2018_preview)] - use test::foo; mod test { @@ -350,9 +340,6 @@ fn local_paths() { #[test] fn upgrade_extern_crate() { - if !is_nightly() { - return; - } let p = project() .file( "Cargo.toml", @@ -403,15 +390,11 @@ fn upgrade_extern_crate() { #[test] fn specify_rustflags() { - if !is_nightly() { - return; - } let p = project() .file( "src/lib.rs", r#" #![allow(unused)] - #![feature(rust_2018_preview)] mod foo { pub const FOO: &str = "fooo"; @@ -874,15 +857,10 @@ information about transitioning to the 2018 edition see: #[test] fn fix_overlapping() { - if !is_nightly() { - return; - } let p = project() .file( "src/lib.rs", r#" - #![feature(rust_2018_preview)] - pub fn foo() {} pub struct A; @@ -912,9 +890,6 @@ fn fix_overlapping() { #[test] fn fix_idioms() { - if !is_nightly() { - return; - } let p = project() .file( "Cargo.toml", @@ -1196,9 +1171,6 @@ fn only_warn_for_relevant_crates() { #[test] fn fix_to_broken_code() { - if !is_nightly() { - return; - } let p = project() .file( "foo/Cargo.toml", diff --git a/tests/testsuite/install.rs b/tests/testsuite/install.rs index 6a893e46a..a991d8e2e 100644 --- a/tests/testsuite/install.rs +++ b/tests/testsuite/install.rs @@ -770,11 +770,6 @@ fn installs_from_cwd_by_default() { #[test] fn installs_from_cwd_with_2018_warnings() { - if !support::is_nightly() { - // Stable rust won't have the edition option. Remove this once it - // is stabilized. - return; - } let p = project() .file( "Cargo.toml", diff --git a/tests/testsuite/package.rs b/tests/testsuite/package.rs index 78bea4f55..fca74f071 100644 --- a/tests/testsuite/package.rs +++ b/tests/testsuite/package.rs @@ -6,7 +6,7 @@ use std::path::Path; use crate::support::cargo_process; use crate::support::registry::Package; use crate::support::{ - basic_manifest, git, is_nightly, path2url, paths, project, publish::validate_crate_contents, + basic_manifest, git, path2url, paths, project, publish::validate_crate_contents, registry, }; use git2; @@ -972,11 +972,6 @@ fn test_edition() { #[test] fn edition_with_metadata() { - if !is_nightly() { - // --edition is nightly-only - return; - } - let p = project() .file( "Cargo.toml", diff --git a/tests/testsuite/plugins.rs b/tests/testsuite/plugins.rs index bd58ebc6b..7cd31c9bd 100644 --- a/tests/testsuite/plugins.rs +++ b/tests/testsuite/plugins.rs @@ -4,6 +4,7 @@ use crate::support::{is_nightly, rustc_host}; #[test] fn plugin_to_the_max() { if !is_nightly() { + // plugins are unstable return; } @@ -103,6 +104,7 @@ fn plugin_to_the_max() { #[test] fn plugin_with_dynamic_native_dependency() { if !is_nightly() { + // plugins are unstable return; } @@ -335,6 +337,7 @@ fn native_plugin_dependency_with_custom_ar_linker() { #[test] fn panic_abort_plugins() { if !is_nightly() { + // requires rustc_private return; } @@ -382,6 +385,7 @@ fn panic_abort_plugins() { #[test] fn shared_panic_abort_plugins() { if !is_nightly() { + // requires rustc_private return; } diff --git a/tests/testsuite/proc_macro.rs b/tests/testsuite/proc_macro.rs index 370765f9d..43a8ad986 100644 --- a/tests/testsuite/proc_macro.rs +++ b/tests/testsuite/proc_macro.rs @@ -204,6 +204,7 @@ fn impl_and_derive() { #[test] fn plugin_and_proc_macro() { if !is_nightly() { + // plugins are unstable return; } diff --git a/tests/testsuite/profiles.rs b/tests/testsuite/profiles.rs index 21510f383..dd5608a05 100644 --- a/tests/testsuite/profiles.rs +++ b/tests/testsuite/profiles.rs @@ -1,6 +1,5 @@ use std::env; -use crate::support::is_nightly; use crate::support::project; #[test] @@ -149,10 +148,6 @@ fn check_opt_level_override(profile_level: &str, rustc_level: &str) { #[test] fn opt_level_overrides() { - if !is_nightly() { - return; - } - for &(profile_level, rustc_level) in &[ ("1", "1"), ("2", "2"), diff --git a/tests/testsuite/run.rs b/tests/testsuite/run.rs index f5394c17a..a16613e98 100644 --- a/tests/testsuite/run.rs +++ b/tests/testsuite/run.rs @@ -1,4 +1,3 @@ -use crate::support; use crate::support::{basic_bin_manifest, basic_lib_manifest, project, Project}; use cargo::util::paths::dylib_path_envvar; @@ -435,10 +434,6 @@ fn autodiscover_examples_project(rust_edition: &str, autoexamples: Option) #[test] fn run_example_autodiscover_2015() { - if !support::is_nightly() { - return; - } - let p = autodiscover_examples_project("2015", None); p.cargo("run --example a") .with_status(101) @@ -467,10 +462,6 @@ error: no example target named `a` #[test] fn run_example_autodiscover_2015_with_autoexamples_enabled() { - if !support::is_nightly() { - return; - } - let p = autodiscover_examples_project("2015", Some(true)); p.cargo("run --example a") .with_stderr( @@ -485,10 +476,6 @@ fn run_example_autodiscover_2015_with_autoexamples_enabled() { #[test] fn run_example_autodiscover_2015_with_autoexamples_disabled() { - if !support::is_nightly() { - return; - } - let p = autodiscover_examples_project("2015", Some(false)); p.cargo("run --example a") .with_status(101) @@ -498,10 +485,6 @@ fn run_example_autodiscover_2015_with_autoexamples_disabled() { #[test] fn run_example_autodiscover_2018() { - if !support::is_nightly() { - return; - } - let p = autodiscover_examples_project("2018", None); p.cargo("run --example a") .with_stderr( diff --git a/tests/testsuite/support/mod.rs b/tests/testsuite/support/mod.rs index 7ac57311d..3a0264f82 100644 --- a/tests/testsuite/support/mod.rs +++ b/tests/testsuite/support/mod.rs @@ -60,6 +60,7 @@ rust, like this: ``` if !is_nightly() { + // Add a comment here explaining why this is necessary. return; } ``` @@ -753,7 +754,6 @@ impl Execs { p.cwd(cwd.join(path.as_ref())); } else { p.cwd(path); - } } self diff --git a/tests/testsuite/test.rs b/tests/testsuite/test.rs index b0ea361c8..413502d91 100644 --- a/tests/testsuite/test.rs +++ b/tests/testsuite/test.rs @@ -6,7 +6,7 @@ use cargo; use crate::support::paths::CargoPathExt; use crate::support::registry::Package; use crate::support::{basic_bin_manifest, basic_lib_manifest, basic_manifest, cargo_exe, project}; -use crate::support::{is_nightly, rustc_host, sleep_ms}; +use crate::support::{rustc_host, sleep_ms}; #[test] fn cargo_test_simple() { @@ -106,9 +106,6 @@ fn cargo_test_release() { #[test] fn cargo_test_overflow_checks() { - if !is_nightly() { - return; - } let p = project() .file( "Cargo.toml",