@@ -809,6 +809,7 @@ fn prepare_for_unstable() {
809
809
}
810
810
} ;
811
811
let latest_stable = Edition :: LATEST_STABLE ;
812
+ let prev = latest_stable. previous ( ) . unwrap ( ) ;
812
813
let p = project ( )
813
814
. file (
814
815
"Cargo.toml" ,
@@ -828,13 +829,24 @@ fn prepare_for_unstable() {
828
829
// -j1 to make the error more deterministic (otherwise there can be
829
830
// multiple errors since they run in parallel).
830
831
p. cargo ( "fix --edition --allow-no-vcs -j1" )
831
- . with_status ( 101 )
832
- . with_stderr ( & format ! ( "\
832
+ . with_stderr ( & format_args ! ( "\
833
833
[CHECKING] foo [..]
834
- [ERROR] cannot migrate src/lib.rs to edition {next}
834
+ [WARNING] ` src/lib.rs` is on the latest edition, but trying to migrate to edition {next}.
835
835
Edition {next} is unstable and not allowed in this release, consider trying the nightly release channel.
836
- error: could not compile `foo`
837
- " , next=next) )
836
+
837
+ If you are trying to migrate from the previous edition ({prev}), the
838
+ process requires following these steps:
839
+
840
+ 1. Start with `edition = \" {prev}\" ` in `Cargo.toml`
841
+ 2. Run `cargo fix --edition`
842
+ 3. Modify `Cargo.toml` to set `edition = \" {latest_stable}\" `
843
+ 4. Run `cargo build` or `cargo test` to verify the fixes worked
844
+
845
+ More details may be found at
846
+ https://doc.rust-lang.org/edition-guide/editions/transitioning-an-existing-project-to-a-new-edition.html
847
+
848
+ [FINISHED] [..]
849
+ " , next=next, latest_stable=latest_stable, prev=prev) )
838
850
. run ( ) ;
839
851
840
852
if !is_nightly ( ) {
0 commit comments