diff --git a/gcc/rust/checks/errors/borrowck/rust-bir-builder-internal.h b/gcc/rust/checks/errors/borrowck/rust-bir-builder-internal.h index e2cc2ddb0d87..10367a93238d 100644 --- a/gcc/rust/checks/errors/borrowck/rust-bir-builder-internal.h +++ b/gcc/rust/checks/errors/borrowck/rust-bir-builder-internal.h @@ -75,7 +75,6 @@ struct BuilderContext // External context. Resolver::TypeCheckContext &tyctx; - Resolver::Resolver &resolver; // BIR output BasicBlocks basic_blocks; @@ -102,9 +101,7 @@ struct BuilderContext FreeRegions fn_free_regions{{}}; public: - BuilderContext () - : tyctx (*Resolver::TypeCheckContext::get ()), - resolver (*Resolver::Resolver::get ()) + BuilderContext () : tyctx (*Resolver::TypeCheckContext::get ()) { basic_blocks.emplace_back (); // StartBB } @@ -403,69 +400,43 @@ class AbstractBuilder template NodeId resolve_label (T &expr) { - NodeId resolved_label; - if (flag_name_resolution_2_0) - { - auto &nr_ctx - = Resolver2_0::ImmutableNameResolutionContext::get ().resolver (); - auto res = nr_ctx.lookup (expr.get_mappings ().get_nodeid ()); - rust_assert (res.has_value ()); - resolved_label = res.value (); - } - else - { - bool ok = ctx.resolver.lookup_resolved_label ( - expr.get_mappings ().get_nodeid (), &resolved_label); - rust_assert (ok); - } - return resolved_label; + auto &nr_ctx + = Resolver2_0::ImmutableNameResolutionContext::get ().resolver (); + + auto res = nr_ctx.lookup (expr.get_mappings ().get_nodeid ()); + rust_assert (res.has_value ()); + + return *res; } template PlaceId resolve_variable (T &variable) { - NodeId variable_id; - if (flag_name_resolution_2_0) - { - auto &nr_ctx - = Resolver2_0::ImmutableNameResolutionContext::get ().resolver (); - auto res = nr_ctx.lookup (variable.get_mappings ().get_nodeid ()); - rust_assert (res.has_value ()); - variable_id = res.value (); - } - else - { - bool ok = ctx.resolver.lookup_resolved_name ( - variable.get_mappings ().get_nodeid (), &variable_id); - rust_assert (ok); - } - return ctx.place_db.lookup_variable (variable_id); + auto &nr_ctx + = Resolver2_0::ImmutableNameResolutionContext::get ().resolver (); + + auto res = nr_ctx.lookup (variable.get_mappings ().get_nodeid ()); + rust_assert (res.has_value ()); + + return ctx.place_db.lookup_variable (*res); } template PlaceId resolve_variable_or_fn (T &variable, TyTy::BaseType *ty) { ty = (ty) ? ty : lookup_type (variable); + // Unlike variables, // functions do not have to be declared in PlaceDB before use. - NodeId variable_id; - if (flag_name_resolution_2_0) - { - auto &nr_ctx - = Resolver2_0::ImmutableNameResolutionContext::get ().resolver (); - auto res = nr_ctx.lookup (variable.get_mappings ().get_nodeid ()); - rust_assert (res.has_value ()); - variable_id = res.value (); - } - else - { - bool ok = ctx.resolver.lookup_resolved_name ( - variable.get_mappings ().get_nodeid (), &variable_id); - rust_assert (ok); - } if (ty->is ()) return ctx.place_db.get_constant (ty); - else - return ctx.place_db.lookup_or_add_variable (variable_id, ty); + + auto &nr_ctx + = Resolver2_0::ImmutableNameResolutionContext::get ().resolver (); + + auto res = nr_ctx.lookup (variable.get_mappings ().get_nodeid ()); + rust_assert (res.has_value ()); + + return ctx.place_db.lookup_or_add_variable (*res, ty); } protected: // Implicit conversions. diff --git a/gcc/rust/checks/errors/privacy/rust-privacy-check.cc b/gcc/rust/checks/errors/privacy/rust-privacy-check.cc index 5291276a7a37..3b94cbf3f1b5 100644 --- a/gcc/rust/checks/errors/privacy/rust-privacy-check.cc +++ b/gcc/rust/checks/errors/privacy/rust-privacy-check.cc @@ -35,12 +35,11 @@ Resolver::resolve (HIR::Crate &crate) { PrivacyContext ctx; auto &mappings = Analysis::Mappings::get (); - auto resolver = Rust::Resolver::Resolver::get (); auto ty_ctx = ::Rust::Resolver::TypeCheckContext::get (); - VisibilityResolver (mappings, *resolver).go (crate); + VisibilityResolver (mappings).go (crate); PubRestrictedVisitor (mappings).go (crate); - PrivacyReporter (mappings, *resolver, *ty_ctx).go (crate); + PrivacyReporter (mappings, *ty_ctx).go (crate); auto visitor = ReachabilityVisitor (ctx, *ty_ctx); diff --git a/gcc/rust/checks/errors/privacy/rust-privacy-reporter.cc b/gcc/rust/checks/errors/privacy/rust-privacy-reporter.cc index 4af9639c38ff..1d7352f4f86d 100644 --- a/gcc/rust/checks/errors/privacy/rust-privacy-reporter.cc +++ b/gcc/rust/checks/errors/privacy/rust-privacy-reporter.cc @@ -28,10 +28,8 @@ namespace Rust { namespace Privacy { PrivacyReporter::PrivacyReporter ( - Analysis::Mappings &mappings, Resolver::Resolver &resolver, - const Rust::Resolver::TypeCheckContext &ty_ctx) - : mappings (mappings), resolver (resolver), ty_ctx (ty_ctx), - current_module (tl::nullopt) + Analysis::Mappings &mappings, const Rust::Resolver::TypeCheckContext &ty_ctx) + : mappings (mappings), ty_ctx (ty_ctx), current_module (tl::nullopt) {} // Find a proc_macro, proc_macro_derive or proc_macro_attribute @@ -94,30 +92,10 @@ static bool is_child_module (Analysis::Mappings &mappings, NodeId parent, NodeId possible_child) { - if (flag_name_resolution_2_0) - { - auto &nr_ctx - = Resolver2_0::ImmutableNameResolutionContext::get ().resolver (); - - return nr_ctx.values.is_module_descendant (parent, possible_child); - } - - auto children = mappings.lookup_module_children (parent); - - if (!children) - return false; + auto &nr_ctx + = Resolver2_0::ImmutableNameResolutionContext::get ().resolver (); - // Visit all toplevel children - for (auto &child : *children) - if (child == possible_child) - return true; - - // Now descend recursively in the child module tree - for (auto &child : *children) - if (is_child_module (mappings, child, possible_child)) - return true; - - return false; + return nr_ctx.values.is_module_descendant (parent, possible_child); } // FIXME: This function needs a lot of refactoring @@ -127,17 +105,11 @@ PrivacyReporter::check_for_privacy_violation (const NodeId &use_id, { NodeId ref_node_id = UNKNOWN_NODEID; - if (flag_name_resolution_2_0) - { - auto &nr_ctx - = Resolver2_0::ImmutableNameResolutionContext::get ().resolver (); + auto &nr_ctx + = Resolver2_0::ImmutableNameResolutionContext::get ().resolver (); - if (auto id = nr_ctx.lookup (use_id)) - ref_node_id = *id; - } - // FIXME: Don't assert here - we might be dealing with a type - else if (!resolver.lookup_resolved_name (use_id, &ref_node_id)) - resolver.lookup_resolved_type (use_id, &ref_node_id); + if (auto id = nr_ctx.lookup (use_id)) + ref_node_id = *id; // FIXME: Assert here. For now, we return since this causes issues when // checking inferred types (#1260) diff --git a/gcc/rust/checks/errors/privacy/rust-privacy-reporter.h b/gcc/rust/checks/errors/privacy/rust-privacy-reporter.h index 72716a6aa8a3..cc48f9ada0ea 100644 --- a/gcc/rust/checks/errors/privacy/rust-privacy-reporter.h +++ b/gcc/rust/checks/errors/privacy/rust-privacy-reporter.h @@ -38,7 +38,6 @@ class PrivacyReporter : public HIR::HIRExpressionVisitor, { public: PrivacyReporter (Analysis::Mappings &mappings, - Rust::Resolver::Resolver &resolver, const Rust::Resolver::TypeCheckContext &ty_ctx); /** @@ -157,7 +156,6 @@ types virtual void visit (HIR::ExprStmt &stmt); Analysis::Mappings &mappings; - Rust::Resolver::Resolver &resolver; const Rust::Resolver::TypeCheckContext &ty_ctx; // `None` means we're in the root module - the crate diff --git a/gcc/rust/checks/errors/privacy/rust-visibility-resolver.cc b/gcc/rust/checks/errors/privacy/rust-visibility-resolver.cc index c59763d73782..dfaed1b340d4 100644 --- a/gcc/rust/checks/errors/privacy/rust-visibility-resolver.cc +++ b/gcc/rust/checks/errors/privacy/rust-visibility-resolver.cc @@ -22,15 +22,11 @@ #include "rust-hir-item.h" #include "rust-immutable-name-resolution-context.h" -// for flag_name_resolution_2_0 -#include "options.h" - namespace Rust { namespace Privacy { -VisibilityResolver::VisibilityResolver (Analysis::Mappings &mappings, - Resolver::Resolver &resolver) - : mappings (mappings), resolver (resolver) +VisibilityResolver::VisibilityResolver (Analysis::Mappings &mappings) + : mappings (mappings) {} void @@ -64,27 +60,20 @@ VisibilityResolver::resolve_module_path (const HIR::SimplePath &restriction, = Error (restriction.get_locus (), "cannot use non-module path as privacy restrictor"); - NodeId ref_node_id = UNKNOWN_NODEID; - if (flag_name_resolution_2_0) - { - auto &nr_ctx - = Resolver2_0::ImmutableNameResolutionContext::get ().resolver (); + auto &nr_ctx + = Resolver2_0::ImmutableNameResolutionContext::get ().resolver (); - if (auto id = nr_ctx.lookup (ast_node_id)) - { - ref_node_id = *id; - } - else - { - invalid_path.emit (); - return false; - } + NodeId ref_node_id; + if (auto id = nr_ctx.lookup (ast_node_id)) + { + ref_node_id = *id; } - else if (!resolver.lookup_resolved_name (ast_node_id, &ref_node_id)) + else { invalid_path.emit (); return false; } + // FIXME: Add a hint here if we can find the path in another scope, such as // a type or something else // TODO: For the hint, can we point to the original item's definition if diff --git a/gcc/rust/checks/errors/privacy/rust-visibility-resolver.h b/gcc/rust/checks/errors/privacy/rust-visibility-resolver.h index 4dfba4cb86b4..4252b2853300 100644 --- a/gcc/rust/checks/errors/privacy/rust-visibility-resolver.h +++ b/gcc/rust/checks/errors/privacy/rust-visibility-resolver.h @@ -33,8 +33,7 @@ namespace Privacy { class VisibilityResolver : public HIR::HIRVisItemVisitor { public: - VisibilityResolver (Analysis::Mappings &mappings, - Rust::Resolver::Resolver &resolver); + VisibilityResolver (Analysis::Mappings &mappings); /** * Perform visibility resolving on an entire crate @@ -93,7 +92,6 @@ class VisibilityResolver : public HIR::HIRVisItemVisitor private: Analysis::Mappings &mappings; - Rust::Resolver::Resolver &resolver; DefId current_module; }; diff --git a/gcc/rust/checks/errors/rust-const-checker.cc b/gcc/rust/checks/errors/rust-const-checker.cc index 845e5b68187f..1e58d9139eea 100644 --- a/gcc/rust/checks/errors/rust-const-checker.cc +++ b/gcc/rust/checks/errors/rust-const-checker.cc @@ -24,16 +24,10 @@ #include "rust-system.h" #include "rust-immutable-name-resolution-context.h" -// for flag_name_resolution_2_0 -#include "options.h" - namespace Rust { namespace HIR { -ConstChecker::ConstChecker () - : resolver (*Resolver::Resolver::get ()), - mappings (Analysis::Mappings::get ()) -{} +ConstChecker::ConstChecker () : mappings (Analysis::Mappings::get ()) {} void ConstChecker::go (HIR::Crate &crate) @@ -358,18 +352,12 @@ ConstChecker::visit (CallExpr &expr) NodeId ast_node_id = expr.get_fnexpr ().get_mappings ().get_nodeid (); NodeId ref_node_id; - if (flag_name_resolution_2_0) - { - auto &nr_ctx - = Resolver2_0::ImmutableNameResolutionContext::get ().resolver (); + auto &nr_ctx + = Resolver2_0::ImmutableNameResolutionContext::get ().resolver (); - if (auto id = nr_ctx.lookup (ast_node_id)) - ref_node_id = *id; - else - return; - } - // We don't care about types here - else if (!resolver.lookup_resolved_name (ast_node_id, &ref_node_id)) + if (auto id = nr_ctx.lookup (ast_node_id)) + ref_node_id = *id; + else return; if (auto definition_id = mappings.lookup_node_to_hir (ref_node_id)) diff --git a/gcc/rust/checks/errors/rust-const-checker.h b/gcc/rust/checks/errors/rust-const-checker.h index 66138bdc851a..0514fecddb3f 100644 --- a/gcc/rust/checks/errors/rust-const-checker.h +++ b/gcc/rust/checks/errors/rust-const-checker.h @@ -72,7 +72,6 @@ class ConstChecker : public HIRFullVisitor std::vector> ¶m, ConstGenericCtx context); StackedContexts const_context; - Resolver::Resolver &resolver; Analysis::Mappings &mappings; virtual void visit (Lifetime &lifetime) override; diff --git a/gcc/rust/checks/errors/rust-hir-pattern-analysis.cc b/gcc/rust/checks/errors/rust-hir-pattern-analysis.cc index 7fe7f029f2aa..90b05e25480b 100644 --- a/gcc/rust/checks/errors/rust-hir-pattern-analysis.cc +++ b/gcc/rust/checks/errors/rust-hir-pattern-analysis.cc @@ -28,15 +28,11 @@ #include "rust-tyty.h" #include "rust-immutable-name-resolution-context.h" -// for flag_name_resolution_2_0 -#include "options.h" - namespace Rust { namespace Analysis { PatternChecker::PatternChecker () : tyctx (*Resolver::TypeCheckContext::get ()), - resolver (*Resolver::Resolver::get ()), mappings (Analysis::Mappings::get ()) {} @@ -238,17 +234,13 @@ PatternChecker::visit (CallExpr &expr) NodeId ast_node_id = expr.get_fnexpr ().get_mappings ().get_nodeid (); NodeId ref_node_id; - if (flag_name_resolution_2_0) - { - auto &nr_ctx - = Resolver2_0::ImmutableNameResolutionContext::get ().resolver (); - if (auto id = nr_ctx.lookup (ast_node_id)) - ref_node_id = *id; - else - return; - } - else if (!resolver.lookup_resolved_name (ast_node_id, &ref_node_id)) + auto &nr_ctx + = Resolver2_0::ImmutableNameResolutionContext::get ().resolver (); + + if (auto id = nr_ctx.lookup (ast_node_id)) + ref_node_id = *id; + else return; if (auto definition_id = mappings.lookup_node_to_hir (ref_node_id)) diff --git a/gcc/rust/checks/errors/rust-hir-pattern-analysis.h b/gcc/rust/checks/errors/rust-hir-pattern-analysis.h index 6aefaeca63fc..a73c5a33b0e0 100644 --- a/gcc/rust/checks/errors/rust-hir-pattern-analysis.h +++ b/gcc/rust/checks/errors/rust-hir-pattern-analysis.h @@ -46,7 +46,6 @@ class PatternChecker : public HIR::HIRFullVisitor private: Resolver::TypeCheckContext &tyctx; - Resolver::Resolver &resolver; Analysis::Mappings &mappings; virtual void visit (Lifetime &lifetime) override; diff --git a/gcc/rust/checks/errors/rust-readonly-check2.cc b/gcc/rust/checks/errors/rust-readonly-check2.cc index 9ff09a96702a..2884a90adec2 100644 --- a/gcc/rust/checks/errors/rust-readonly-check2.cc +++ b/gcc/rust/checks/errors/rust-readonly-check2.cc @@ -33,8 +33,7 @@ namespace HIR { static std::set already_assigned_variables = {}; ReadonlyChecker::ReadonlyChecker () - : resolver (*Resolver::Resolver::get ()), - mappings (Analysis::Mappings::get ()), + : mappings (Analysis::Mappings::get ()), context (*Resolver::TypeCheckContext::get ()) {} diff --git a/gcc/rust/checks/errors/rust-readonly-check2.h b/gcc/rust/checks/errors/rust-readonly-check2.h index 06af9dbd17c7..2a981aea8e4d 100644 --- a/gcc/rust/checks/errors/rust-readonly-check2.h +++ b/gcc/rust/checks/errors/rust-readonly-check2.h @@ -38,7 +38,6 @@ class ReadonlyChecker : public DefaultHIRVisitor decrement, }; - Resolver::Resolver &resolver; Analysis::Mappings &mappings; Resolver::TypeCheckContext &context; StackedContexts mutable_context; diff --git a/gcc/rust/checks/errors/rust-unsafe-checker.cc b/gcc/rust/checks/errors/rust-unsafe-checker.cc index 41ed698db778..c1390295a2eb 100644 --- a/gcc/rust/checks/errors/rust-unsafe-checker.cc +++ b/gcc/rust/checks/errors/rust-unsafe-checker.cc @@ -25,15 +25,11 @@ #include "rust-system.h" #include "rust-immutable-name-resolution-context.h" -// for flag_name_resolution_2_0 -#include "options.h" - namespace Rust { namespace HIR { UnsafeChecker::UnsafeChecker () : context (*Resolver::TypeCheckContext::get ()), - resolver (*Resolver::Resolver::get ()), mappings (Analysis::Mappings::get ()) {} @@ -220,23 +216,15 @@ UnsafeChecker::visit (PathInExpression &path) NodeId ast_node_id = path.get_mappings ().get_nodeid (); NodeId ref_node_id; - if (flag_name_resolution_2_0) - { - auto &nr_ctx - = Resolver2_0::ImmutableNameResolutionContext::get ().resolver (); + auto &nr_ctx + = Resolver2_0::ImmutableNameResolutionContext::get ().resolver (); - auto resolved = nr_ctx.lookup (ast_node_id); + auto resolved = nr_ctx.lookup (ast_node_id); - if (!resolved.has_value ()) - return; + if (!resolved.has_value ()) + return; - ref_node_id = resolved.value (); - } - else - { - if (!resolver.lookup_resolved_name (ast_node_id, &ref_node_id)) - return; - } + ref_node_id = resolved.value (); if (auto definition_id = mappings.lookup_node_to_hir (ref_node_id)) { @@ -434,26 +422,15 @@ UnsafeChecker::visit (CallExpr &expr) NodeId ast_node_id = expr.get_fnexpr ().get_mappings ().get_nodeid (); NodeId ref_node_id; - // There are no unsafe types, and functions are defined in the name resolver. - // If we can't find the name, then we're dealing with a type and should return - // early. - if (flag_name_resolution_2_0) - { - auto &nr_ctx - = Resolver2_0::ImmutableNameResolutionContext::get ().resolver (); + auto &nr_ctx + = Resolver2_0::ImmutableNameResolutionContext::get ().resolver (); - auto resolved = nr_ctx.lookup (ast_node_id); + auto resolved = nr_ctx.lookup (ast_node_id); - if (!resolved.has_value ()) - return; + if (!resolved.has_value ()) + return; - ref_node_id = resolved.value (); - } - else - { - if (!resolver.lookup_resolved_name (ast_node_id, &ref_node_id)) - return; - } + ref_node_id = resolved.value (); if (auto definition_id = mappings.lookup_node_to_hir (ref_node_id)) { diff --git a/gcc/rust/checks/errors/rust-unsafe-checker.h b/gcc/rust/checks/errors/rust-unsafe-checker.h index 4c884ad6b047..d18f9ec3714b 100644 --- a/gcc/rust/checks/errors/rust-unsafe-checker.h +++ b/gcc/rust/checks/errors/rust-unsafe-checker.h @@ -54,7 +54,6 @@ class UnsafeChecker : public HIRFullVisitor StackedContexts unsafe_context; Resolver::TypeCheckContext &context; - Resolver::Resolver &resolver; Analysis::Mappings &mappings; virtual void visit (Lifetime &lifetime) override; diff --git a/gcc/rust/checks/lints/rust-lint-marklive.cc b/gcc/rust/checks/lints/rust-lint-marklive.cc index af7535a9826e..80c30e0c3430 100644 --- a/gcc/rust/checks/lints/rust-lint-marklive.cc +++ b/gcc/rust/checks/lints/rust-lint-marklive.cc @@ -163,21 +163,14 @@ MarkLive::visit_path_segment (HIR::PathExprSegment seg) // // We should mark them alive all and ignoring other kind of segments. // If the segment we dont care then just return false is fine - if (flag_name_resolution_2_0) - { - auto &nr_ctx - = Resolver2_0::ImmutableNameResolutionContext::get ().resolver (); + auto &nr_ctx + = Resolver2_0::ImmutableNameResolutionContext::get ().resolver (); + + if (auto id = nr_ctx.lookup (ast_node_id)) + ref_node_id = *id; + else + return false; - if (auto id = nr_ctx.lookup (ast_node_id)) - ref_node_id = *id; - else - return false; - } - else if (!resolver->lookup_resolved_name (ast_node_id, &ref_node_id)) - { - if (!resolver->lookup_resolved_type (ast_node_id, &ref_node_id)) - return false; - } if (auto hid = mappings.lookup_node_to_hir (ref_node_id)) { mark_hir_id (*hid); @@ -250,21 +243,13 @@ MarkLive::visit (HIR::TupleIndexExpr &expr) void MarkLive::visit (HIR::TypeAlias &alias) { - NodeId ast_node_id = UNKNOWN_NODEID; - if (flag_name_resolution_2_0) - { - auto &nr_ctx - = Resolver2_0::ImmutableNameResolutionContext::get ().resolver (); + auto &nr_ctx + = Resolver2_0::ImmutableNameResolutionContext::get ().resolver (); - if (auto id = nr_ctx.lookup ( - alias.get_type_aliased ().get_mappings ().get_nodeid ())) - ast_node_id = *id; - } - else - { - resolver->lookup_resolved_type ( - alias.get_type_aliased ().get_mappings ().get_nodeid (), &ast_node_id); - } + NodeId ast_node_id = UNKNOWN_NODEID; + if (auto id + = nr_ctx.lookup (alias.get_type_aliased ().get_mappings ().get_nodeid ())) + ast_node_id = *id; if (auto hid = mappings.lookup_node_to_hir (ast_node_id)) mark_hir_id (*hid); @@ -285,27 +270,13 @@ MarkLive::mark_hir_id (HirId id) void MarkLive::find_ref_node_id (NodeId ast_node_id, NodeId &ref_node_id) { - if (flag_name_resolution_2_0) - { - auto &nr_ctx - = Resolver2_0::ImmutableNameResolutionContext::get ().resolver (); + auto &nr_ctx + = Resolver2_0::ImmutableNameResolutionContext::get ().resolver (); - nr_ctx.lookup (ast_node_id).map ([&ref_node_id] (NodeId resolved) { - ref_node_id = resolved; - }); - } + if (auto res = nr_ctx.lookup (ast_node_id)) + ref_node_id = *res; else - { - if (!resolver->lookup_resolved_name (ast_node_id, &ref_node_id)) - { - if (!resolver->lookup_resolved_type (ast_node_id, &ref_node_id)) - { - bool ok - = resolver->lookup_resolved_misc (ast_node_id, &ref_node_id); - rust_assert (ok); - } - } - } + rust_unreachable (); } } // namespace Analysis diff --git a/gcc/rust/checks/lints/rust-lint-marklive.h b/gcc/rust/checks/lints/rust-lint-marklive.h index 86d96fc93673..6b3dafd64e44 100644 --- a/gcc/rust/checks/lints/rust-lint-marklive.h +++ b/gcc/rust/checks/lints/rust-lint-marklive.h @@ -277,11 +277,9 @@ class MarkLive : public MarkLiveBase std::set liveSymbols; std::set scannedSymbols; Analysis::Mappings &mappings; - Resolver::Resolver *resolver; Resolver::TypeCheckContext *tyctx; MarkLive (std::vector worklist) : worklist (worklist), mappings (Analysis::Mappings::get ()), - resolver (Resolver::Resolver::get ()), tyctx (Resolver::TypeCheckContext::get ()){}; void mark_hir_id (HirId); diff --git a/gcc/rust/checks/lints/rust-lint-scan-deadcode.h b/gcc/rust/checks/lints/rust-lint-scan-deadcode.h index 0fc203b03189..bacf8f693523 100644 --- a/gcc/rust/checks/lints/rust-lint-scan-deadcode.h +++ b/gcc/rust/checks/lints/rust-lint-scan-deadcode.h @@ -135,12 +135,10 @@ class ScanDeadcode : public MarkLiveBase private: std::set live_symbols; - Resolver::Resolver *resolver; Analysis::Mappings &mappings; ScanDeadcode (std::set &live_symbols) - : live_symbols (live_symbols), resolver (Resolver::Resolver::get ()), - mappings (Analysis::Mappings::get ()){}; + : live_symbols (live_symbols), mappings (Analysis::Mappings::get ()){}; bool should_warn (HirId hirId) {