rust/library
bors 74285eb3a8 Auto merge of #78088 - fusion-engineering-forks:panic-fmt-lint, r=estebank
Add lint for panic!("{}")

This adds a lint that warns about `panic!("{}")`.

`panic!(msg)` invocations with a single argument use their argument as panic payload literally, without using it as a format string. The same holds for `assert!(expr, msg)`.

This lints checks if `msg` is a string literal (after expansion), and warns in case it contained braces. It suggests to insert `"{}", ` to use the message literally, or to add arguments to use it as a format string.

![image](https://user-images.githubusercontent.com/783247/96643867-79eb1080-1328-11eb-8d4e-a5586837c70a.png)

This lint is also a good starting point for adding warnings about `panic!(not_a_string)` later, once [`panic_any()`](https://github.com/rust-lang/rust/pull/74622) becomes a stable alternative.
2020-11-20 03:40:20 +00:00
..
alloc Rollup merge of #79077 - RalfJung:llvm-magic, r=Mark-Simulacrum 2020-11-17 10:06:23 +01:00
backtrace@8b8ea53b56 Bump backtrace-rs to enable Mach-O support on iOS. 2020-10-23 13:47:09 +02:00
core Auto merge of #78088 - fusion-engineering-forks:panic-fmt-lint, r=estebank 2020-11-20 03:40:20 +00:00
panic_abort
panic_unwind Fix even more URLs 2020-11-05 20:11:29 +01:00
proc_macro Rollup merge of #78465 - est31:proc_macro_to_string, r=jyn514 2020-11-05 10:29:42 +01:00
profiler_builtins
rtstartup
rustc-std-workspace-alloc
rustc-std-workspace-core
rustc-std-workspace-std
std Auto merge of #78088 - fusion-engineering-forks:panic-fmt-lint, r=estebank 2020-11-20 03:40:20 +00:00
stdarch@777efaf564 Enable AVX512 *epi64 variants by updating stdarch 2020-11-17 11:50:52 +01:00
term
test Rollup merge of #79090 - hermitcore:builtins, r=Mark-Simulacrum 2020-11-19 16:26:23 +01:00
unwind