Rollup merge of #107125 - WaffleLapkin:expect_an_item_in_your_hir_by_the_next_morning, r=Nilstrieb
Add and use expect methods to hir. [The future has come](https://github.com/rust-lang/rust/pull/106090/files#r1070062462). r? `@Nilstrieb` tbh I'm not even sure if it's worth it
This commit is contained in:
commit
4ac1796267
8 changed files with 378 additions and 25 deletions
|
@ -56,7 +56,7 @@ fn visit_implementation_of_drop(tcx: TyCtxt<'_>, impl_did: LocalDefId) {
|
|||
_ => {}
|
||||
}
|
||||
|
||||
let ItemKind::Impl(impl_) = tcx.hir().expect_item(impl_did).kind else { bug!("expected Drop impl item") };
|
||||
let impl_ = tcx.hir().expect_item(impl_did).expect_impl();
|
||||
|
||||
tcx.sess.emit_err(DropImplOnWrongItem { span: impl_.self_ty.span });
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue