rust/compiler/rustc_lint/src
Mara Bos 87b269ab66
Rollup merge of #81645 - m-ou-se:panic-lint, r=estebank,flip1995
Add lint for `panic!(123)` which is not accepted in Rust 2021.

This extends the `panic_fmt` lint to warn for all cases where the first argument cannot be interpreted as a format string, as will happen in Rust 2021.

It suggests to add `"{}",` to format the message as a string. In the case of `std::panic!()`, it also suggests the recently stabilized
`std::panic::panic_any()` function as an alternative.

It renames the lint to `non_fmt_panic` to match the lint naming guidelines.

![image](https://user-images.githubusercontent.com/783247/106520928-675ea680-64d5-11eb-81f7-d8fa48b93a0b.png)

This is part of #80162.

r? ```@estebank```
2021-02-04 21:10:36 +01:00
..
nonstandard_style
array_into_iter.rs
builtin.rs Box the biggest ast::ItemKind variants 2021-02-01 09:23:39 +01:00
context.rs Rollup merge of #81556 - nikomatsakis:forbidden-lint-groups-lint, r=pnkfelix 2021-02-04 21:10:34 +01:00
early.rs Really fix early lints inside an async desugaring 2021-02-03 10:05:58 +01:00
internal.rs Box the biggest ast::ItemKind variants 2021-02-01 09:23:39 +01:00
late.rs
levels.rs introduce future-compatibility warning for forbidden lint groups 2021-02-02 18:21:37 -05:00
lib.rs Add lint for panic!(123) which is not accepted in Rust 2021. 2021-02-03 22:42:53 +01:00
methods.rs
non_ascii_idents.rs
non_fmt_panic.rs Add lint for panic!(123) which is not accepted in Rust 2021. 2021-02-03 22:42:53 +01:00
nonstandard_style.rs review comments 2021-01-30 22:06:10 -08:00
passes.rs
redundant_semicolon.rs
traits.rs
types.rs
unused.rs Fix an old FIXME in redundant paren lint 2021-01-30 22:39:56 +03:00