diff options
author | Mukilan Thiyagarajan <mukilanthiagarajan@gmail.com> | 2023-01-31 20:48:41 +0530 |
---|---|---|
committer | Mukilan Thiyagarajan <mukilanthiagarajan@gmail.com> | 2023-02-01 19:38:06 +0530 |
commit | 5738a16dcb36da2b0d615e455885558d8dd5d107 (patch) | |
tree | bb955a74e60da9b2f72645020124f9bdde301f0c /components/script_plugins | |
parent | 4aac7e4d3c236a674e32ececa76a0026257964d9 (diff) | |
download | servo-5738a16dcb36da2b0d615e455885558d8dd5d107.tar.gz servo-5738a16dcb36da2b0d615e455885558d8dd5d107.zip |
Upgrade the Rust toolchain to 'nightly-2023-02-01'
Signed-off-by: Mukilan Thiyagarajan <mukilanthiagarajan@gmail.com>
Diffstat (limited to 'components/script_plugins')
-rw-r--r-- | components/script_plugins/lib.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/components/script_plugins/lib.rs b/components/script_plugins/lib.rs index b1e1844ad71..a2717dc1e44 100644 --- a/components/script_plugins/lib.rs +++ b/components/script_plugins/lib.rs @@ -24,10 +24,11 @@ use rustc_ast::ast::{AttrKind, Attribute}; use rustc_driver::plugin::Registry; use rustc_hir::def_id::DefId; use rustc_hir::intravisit as visit; -use rustc_hir::{self as hir, ExprKind, HirId}; +use rustc_hir::{self as hir, ExprKind}; use rustc_lint::{LateContext, LateLintPass, LintContext, LintPass}; use rustc_middle::ty; use rustc_session::declare_lint; +use rustc_span::def_id::LocalDefId; use rustc_span::source_map; use rustc_span::source_map::{ExpnKind, MacroKind, Span}; use rustc_span::symbol::sym; @@ -215,8 +216,8 @@ impl<'tcx> LateLintPass<'tcx> for UnrootedPass { } if let hir::ItemKind::Struct(def, ..) = &item.kind { for ref field in def.fields() { - let def_id = cx.tcx.hir().local_def_id(field.hir_id); - if is_unrooted_ty(&self.symbols, cx, cx.tcx.type_of(def_id), false) { + let field_type = cx.tcx.type_of(field.def_id); + if is_unrooted_ty(&self.symbols, cx, field_type, false) { cx.lint( UNROOTED_MUST_ROOT, "Type must be rooted, use #[unrooted_must_root_lint::must_root] \ @@ -238,8 +239,8 @@ impl<'tcx> LateLintPass<'tcx> for UnrootedPass { match var.data { hir::VariantData::Tuple(fields, ..) => { for field in fields { - let def_id = cx.tcx.hir().local_def_id(field.hir_id); - if is_unrooted_ty(&self.symbols, cx, cx.tcx.type_of(def_id), false) { + let field_type = cx.tcx.type_of(field.def_id); + if is_unrooted_ty(&self.symbols, cx, field_type, false) { cx.lint( UNROOTED_MUST_ROOT, "Type must be rooted, \ @@ -262,7 +263,7 @@ impl<'tcx> LateLintPass<'tcx> for UnrootedPass { decl: &'tcx hir::FnDecl, body: &'tcx hir::Body, span: source_map::Span, - id: HirId, + def_id: LocalDefId, ) { let in_new_function = match kind { visit::FnKind::ItemFn(n, _, _) | visit::FnKind::Method(n, _) => { @@ -272,7 +273,6 @@ impl<'tcx> LateLintPass<'tcx> for UnrootedPass { }; if !in_derive_expn(span) { - let def_id = cx.tcx.hir().local_def_id(id); let sig = cx.tcx.type_of(def_id).fn_sig(cx.tcx); for (arg, ty) in decl.inputs.iter().zip(sig.inputs().skip_binder().iter()) { |