]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_hir_analysis/src/check_unused.rs
Auto merge of #107443 - cjgillot:generator-less-query, r=compiler-errors
[rust.git] / compiler / rustc_hir_analysis / src / check_unused.rs
index ebb78213a63a13dd052f0b3b4e7c48f5c5acc451..5716be4f1a95445c5f4db941b7c89123f440c13b 100644 (file)
@@ -29,7 +29,7 @@ pub fn check_crate(tcx: TyCtxt<'_>) {
         if item.span.is_dummy() {
             continue;
         }
-        let hir::ItemKind::Use(path, _) = item.kind else { unreachable!() };
+        let (path, _) = item.expect_use();
         let msg = if let Ok(snippet) = tcx.sess.source_map().span_to_snippet(path.span) {
             format!("unused import: `{}`", snippet)
         } else {