Skip to content

Testsuite: remove some unnecessary is_nightly checks. #6786

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

Merged
merged 1 commit into from
Mar 27, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 13 additions & 6 deletions tests/testsuite/build.rs
Original file line number Diff line number Diff line change
@@ -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();
3 changes: 3 additions & 0 deletions tests/testsuite/cross_compile.rs
Original file line number Diff line number Diff line change
@@ -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;
}

2 changes: 2 additions & 0 deletions tests/testsuite/custom_target.rs
Original file line number Diff line number Diff line change
@@ -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()
11 changes: 0 additions & 11 deletions tests/testsuite/doc.rs
Original file line number Diff line number Diff line change
@@ -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",
6 changes: 1 addition & 5 deletions tests/testsuite/edition.rs
Original file line number Diff line number Diff line change
@@ -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",
28 changes: 0 additions & 28 deletions tests/testsuite/fix.rs
Original file line number Diff line number Diff line change
@@ -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<T>() {}
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",
5 changes: 0 additions & 5 deletions tests/testsuite/install.rs
Original file line number Diff line number Diff line change
@@ -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",
7 changes: 1 addition & 6 deletions tests/testsuite/package.rs
Original file line number Diff line number Diff line change
@@ -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",
4 changes: 4 additions & 0 deletions tests/testsuite/plugins.rs
Original file line number Diff line number Diff line change
@@ -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;
}

1 change: 1 addition & 0 deletions tests/testsuite/proc_macro.rs
Original file line number Diff line number Diff line change
@@ -204,6 +204,7 @@ fn impl_and_derive() {
#[test]
fn plugin_and_proc_macro() {
if !is_nightly() {
// plugins are unstable
return;
}

5 changes: 0 additions & 5 deletions tests/testsuite/profiles.rs
Original file line number Diff line number Diff line change
@@ -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"),
17 changes: 0 additions & 17 deletions tests/testsuite/run.rs
Original file line number Diff line number Diff line change
@@ -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<bool>)

#[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(
2 changes: 1 addition & 1 deletion tests/testsuite/support/mod.rs
Original file line number Diff line number Diff line change
@@ -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
5 changes: 1 addition & 4 deletions tests/testsuite/test.rs
Original file line number Diff line number Diff line change
@@ -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",