@@ -181,10 +181,35 @@ impl<'a> DiagnosticPrinter<'a> {
181
181
if !self . dedupe . insert ( msg. clone ( ) ) {
182
182
return Ok ( ( ) ) ;
183
183
}
184
- self . config . shell ( ) . warn ( & format ! (
185
- "`{}` is already on the latest edition ({}), unable to migrate further" ,
184
+ let warning = format ! (
185
+ "`{}` is already on the latest edition ({}), \
186
+ unable to migrate further",
186
187
file, edition
187
- ) )
188
+ ) ;
189
+ // Don't give a really verbose warning if it has already been issued.
190
+ if self . dedupe . insert ( Message :: EditionAlreadyEnabled {
191
+ file : "" . to_string ( ) , // Dummy, so that this only long-warns once.
192
+ edition : * edition,
193
+ } ) {
194
+ self . config . shell ( ) . warn ( & format ! ( "\
195
+ {}
196
+
197
+ If you are trying to migrate from the previous edition ({prev_edition}), the
198
+ process requires following these steps:
199
+
200
+ 1. Start with `edition = \" {prev_edition}\" ` in `Cargo.toml`
201
+ 2. Run `cargo fix --edition`
202
+ 3. Modify `Cargo.toml` to set `edition = \" {this_edition}\" `
203
+ 4. Run `cargo build` or `cargo test` to verify the fixes worked
204
+
205
+ More details may be found at
206
+ https://doc.rust-lang.org/edition-guide/editions/transitioning-an-existing-project-to-a-new-edition.html
207
+ " ,
208
+ warning, this_edition=edition, prev_edition=edition. previous( ) . unwrap( )
209
+ ) )
210
+ } else {
211
+ self . config . shell ( ) . warn ( warning)
212
+ }
188
213
}
189
214
}
190
215
}
0 commit comments