Skip to content

Commit 2f81e4e

Browse files
committed
modification not working: fixing
1 parent 984ab98 commit 2f81e4e

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

clippy_lints/src/doc.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -721,6 +721,11 @@ impl<'a, 'tcx> Visitor<'tcx> for FindPanicUnwrap<'a, 'tcx> {
721721
}
722722
}
723723

724+
// check for `assert_eq` or `assert_ne`
725+
if is_expn_of(expr.span, "assert_eq").is_some() || is_expn_of(expr.span, "assert_ne").is_some() {
726+
self.panic_span = Some(expr.span);
727+
}
728+
724729
// check for `unwrap`
725730
if let Some(arglists) = method_chain_args(expr, &["unwrap"]) {
726731
let reciever_ty = self.typeck_results.expr_ty(&arglists[0][0]).peel_refs();

clippy_utils/src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1172,7 +1172,6 @@ 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))
11761175
}
11771176

11781177
pub fn match_panic_def_id(cx: &LateContext<'_>, did: DefId) -> bool {
@@ -1182,7 +1181,6 @@ pub fn match_panic_def_id(cx: &LateContext<'_>, did: DefId) -> bool {
11821181
|| match_def_path(cx, did, &paths::PANICKING_PANIC)
11831182
|| match_def_path(cx, did, &paths::PANICKING_PANIC_FMT)
11841183
|| match_def_path(cx, did, &paths::PANICKING_PANIC_STR)
1185-
|| match_def_path(cx, did, &paths::PANICKING_ASSERT_FAILED_INNER)
11861184
}
11871185

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

clippy_utils/src/paths.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ 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"];
9089
pub(super) const PANICKING_PANIC: [&str; 3] = ["core", "panicking", "panic"];
9190
pub(super) const PANICKING_PANIC_FMT: [&str; 3] = ["core", "panicking", "panic_fmt"];
9291
pub(super) const PANICKING_PANIC_STR: [&str; 3] = ["core", "panicking", "panic_str"];

0 commit comments

Comments
 (0)