rust/src/test
Dylan DPC 547b3adfe4
Rollup merge of #82113 - m-ou-se:panic-format-lint, r=estebank
Improve non_fmt_panic lint.

This change:
- fixes the span used by this lint in the case the panic argument is a single macro expansion (e.g. `panic!(a!())`);
- adds a suggestion for `panic!(format!(..))` to remove `format!()` instead of adding `"{}", ` or using `panic_any` like it does now; and
- fixes the incorrect suggestion to replace `panic![123]` by `panic_any(123]`.

Fixes #82109.
Fixes #82110.
Fixes #82111.

Example output:
```
warning: panic message is not a string literal
 --> src/main.rs:8:12
  |
8 |     panic!(format!("error: {}", "oh no"));
  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: `#[warn(non_fmt_panic)]` on by default
  = note: this is no longer accepted in Rust 2021
  = note: the panic!() macro supports formatting, so there's no need for the format!() macro here
help: remove the `format!(..)` macro call
  |
8 |     panic!("error: {}", "oh no");
  |           --                  --

```

r? `@estebank`
2021-02-23 16:10:21 +01:00
..
assembly 32-bit ARM: Emit lr instead of r14 when specified as an asm! output register. 2021-02-14 23:41:10 -08:00
auxiliary
codegen Test CU directory is the work_dir 2021-02-20 15:56:36 +02:00
codegen-units
debuginfo Update tests for extern block linting 2021-01-13 07:49:16 -05:00
incremental Revert "Auto merge of #79637 - spastorino:revert-trait-inheritance-self, r=Mark-Simulacrum" 2021-02-05 18:56:56 -03:00
mir-opt New pass to deduplicate blocks 2021-02-21 21:51:54 +01:00
pretty Fix pretty printing of generic associated type constraints 2021-02-13 19:29:55 +00:00
run-make [libtest] Run the test synchronously when hitting thread limit 2021-02-17 21:38:25 +08:00
run-make-fulldeps Auto merge of #82102 - nagisa:nagisa/fix-dwo-name, r=davidtwco 2021-02-23 10:02:16 +00:00
run-pass-valgrind Update tests for extern block linting 2021-01-13 07:49:16 -05:00
rustdoc Rollup merge of #79423 - camelid:smart-punct, r=jyn514 2021-02-23 02:51:42 +01:00
rustdoc-gui Add rustdoc gui tests 2021-02-21 14:25:12 +01:00
rustdoc-js Add test for primitive search 2021-02-01 15:56:51 +01:00
rustdoc-js-std Add search index test for primitive types 2021-01-27 10:05:06 +01:00
rustdoc-json Add comment + move derive helper 2021-02-08 15:45:50 -05:00
rustdoc-ui [intra-doc links] Don't check feature gates of items re-exported across crates 2021-02-19 11:38:14 -05:00
rustfix
ui Rollup merge of #82113 - m-ou-se:panic-format-lint, r=estebank 2021-02-23 16:10:21 +01:00
ui-fulldeps Allow/fix non_fmt_panic in tests. 2021-02-03 23:15:45 +01:00
COMPILER_TESTS.md