mirror of
https://github.com/rust-lang/cargo.git
synced 2025-10-01 11:30:39 +00:00
Testsuite: remove some unnecessary is_nightly checks.
This commit is contained in:
parent
1ebf6ef219
commit
50277e88fe
@ -6,7 +6,7 @@ use crate::support::paths::{root, CargoPathExt};
|
|||||||
use crate::support::registry::Package;
|
use crate::support::registry::Package;
|
||||||
use crate::support::ProjectBuilder;
|
use crate::support::ProjectBuilder;
|
||||||
use crate::support::{
|
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 crate::support::{main_file, project, Execs};
|
||||||
use cargo::util::paths::dylib_path_envvar;
|
use cargo::util::paths::dylib_path_envvar;
|
||||||
@ -2706,10 +2706,6 @@ fn example_as_dylib() {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn example_as_proc_macro() {
|
fn example_as_proc_macro() {
|
||||||
if !is_nightly() {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
let p = project()
|
let p = project()
|
||||||
.file(
|
.file(
|
||||||
"Cargo.toml",
|
"Cargo.toml",
|
||||||
@ -2725,7 +2721,18 @@ fn example_as_proc_macro() {
|
|||||||
"#,
|
"#,
|
||||||
)
|
)
|
||||||
.file("src/lib.rs", "")
|
.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();
|
.build();
|
||||||
|
|
||||||
p.cargo("build --example=ex").run();
|
p.cargo("build --example=ex").run();
|
||||||
|
@ -149,6 +149,7 @@ fn plugin_deps() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if !is_nightly() {
|
if !is_nightly() {
|
||||||
|
// plugins are unstable
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -241,6 +242,7 @@ fn plugin_to_the_max() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if !is_nightly() {
|
if !is_nightly() {
|
||||||
|
// plugins are unstable
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -396,6 +398,7 @@ fn plugin_with_extra_dylib_dep() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if !is_nightly() {
|
if !is_nightly() {
|
||||||
|
// plugins are unstable
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,6 +4,7 @@ use crate::support::{basic_manifest, project};
|
|||||||
#[test]
|
#[test]
|
||||||
fn custom_target_minimal() {
|
fn custom_target_minimal() {
|
||||||
if !is_nightly() {
|
if !is_nightly() {
|
||||||
|
// Requires features no_core, lang_items
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let p = project()
|
let p = project()
|
||||||
@ -53,6 +54,7 @@ fn custom_target_minimal() {
|
|||||||
#[test]
|
#[test]
|
||||||
fn custom_target_dependency() {
|
fn custom_target_dependency() {
|
||||||
if !is_nightly() {
|
if !is_nightly() {
|
||||||
|
// Requires features no_core, lang_items, optin_builtin_traits
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let p = project()
|
let p = project()
|
||||||
|
@ -903,9 +903,6 @@ fn document_only_lib() {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn plugins_no_use_target() {
|
fn plugins_no_use_target() {
|
||||||
if !is_nightly() {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
let p = project()
|
let p = project()
|
||||||
.file(
|
.file(
|
||||||
"Cargo.toml",
|
"Cargo.toml",
|
||||||
@ -1165,11 +1162,6 @@ fn doc_workspace_open_binary_and_library() {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn doc_edition() {
|
fn doc_edition() {
|
||||||
if !is_nightly() {
|
|
||||||
// Stable rustdoc won't have the edition option. Remove this once it
|
|
||||||
// is stabilized.
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
let p = project()
|
let p = project()
|
||||||
.file(
|
.file(
|
||||||
"Cargo.toml",
|
"Cargo.toml",
|
||||||
@ -1198,9 +1190,6 @@ fn doc_edition() {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn doc_target_edition() {
|
fn doc_target_edition() {
|
||||||
if !is_nightly() {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
let p = project()
|
let p = project()
|
||||||
.file(
|
.file(
|
||||||
"Cargo.toml",
|
"Cargo.toml",
|
||||||
|
@ -1,11 +1,7 @@
|
|||||||
use crate::support::{basic_lib_manifest, is_nightly, project};
|
use crate::support::{basic_lib_manifest, project};
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn edition_works_for_build_script() {
|
fn edition_works_for_build_script() {
|
||||||
if !is_nightly() {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
let p = project()
|
let p = project()
|
||||||
.file(
|
.file(
|
||||||
"Cargo.toml",
|
"Cargo.toml",
|
||||||
|
@ -3,7 +3,6 @@ use std::fs::File;
|
|||||||
use git2;
|
use git2;
|
||||||
|
|
||||||
use crate::support::git;
|
use crate::support::git;
|
||||||
use crate::support::is_nightly;
|
|
||||||
use crate::support::{basic_manifest, project};
|
use crate::support::{basic_manifest, project};
|
||||||
|
|
||||||
use std::io::Write;
|
use std::io::Write;
|
||||||
@ -267,15 +266,11 @@ fn do_not_fix_non_relevant_deps() {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn prepare_for_2018() {
|
fn prepare_for_2018() {
|
||||||
if !is_nightly() {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
let p = project()
|
let p = project()
|
||||||
.file(
|
.file(
|
||||||
"src/lib.rs",
|
"src/lib.rs",
|
||||||
r#"
|
r#"
|
||||||
#![allow(unused)]
|
#![allow(unused)]
|
||||||
#![feature(rust_2018_preview)]
|
|
||||||
|
|
||||||
mod foo {
|
mod foo {
|
||||||
pub const FOO: &str = "fooo";
|
pub const FOO: &str = "fooo";
|
||||||
@ -311,15 +306,10 @@ fn prepare_for_2018() {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn local_paths() {
|
fn local_paths() {
|
||||||
if !is_nightly() {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
let p = project()
|
let p = project()
|
||||||
.file(
|
.file(
|
||||||
"src/lib.rs",
|
"src/lib.rs",
|
||||||
r#"
|
r#"
|
||||||
#![feature(rust_2018_preview)]
|
|
||||||
|
|
||||||
use test::foo;
|
use test::foo;
|
||||||
|
|
||||||
mod test {
|
mod test {
|
||||||
@ -350,9 +340,6 @@ fn local_paths() {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn upgrade_extern_crate() {
|
fn upgrade_extern_crate() {
|
||||||
if !is_nightly() {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
let p = project()
|
let p = project()
|
||||||
.file(
|
.file(
|
||||||
"Cargo.toml",
|
"Cargo.toml",
|
||||||
@ -403,15 +390,11 @@ fn upgrade_extern_crate() {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn specify_rustflags() {
|
fn specify_rustflags() {
|
||||||
if !is_nightly() {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
let p = project()
|
let p = project()
|
||||||
.file(
|
.file(
|
||||||
"src/lib.rs",
|
"src/lib.rs",
|
||||||
r#"
|
r#"
|
||||||
#![allow(unused)]
|
#![allow(unused)]
|
||||||
#![feature(rust_2018_preview)]
|
|
||||||
|
|
||||||
mod foo {
|
mod foo {
|
||||||
pub const FOO: &str = "fooo";
|
pub const FOO: &str = "fooo";
|
||||||
@ -874,15 +857,10 @@ information about transitioning to the 2018 edition see:
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn fix_overlapping() {
|
fn fix_overlapping() {
|
||||||
if !is_nightly() {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
let p = project()
|
let p = project()
|
||||||
.file(
|
.file(
|
||||||
"src/lib.rs",
|
"src/lib.rs",
|
||||||
r#"
|
r#"
|
||||||
#![feature(rust_2018_preview)]
|
|
||||||
|
|
||||||
pub fn foo<T>() {}
|
pub fn foo<T>() {}
|
||||||
pub struct A;
|
pub struct A;
|
||||||
|
|
||||||
@ -912,9 +890,6 @@ fn fix_overlapping() {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn fix_idioms() {
|
fn fix_idioms() {
|
||||||
if !is_nightly() {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
let p = project()
|
let p = project()
|
||||||
.file(
|
.file(
|
||||||
"Cargo.toml",
|
"Cargo.toml",
|
||||||
@ -1196,9 +1171,6 @@ fn only_warn_for_relevant_crates() {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn fix_to_broken_code() {
|
fn fix_to_broken_code() {
|
||||||
if !is_nightly() {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
let p = project()
|
let p = project()
|
||||||
.file(
|
.file(
|
||||||
"foo/Cargo.toml",
|
"foo/Cargo.toml",
|
||||||
|
@ -770,11 +770,6 @@ fn installs_from_cwd_by_default() {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn installs_from_cwd_with_2018_warnings() {
|
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()
|
let p = project()
|
||||||
.file(
|
.file(
|
||||||
"Cargo.toml",
|
"Cargo.toml",
|
||||||
|
@ -6,7 +6,7 @@ use std::path::Path;
|
|||||||
use crate::support::cargo_process;
|
use crate::support::cargo_process;
|
||||||
use crate::support::registry::Package;
|
use crate::support::registry::Package;
|
||||||
use crate::support::{
|
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,
|
registry,
|
||||||
};
|
};
|
||||||
use git2;
|
use git2;
|
||||||
@ -972,11 +972,6 @@ fn test_edition() {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn edition_with_metadata() {
|
fn edition_with_metadata() {
|
||||||
if !is_nightly() {
|
|
||||||
// --edition is nightly-only
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
let p = project()
|
let p = project()
|
||||||
.file(
|
.file(
|
||||||
"Cargo.toml",
|
"Cargo.toml",
|
||||||
|
@ -4,6 +4,7 @@ use crate::support::{is_nightly, rustc_host};
|
|||||||
#[test]
|
#[test]
|
||||||
fn plugin_to_the_max() {
|
fn plugin_to_the_max() {
|
||||||
if !is_nightly() {
|
if !is_nightly() {
|
||||||
|
// plugins are unstable
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -103,6 +104,7 @@ fn plugin_to_the_max() {
|
|||||||
#[test]
|
#[test]
|
||||||
fn plugin_with_dynamic_native_dependency() {
|
fn plugin_with_dynamic_native_dependency() {
|
||||||
if !is_nightly() {
|
if !is_nightly() {
|
||||||
|
// plugins are unstable
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -335,6 +337,7 @@ fn native_plugin_dependency_with_custom_ar_linker() {
|
|||||||
#[test]
|
#[test]
|
||||||
fn panic_abort_plugins() {
|
fn panic_abort_plugins() {
|
||||||
if !is_nightly() {
|
if !is_nightly() {
|
||||||
|
// requires rustc_private
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -382,6 +385,7 @@ fn panic_abort_plugins() {
|
|||||||
#[test]
|
#[test]
|
||||||
fn shared_panic_abort_plugins() {
|
fn shared_panic_abort_plugins() {
|
||||||
if !is_nightly() {
|
if !is_nightly() {
|
||||||
|
// requires rustc_private
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -204,6 +204,7 @@ fn impl_and_derive() {
|
|||||||
#[test]
|
#[test]
|
||||||
fn plugin_and_proc_macro() {
|
fn plugin_and_proc_macro() {
|
||||||
if !is_nightly() {
|
if !is_nightly() {
|
||||||
|
// plugins are unstable
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
use std::env;
|
use std::env;
|
||||||
|
|
||||||
use crate::support::is_nightly;
|
|
||||||
use crate::support::project;
|
use crate::support::project;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@ -149,10 +148,6 @@ fn check_opt_level_override(profile_level: &str, rustc_level: &str) {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn opt_level_overrides() {
|
fn opt_level_overrides() {
|
||||||
if !is_nightly() {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
for &(profile_level, rustc_level) in &[
|
for &(profile_level, rustc_level) in &[
|
||||||
("1", "1"),
|
("1", "1"),
|
||||||
("2", "2"),
|
("2", "2"),
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
use crate::support;
|
|
||||||
use crate::support::{basic_bin_manifest, basic_lib_manifest, project, Project};
|
use crate::support::{basic_bin_manifest, basic_lib_manifest, project, Project};
|
||||||
use cargo::util::paths::dylib_path_envvar;
|
use cargo::util::paths::dylib_path_envvar;
|
||||||
|
|
||||||
@ -435,10 +434,6 @@ fn autodiscover_examples_project(rust_edition: &str, autoexamples: Option<bool>)
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn run_example_autodiscover_2015() {
|
fn run_example_autodiscover_2015() {
|
||||||
if !support::is_nightly() {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
let p = autodiscover_examples_project("2015", None);
|
let p = autodiscover_examples_project("2015", None);
|
||||||
p.cargo("run --example a")
|
p.cargo("run --example a")
|
||||||
.with_status(101)
|
.with_status(101)
|
||||||
@ -467,10 +462,6 @@ error: no example target named `a`
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn run_example_autodiscover_2015_with_autoexamples_enabled() {
|
fn run_example_autodiscover_2015_with_autoexamples_enabled() {
|
||||||
if !support::is_nightly() {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
let p = autodiscover_examples_project("2015", Some(true));
|
let p = autodiscover_examples_project("2015", Some(true));
|
||||||
p.cargo("run --example a")
|
p.cargo("run --example a")
|
||||||
.with_stderr(
|
.with_stderr(
|
||||||
@ -485,10 +476,6 @@ fn run_example_autodiscover_2015_with_autoexamples_enabled() {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn run_example_autodiscover_2015_with_autoexamples_disabled() {
|
fn run_example_autodiscover_2015_with_autoexamples_disabled() {
|
||||||
if !support::is_nightly() {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
let p = autodiscover_examples_project("2015", Some(false));
|
let p = autodiscover_examples_project("2015", Some(false));
|
||||||
p.cargo("run --example a")
|
p.cargo("run --example a")
|
||||||
.with_status(101)
|
.with_status(101)
|
||||||
@ -498,10 +485,6 @@ fn run_example_autodiscover_2015_with_autoexamples_disabled() {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn run_example_autodiscover_2018() {
|
fn run_example_autodiscover_2018() {
|
||||||
if !support::is_nightly() {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
let p = autodiscover_examples_project("2018", None);
|
let p = autodiscover_examples_project("2018", None);
|
||||||
p.cargo("run --example a")
|
p.cargo("run --example a")
|
||||||
.with_stderr(
|
.with_stderr(
|
||||||
|
@ -60,6 +60,7 @@ rust, like this:
|
|||||||
|
|
||||||
```
|
```
|
||||||
if !is_nightly() {
|
if !is_nightly() {
|
||||||
|
// Add a comment here explaining why this is necessary.
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
@ -753,7 +754,6 @@ impl Execs {
|
|||||||
p.cwd(cwd.join(path.as_ref()));
|
p.cwd(cwd.join(path.as_ref()));
|
||||||
} else {
|
} else {
|
||||||
p.cwd(path);
|
p.cwd(path);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
self
|
self
|
||||||
|
@ -6,7 +6,7 @@ use cargo;
|
|||||||
use crate::support::paths::CargoPathExt;
|
use crate::support::paths::CargoPathExt;
|
||||||
use crate::support::registry::Package;
|
use crate::support::registry::Package;
|
||||||
use crate::support::{basic_bin_manifest, basic_lib_manifest, basic_manifest, cargo_exe, project};
|
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]
|
#[test]
|
||||||
fn cargo_test_simple() {
|
fn cargo_test_simple() {
|
||||||
@ -106,9 +106,6 @@ fn cargo_test_release() {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn cargo_test_overflow_checks() {
|
fn cargo_test_overflow_checks() {
|
||||||
if !is_nightly() {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
let p = project()
|
let p = project()
|
||||||
.file(
|
.file(
|
||||||
"Cargo.toml",
|
"Cargo.toml",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user