-
Notifications
You must be signed in to change notification settings - Fork 185
nr1.0: Remove rust/checks
support
#4050
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
gcc/rust/ChangeLog: * checks/errors/borrowck/rust-bir-builder-internal.h (BuilderContext::resolver): Remove member variable. (BuilderContext::BuilderContext): Remove initialization of resolver member variable. (AbstractBuilder::resolve_label): Assume nr2.0 is enabled. (AbstractBuilder::resolve_variable): Likewise. (AbstractBuilder::resolve_variable_or_fn): Likewise. * checks/errors/privacy/rust-privacy-check.cc (Resolver::resolve): Avoid passing the 1.0 name resolver to VisibilityResolver or PrivacyReporter. * checks/errors/privacy/rust-privacy-reporter.cc (PrivacyReporter::PrivacyReporter): Remove initialization of resolver field. (is_child_module): Assume nr2.0 is enabled. (PrivacyReporter::check_for_privacy_violation): Likewise. * checks/errors/privacy/rust-privacy-reporter.h (PrivacyReporter::PrivacyReporter): Remove 1.0 resolver parameter. (PrivacyReporter::resolver): Remove member variable. * checks/errors/privacy/rust-visibility-resolver.cc: Remove "options.h" inclusion. (VisibilityResolver::VisibilityResolver): Remove 1.0 resolver parameter. (VisibilityResolver::resolve_module_path): Assume nr2.0 is enabled. * checks/errors/privacy/rust-visibility-resolver.h (VisibilityResolver::VisibilityResolver): Remove 1.0 resolver parameter. (VisibilityResolver::resolver): Remove member variable. * checks/errors/rust-const-checker.cc: Remove "options.h" inclusion. (ConstChecker::ConstChecker): Remove 1.0 resolver parameter. (ConstChecker::visit): Assume nr2.0 is enabled. * checks/errors/rust-const-checker.h (ConstChecker::resolver): Remove member variable. * checks/errors/rust-hir-pattern-analysis.cc: Remove "options.h" inclusion. (PatternChecker::PatternChecker): Remove 1.0 resolver parameter. (PatternChecker::visit): Assume nr2.0 is enabled. * checks/errors/rust-hir-pattern-analysis.h (PatternChecker::resolver): Remove member variable. * checks/errors/rust-readonly-check2.cc (ReadonlyChecker::ReadonlyChecker): Remove initialization of resolver member variable. * checks/errors/rust-readonly-check2.h (ReadonlyChecker::resolver): Remove member variable. * checks/errors/rust-unsafe-checker.cc: Remove "options.h" inclusion. (UnsafeChecker::UnsafeChecker): Remove 1.0 resolver parameter. (UnsafeChecker::visit): Assume nr2.0 is enabled. * checks/errors/rust-unsafe-checker.h (UnsafeChecker::resolver): Remove member variable. * checks/lints/rust-lint-marklive.cc (MarkLive::visit_path_segment): Assume nr2.0 is enabled. (MarkLive::visit): Likewise. (MarkLive::find_ref_node_id): Likewise. * checks/lints/rust-lint-marklive.h (MarkLive::resolver): Remove member variable. (MarkLive::MarkLive): Remove initialization of resolver member variable. * checks/lints/rust-lint-scan-deadcode.h (ScanDeadCode::resolver): Remove member variable. (ScanDeadCode::ScanDeadCode): Remove initialization of resolver member variable. Signed-off-by: Owen Avery <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is good but yes slightly harder to use than the nr1.0 resolver, so we should add some member fields with the nr2.0 resolver and then merge this
@@ -75,7 +75,6 @@ struct BuilderContext | |||
|
|||
// External context. | |||
Resolver::TypeCheckContext &tyctx; | |||
Resolver::Resolver &resolver; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably store the NR2.0 resolver instead to avoid having to get it each time we want to use it
BuilderContext () | ||
: tyctx (*Resolver::TypeCheckContext::get ()), | ||
resolver (*Resolver::Resolver::get ()) | ||
BuilderContext () : tyctx (*Resolver::TypeCheckContext::get ()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...and just add it something like this:
BuilderContext () : tyctx (*Resolver::TypeCheckContext::get ()) | |
BuilderContext () : tyctx (*Resolver::TypeCheckContext::get ()), resolver(ImmutableNameResolutionCtx::get().resolver()) |
@@ -157,7 +156,6 @@ types | |||
virtual void visit (HIR::ExprStmt &stmt); | |||
|
|||
Analysis::Mappings &mappings; | |||
Rust::Resolver::Resolver &resolver; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
No description provided.