From b26f14c5a4944fe9124b1c766ad2ec6ee21fd8bd Mon Sep 17 00:00:00 2001 From: BD103 <59022059+BD103@users.noreply.github.com> Date: Sun, 6 Oct 2024 23:14:09 -0400 Subject: [PATCH] chore: replace `lower_ty()` with `typeck_results.node_type()` --- bevy_lint/src/lib.rs | 1 - bevy_lint/src/lints/insert_event_resource.rs | 5 +---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/bevy_lint/src/lib.rs b/bevy_lint/src/lib.rs index fa4a19f9..42c76e1e 100644 --- a/bevy_lint/src/lib.rs +++ b/bevy_lint/src/lib.rs @@ -8,7 +8,6 @@ extern crate rustc_driver; extern crate rustc_errors; extern crate rustc_hir; -extern crate rustc_hir_analysis; extern crate rustc_interface; extern crate rustc_lint; extern crate rustc_middle; diff --git a/bevy_lint/src/lints/insert_event_resource.rs b/bevy_lint/src/lints/insert_event_resource.rs index 603d1ea0..d94abaa9 100644 --- a/bevy_lint/src/lints/insert_event_resource.rs +++ b/bevy_lint/src/lints/insert_event_resource.rs @@ -41,7 +41,6 @@ use clippy_utils::{ }; use rustc_errors::Applicability; use rustc_hir::{Expr, ExprKind, GenericArg, GenericArgs, Path, PathSegment, QPath}; -use rustc_hir_analysis::lower_ty; use rustc_lint::{LateContext, LateLintPass}; use rustc_middle::ty::{Ty, TyKind}; use rustc_session::declare_lint_pass; @@ -153,9 +152,7 @@ fn check_init_resource<'tcx>(cx: &LateContext<'tcx>, path: &PathSegment<'tcx>, m { // Lower `rustc_hir::Ty` to `ty::Ty`, so we can inspect type information. For more // information, see . - // Note that `lower_ty()` is quasi-deprecated, and should be removed if a adequate - // replacement is found. - let resource_ty = lower_ty(cx.tcx, resource_hir_ty); + let resource_ty = cx.typeck_results().node_type(resource_hir_ty.hir_id); // If the resource type is `Events`, emit the lint. if match_type(cx, resource_ty, &crate::paths::EVENTS) {