File tree 2 files changed +2
-2
lines changed
compiler/rustc_hir_analysis/src
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>(
1504
1504
let _: Option < _ > = try {
1505
1505
let impl_m = impl_m. def_id . as_local ( ) ?;
1506
1506
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 ( ) ;
1508
1508
let input_tys = sig. decl . inputs ;
1509
1509
1510
1510
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<'_>) {
29
29
if item. span . is_dummy ( ) {
30
30
continue ;
31
31
}
32
- let hir :: ItemKind :: Use ( path, _) = item. kind else { unreachable ! ( ) } ;
32
+ let ( path, _) = item. expect_use ( ) ;
33
33
let msg = if let Ok ( snippet) = tcx. sess . source_map ( ) . span_to_snippet ( path. span ) {
34
34
format ! ( "unused import: `{}`" , snippet)
35
35
} else {
You can’t perform that action at this time.
0 commit comments