diff --git a/Cargo.toml b/Cargo.toml index 1c77b43ded1..920c9f892bc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,7 +22,7 @@ crates-io = { path = "src/crates-io", version = "0.19" } crossbeam-utils = "0.5" crypto-hash = "0.3.1" curl = "0.4.13" -env_logger = "0.5.4" +env_logger = "0.5.11" failure = "0.1.2" filetime = "0.2" flate2 = "1.0" diff --git a/src/cargo/ops/fix.rs b/src/cargo/ops/fix.rs index 8df53b9a259..0083d8f6ed8 100644 --- a/src/cargo/ops/fix.rs +++ b/src/cargo/ops/fix.rs @@ -233,7 +233,6 @@ fn rustfix_crate(lock_addr: &str, rustc: &Path, filename: &Path, args: &FixArgs) -> Result { args.verify_not_preparing_for_enabled_edition()?; - args.warn_if_preparing_probably_inert()?; // First up we want to make sure that each crate is only checked by one // process at a time. If two invocations concurrently check a crate then @@ -596,38 +595,6 @@ impl FixArgs { process::exit(1); } - /// If we're preparing for an edition and we *don't* find the - /// `rust_2018_preview` feature, for example, in the entry point file then - /// it probably means that the edition isn't actually enabled, so we can't - /// actually fix anything. - /// - /// If this is the case, issue a warning. - fn warn_if_preparing_probably_inert(&self) -> CargoResult<()> { - let edition = match self.prepare_for_edition_resolve() { - Some(s) => s, - None => return Ok(()), - }; - let path = match &self.file { - Some(s) => s, - None => return Ok(()), - }; - let contents = match fs::read_to_string(path) { - Ok(s) => s, - Err(_) => return Ok(()) - }; - - let feature_name = format!("rust_{}_preview", edition); - if contents.contains(&feature_name) { - return Ok(()) - } - Message::PreviewNotFound { - file: path.display().to_string(), - edition: edition.to_string(), - }.post()?; - - Ok(()) - } - fn prepare_for_edition_resolve(&self) -> Option<&str> { match &self.prepare_for_edition { PrepareFor::Edition(s) => Some(s), diff --git a/tests/testsuite/fix.rs b/tests/testsuite/fix.rs index b65b93ef8cb..2092d720830 100644 --- a/tests/testsuite/fix.rs +++ b/tests/testsuite/fix.rs @@ -335,9 +335,6 @@ fn local_paths_no_fix() { let stderr = "\ [CHECKING] foo v0.0.1 ([..]) -warning: failed to find `#![feature(rust_2018_preview)]` in `src/lib.rs` -this may cause `cargo fix` to not be able to fix all -issues in preparation for the 2018 edition [FINISHED] [..] "; p.cargo("fix --edition --allow-no-vcs") @@ -853,26 +850,6 @@ information about transitioning to the 2018 edition see: .run(); } -#[test] -fn prepare_for_without_feature_issues_warning() { - if !is_nightly() { - return; - } - let p = project().file("src/lib.rs", "").build(); - - let stderr = "\ -[CHECKING] foo v0.0.1 ([..]) -warning: failed to find `#![feature(rust_2018_preview)]` in `src/lib.rs` -this may cause `cargo fix` to not be able to fix all -issues in preparation for the 2018 edition -[FINISHED] [..] -"; - p.cargo("fix --edition --allow-no-vcs") - .masquerade_as_nightly_cargo() - .with_stderr(stderr) - .run(); -} - #[test] fn fix_overlapping() { if !is_nightly() {