You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
while testing cargo fix I believe I have found a bug: When using uniform_pathscargo fix --edition does not migrate paths in use, and those will fail to build on rust 2018.
If you now run cargo +nightly fix --edition nothing will change, but the code is not compilable in rust 2018. Change Cargo.toml to enable edition 2018 (by adding cargo-features = ["edition"] and package.edition = "2018") and run cargo +nightly build:
$ cargo +nightly build
[...]
error: `criterion` import is ambiguous
--> src/lib.rs:4:5
|
3 | extern crate criterion;
| ----------------------- can refer to `self::criterion`
4 | use criterion::Criterion;
| ^^^^^^^^^ can refer to external crate `::criterion`
|
= help: write `::criterion` or `self::criterion` explicitly instead
= note: relative `use` paths enabled by `#![feature(uniform_paths)]`
[...]
As this diagnostic suggests, cargo +nightly fix --edition should have changed line 4 to use ::criterion::Criterion.
The text was updated successfully, but these errors were encountered:
Thanks for the report! Currently not all suggestions in the compiler are marked as "machine applicable" which means that cargo fix will actually apply the fix. In that sense this is mostly an issue for upstream rust-lang/rust and related to rust-lang/rust#50723
Hi,
while testing
cargo fix
I believe I have found a bug: When usinguniform_paths
cargo fix --edition
does not migrate paths inuse
, and those will fail to build on rust 2018.To reproduce create the following project:
Cargo.toml
:src/lib.rs
:If you now run
cargo +nightly fix --edition
nothing will change, but the code is not compilable in rust 2018. ChangeCargo.toml
to enable edition 2018 (by addingcargo-features = ["edition"]
andpackage.edition = "2018"
) and runcargo +nightly build
:As this diagnostic suggests,
cargo +nightly fix --edition
should have changed line 4 touse ::criterion::Criterion
.The text was updated successfully, but these errors were encountered: