File tree Expand file tree Collapse file tree 2 files changed +2
-2
lines changed
compiler/rustc_hir_analysis/src Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -1504,7 +1504,7 @@ fn compare_synthetic_generics<'tcx>(
15041504 let _: Option < _ > = try {
15051505 let impl_m = impl_m. def_id . as_local ( ) ?;
15061506 let impl_m = tcx. hir ( ) . expect_impl_item ( impl_m) ;
1507- let hir :: ImplItemKind :: Fn ( sig, _) = & impl_m. kind else { unreachable ! ( ) } ;
1507+ let ( sig, _) = impl_m. expect_fn ( ) ;
15081508 let input_tys = sig. decl . inputs ;
15091509
15101510 struct Visitor ( Option < Span > , hir:: def_id:: LocalDefId ) ;
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ pub fn check_crate(tcx: TyCtxt<'_>) {
2929 if item. span . is_dummy ( ) {
3030 continue ;
3131 }
32- let hir :: ItemKind :: Use ( path, _) = item. kind else { unreachable ! ( ) } ;
32+ let ( path, _) = item. expect_use ( ) ;
3333 let msg = if let Ok ( snippet) = tcx. sess . source_map ( ) . span_to_snippet ( path. span ) {
3434 format ! ( "unused import: `{}`" , snippet)
3535 } else {
You can’t perform that action at this time.
0 commit comments