Skip to content

Commit 984ab98

Browse files
committed
added core::panicking::assert_failed_inner as panicking
1 parent 86fb0e8 commit 984ab98

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

clippy_utils/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1172,6 +1172,7 @@ pub fn match_panic_call<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) -> O
11721172
.or_else(|| match_function_call(cx, expr, &paths::PANICKING_PANIC))
11731173
.or_else(|| match_function_call(cx, expr, &paths::PANICKING_PANIC_FMT))
11741174
.or_else(|| match_function_call(cx, expr, &paths::PANICKING_PANIC_STR))
1175+
.or_else(|| match_function_call(cx, expr, &paths::PANICKING_ASSERT_FAILED_INNER))
11751176
}
11761177

11771178
pub fn match_panic_def_id(cx: &LateContext<'_>, did: DefId) -> bool {
@@ -1181,6 +1182,7 @@ pub fn match_panic_def_id(cx: &LateContext<'_>, did: DefId) -> bool {
11811182
|| match_def_path(cx, did, &paths::PANICKING_PANIC)
11821183
|| match_def_path(cx, did, &paths::PANICKING_PANIC_FMT)
11831184
|| match_def_path(cx, did, &paths::PANICKING_PANIC_STR)
1185+
|| match_def_path(cx, did, &paths::PANICKING_ASSERT_FAILED_INNER)
11841186
}
11851187

11861188
/// Returns the list of condition expressions and the list of blocks in a

clippy_utils/src/paths.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ pub const OPTION_SOME: [&str; 4] = ["core", "option", "Option", "Some"];
8686
pub const ORD: [&str; 3] = ["core", "cmp", "Ord"];
8787
pub const OS_STRING_AS_OS_STR: [&str; 5] = ["std", "ffi", "os_str", "OsString", "as_os_str"];
8888
pub const OS_STR_TO_OS_STRING: [&str; 5] = ["std", "ffi", "os_str", "OsStr", "to_os_string"];
89+
pub(super) const PANICKING_ASSERT_FAILED_INNER: [&str; 3] = ["core", "panicking", "assert_failed_inner"];
8990
pub(super) const PANICKING_PANIC: [&str; 3] = ["core", "panicking", "panic"];
9091
pub(super) const PANICKING_PANIC_FMT: [&str; 3] = ["core", "panicking", "panic_fmt"];
9192
pub(super) const PANICKING_PANIC_STR: [&str; 3] = ["core", "panicking", "panic_str"];

0 commit comments

Comments
 (0)