1
Fork 0

Rollup merge of #111686 - cjgillot:no-foreign-item, r=compiler-errors

Retire is_foreign_item query.

This can be written in terms of `DefKind`. This does not deserve the cost of a query.
This commit is contained in:
Dylan DPC 2023-05-18 17:37:09 +05:30 committed by GitHub
commit ea6ac450e2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 7 additions and 20 deletions

View file

@ -73,7 +73,6 @@ pub fn provide(providers: &mut Providers) {
fn_sig,
impl_trait_ref,
impl_polarity,
is_foreign_item,
generator_kind,
collect_mod_item_types,
is_type_alias_impl_trait,
@ -1466,10 +1465,6 @@ fn compute_sig_of_foreign_fn_decl<'tcx>(
fty
}
fn is_foreign_item(tcx: TyCtxt<'_>, def_id: LocalDefId) -> bool {
matches!(tcx.hir().get_by_def_id(def_id), Node::ForeignItem(..))
}
fn generator_kind(tcx: TyCtxt<'_>, def_id: LocalDefId) -> Option<hir::GeneratorKind> {
match tcx.hir().get_by_def_id(def_id) {
Node::Expr(&rustc_hir::Expr {