rust/compiler/rustc_lint/src
bors d83da1d05d Auto merge of #88083 - m-ou-se:non-fmt-panics-suggest-debug, r=estebank
Improve non_fmt_panics suggestion based on trait impls.

This improves the non_fmt_panics lint suggestions by checking first which trait (Display or Debug) are actually implemented on the type.

Fixes https://github.com/rust-lang/rust/issues/87313

Fixes https://github.com/rust-lang/rust/issues/87999

Before:

```
help: add a "{}" format string to Display the message
  |
2 |     panic!("{}", Some(1));
  |            +++++
help: or use std::panic::panic_any instead
  |
2 |     std::panic::panic_any(Some(1));
  |     ~~~~~~~~~~~~~~~~~~~~~
```

After:

```
help: add a "{:?}" format string to use the Debug implementation of `Option<i32>`
  |
2 |     panic!("{:?}", Some(1));
  |            +++++++
help: or use std::panic::panic_any instead
  |
2 |     std::panic::panic_any(Some(1));
  |     ~~~~~~~~~~~~~~~~~~~~~
```

r? `@estebank`
2021-08-17 16:43:40 +00:00
..
nonstandard_style mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
array_into_iter.rs Link to edition guide instead of issues for 2021 lints. 2021-08-09 17:45:01 +02:00
builtin.rs Auto merge of #86492 - hyd-dev:no-mangle-method, r=petrochenkov 2021-08-13 19:47:03 +00:00
context.rs Fix lint capitalization and ignoring, test with include_str 2021-08-04 13:38:17 -04:00
early.rs Add additional missing lint handling logic 2021-07-17 23:03:58 -05:00
internal.rs Auto merge of #86827 - camsteffen:hash-lint-resolved, r=oli-obk 2021-07-13 15:06:10 +00:00
late.rs Add inferred args to typeck 2021-07-25 07:28:51 +00:00
levels.rs Auto merge of #87449 - matthiaskrgr:clippyy_v2, r=nagisa 2021-08-01 09:15:15 +00:00
lib.rs Uplift the invalid_atomic_ordering lint from clippy to rustc 2021-08-16 03:55:27 +00:00
methods.rs Fix doctest 2020-10-26 18:19:49 -04:00
non_ascii_idents.rs Stablize non_ascii_idents feature. 2021-04-08 02:52:00 +08:00
non_fmt_panic.rs Auto merge of #88083 - m-ou-se:non-fmt-panics-suggest-debug, r=estebank 2021-08-17 16:43:40 +00:00
nonstandard_style.rs Adjust #[no_mangle]-related checks and lints for impl items 2021-08-12 17:11:44 +08:00
noop_method_call.rs Warn in doc test 2021-03-03 11:23:33 +01:00
passes.rs Add inferred args to typeck 2021-07-25 07:28:51 +00:00
redundant_semicolon.rs Lint on redundant trailing semicolon after item 2020-12-29 16:30:02 -05:00
tests.rs Update to last upstream version 2021-07-08 17:14:28 +02:00
traits.rs move Constness into TraitPredicate 2021-08-13 09:26:33 +00:00
types.rs Auto merge of #84039 - jyn514:uplift-atomic-ordering, r=wesleywiser 2021-08-16 06:36:13 +00:00
unused.rs Introduce hir::ExprKind::Let - Take 2 2021-08-15 16:18:26 -03:00