rust/compiler/rustc_ast/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
..
ast
attr Replace let Some(..) = with .is_some() 2021-01-17 19:06:12 -05:00
expand
util Remove unnecessary manual shrink_to_fit calls 2021-01-16 14:02:36 +01:00
ast.rs Assert the size of the refactored enums 2021-02-01 09:23:40 +01:00
crate_disambiguator.rs
entry.rs
lib.rs Stabilize feature(iterator_fold_self): Iterator::reduce 2021-02-04 11:31:11 +01:00
mut_visit.rs Make panic/assert calls in rustc compatible with Rust 2021. 2021-02-03 22:42:53 +01:00
node_id.rs
ptr.rs
token.rs rustc_parse: Better spans for synthesized token streams 2021-01-07 17:48:13 +03:00
tokenstream.rs Refactor token collection to capture trailing token immediately 2021-01-22 00:33:03 -05:00
visit.rs Box the biggest ast::ItemKind variants 2021-02-01 09:23:39 +01:00