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
|
@ -145,6 +145,11 @@ pub struct FutureIncompatibleInfo {
|
|||
/// The reason for the lint used by diagnostics to provide
|
||||
/// the right help message
|
||||
pub reason: FutureIncompatibilityReason,
|
||||
/// Whether to explain the reason to the user.
|
||||
///
|
||||
/// Set to false for lints that already include a more detailed
|
||||
/// explanation.
|
||||
pub explain_reason: bool,
|
||||
/// Information about a future breakage, which will
|
||||
/// be emitted in JSON messages to be displayed by Cargo
|
||||
/// for upstream deps
|
||||
|
@ -185,6 +190,7 @@ impl FutureIncompatibleInfo {
|
|||
FutureIncompatibleInfo {
|
||||
reference: "",
|
||||
reason: FutureIncompatibilityReason::FutureReleaseError,
|
||||
explain_reason: true,
|
||||
future_breakage: None,
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue