aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-11-19 16:14:04 +0000
committerGitHub <noreply@github.com>2021-11-19 16:14:04 +0000
commitfece068309e8a3cbeb81539fba14e1c970740a94 (patch)
tree8a4a116d01cf42ff7507832321618320eed77c3e /gcc/rust
parent0995184e26f81f8ba6872c3efb59f640a7fe7162 (diff)
parent0ecb6ea16bdec84016557536939140fea686f560 (diff)
downloadgcc-fece068309e8a3cbeb81539fba14e1c970740a94.zip
gcc-fece068309e8a3cbeb81539fba14e1c970740a94.tar.gz
gcc-fece068309e8a3cbeb81539fba14e1c970740a94.tar.bz2
Merge #811
811: Remove implicit name hack for trait associated types r=philberty a=philberty There is still another hack I am working through to remove before fixing the issue. Addresses: #739 Co-authored-by: Philip Herron <philip.herron@embecosm.com>
Diffstat (limited to 'gcc/rust')
-rw-r--r--gcc/rust/resolve/rust-ast-resolve-item.h27
1 files changed, 4 insertions, 23 deletions
diff --git a/gcc/rust/resolve/rust-ast-resolve-item.h b/gcc/rust/resolve/rust-ast-resolve-item.h
index 86c9934..f60732c 100644
--- a/gcc/rust/resolve/rust-ast-resolve-item.h
+++ b/gcc/rust/resolve/rust-ast-resolve-item.h
@@ -35,29 +35,14 @@ class ResolveTraitItems : public ResolverBase
using Rust::Resolver::ResolverBase::visit;
public:
- static void go (AST::TraitItem *item, const CanonicalPath &self)
+ static void go (AST::TraitItem *item)
{
- ResolveTraitItems resolver (self);
+ ResolveTraitItems resolver;
item->accept_vis (resolver);
};
void visit (AST::TraitItemType &type) override
{
- // insert Self::type_alias for TypePath lookup
- auto path
- = self.append (ResolveTraitItemTypeToCanonicalPath::resolve (type));
- resolver->get_type_scope ().insert (
- path, type.get_node_id (), type.get_locus (), false,
- [&] (const CanonicalPath &, NodeId, Location locus) -> void {
- RichLocation r (type.get_locus ());
- r.add_range (locus);
- rust_error_at (r, "redefined multiple times");
- });
-
- // FIXME this stops the erronious unused decls which will be fixed later on
- resolver->get_type_scope ().append_reference_for_def (type.get_node_id (),
- type.get_node_id ());
-
for (auto &bound : type.get_type_param_bounds ())
ResolveTypeBound::go (bound.get (), type.get_node_id ());
}
@@ -189,11 +174,7 @@ public:
}
private:
- ResolveTraitItems (const CanonicalPath &self)
- : ResolverBase (UNKNOWN_NODEID), self (self)
- {}
-
- const CanonicalPath &self;
+ ResolveTraitItems () : ResolverBase (UNKNOWN_NODEID) {}
};
class ResolveItem : public ResolverBase
@@ -649,7 +630,7 @@ public:
for (auto &item : trait.get_trait_items ())
{
- ResolveTraitItems::go (item.get (), Self);
+ ResolveTraitItems::go (item.get ());
}
resolver->get_type_scope ().pop ();