Rollup merge of #86671 - m-ou-se:non-fmt-panic-future-incompatible, r=nikomatsakis
Turn non_fmt_panic into a future_incompatible edition lint. This turns the `non_fmt_panic` lint into a future_incompatible edition lint, so it becomes part of the `rust_2021_compatibility` group. See https://github.com/rust-lang/rust/issues/85894. This lint produces both warnings about semantical changes (e.g. `panic!("{{")`) and things that will become hard errors (e.g. `panic!("{")`). So I added a `explain_reason: false` that supresses the default "this will become a hard error" or "the semantics will change" message, and instead added a note depending on the situation. (cc `@rylev)` r? `@nikomatsakis`
This commit is contained in:
commit
14f333597e
4 changed files with 46 additions and 16 deletions
|
@ -398,9 +398,14 @@ pub fn struct_lint_level<'s, 'd>(
|
|||
it will become a hard error in a future release!"
|
||||
.to_owned()
|
||||
};
|
||||
let citation = format!("for more information, see {}", future_incompatible.reference);
|
||||
err.warn(&explanation);
|
||||
err.note(&citation);
|
||||
if future_incompatible.explain_reason {
|
||||
err.warn(&explanation);
|
||||
}
|
||||
if !future_incompatible.reference.is_empty() {
|
||||
let citation =
|
||||
format!("for more information, see {}", future_incompatible.reference);
|
||||
err.note(&citation);
|
||||
}
|
||||
}
|
||||
|
||||
// Finally, run `decorate`. This function is also responsible for emitting the diagnostic.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue