-
Notifications
You must be signed in to change notification settings - Fork 173
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
Avoid visiting nonexistant function parameter types during nr2.0 #3168
base: master
Are you sure you want to change the base?
Conversation
gcc/rust/ast/rust-item.h
Outdated
@@ -3548,6 +3548,8 @@ class NamedFunctionParam | |||
* '_'). */ | |||
bool has_name () const { return name != "_" && name != ""; } | |||
|
|||
bool has_type () const { return param_type != nullptr; } |
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.
If a NamedFunctionParam
cannot have a type then we should probably wrap the type pointer within an optional.
d650189
to
56190de
Compare
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.
There are some errors on gcc 4.8 but otherwise it looks fine.
56190de
to
21994e6
Compare
It looks like this was mostly superseded by another PR, I'm on the fence with discarding this PR, combining it with something else, or just merging it with some tweaks. |
gcc/rust/ChangeLog: * ast/rust-ast-visitor.h (DefaultASTVisitor::visit): Add overload for tl::optional<T &>. * ast/rust-item.h (SelfParam::get_type): Return tl::optional<Type &>. * ast/rust-ast-collector.cc (TokenCollector::visit): Handle changed return type of SelfParam::get_type. * expand/rust-cfg-strip.cc (CfgStrip::visit): Likewise. * hir/rust-ast-lower-base.cc (ASTLoweringBase::lower_self): Likewise. * resolve/rust-ast-resolve-item.cc (ResolveTraitItems::visit): Likewise. (ResolveItem::visit): Likewise. * resolve/rust-ast-resolve-stmt.h (ResolveStmt::visit): Likewise. * resolve/rust-default-resolver.cc (DefaultResolver::visit): Likewise, and properly handle empty optional. gcc/testsuite/ChangeLog: * rust/compile/nr2/exclude: Remove entries. Signed-off-by: Owen Avery <[email protected]>
This makes 3 more tests pass with name resolution 2.0