diff --git a/clippy_lints/src/redundant_clone.rs b/clippy_lints/src/redundant_clone.rs index 386881368f3..8ad8e45a2db 100644 --- a/clippy_lints/src/redundant_clone.rs +++ b/clippy_lints/src/redundant_clone.rs @@ -209,11 +209,11 @@ fn check_fn( if !used_later { let span = terminator.source_info.span; let scope = terminator.source_info.scope; - let node = if let mir::ClearCrossCrate::Set(scope_local_data) = &mir.source_scopes[scope].local_data { - scope_local_data.lint_root - } else { - unreachable!() - }; + let node = mir.source_scopes[scope] + .local_data + .as_ref() + .assert_crate_local() + .lint_root; if_chain! { if let Some(snip) = snippet_opt(cx, span);