Commit graph

12 commits

Author SHA1 Message Date
Albert Larsan
cf2dff2b1e
Move /src/test to /tests 2023-01-11 09:32:08 +00:00
Loïc BRANSTETT
a4b93eb188 Take in account the unreachable! macro in the non_fmt_panic lint 2022-01-31 17:09:31 +01:00
Mara Bos
86bc236a4c Add more assert!() tests for non_fmt_panics. 2021-08-16 17:35:49 +02:00
Mara Bos
82d530577b Add tests for non_fmt_panics in generic functions. 2021-08-16 17:33:42 +02:00
Mara Bos
00ca4d0dd3 Update non_fmt_panics test. 2021-08-16 17:26:08 +02:00
Mara Bos
5ad41069e6 Update non-fmt-panic tests. 2021-08-13 12:20:14 +02:00
Mara Bos
a6da55c70e Silence non_fmt_panic from external macros. 2021-08-12 14:33:30 +02:00
Paul Trojahn
8f14592aa2 Improve "panic message is not a string literal" warning
This warning always referenced panic! even in case of an
assert. Related to #84656
2021-05-09 17:56:50 +02:00
Mara Bos
8ad12bb9b2 Add ui tests for panic![123] and panic!{123}. 2021-02-14 19:44:57 +01:00
Mara Bos
9f97a0b364 Add test for panic!(format!(..)) lint. 2021-02-14 18:53:10 +01:00
Mara Bos
1abc1e2a43 Add test for non_fmt_panic lint for panic!(some_macro!()). 2021-02-14 18:17:34 +01:00
Mara Bos
a616f8267e 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.
2021-02-03 22:42:53 +01:00
Renamed from src/test/ui/panic-brace.rs (Browse further)