aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/resolve/rust-ast-resolve-expr.cc
diff options
context:
space:
mode:
authorPhilip Herron <philip.herron@embecosm.com>2022-10-05 17:24:26 +0100
committerArthur Cohen <arthur.cohen@embecosm.com>2023-02-21 12:36:32 +0100
commit31b77593edbf623fb8f84e35baeb927fdd7c55b6 (patch)
tree083eabe2a4f749680663d53cbb20639186992d46 /gcc/rust/resolve/rust-ast-resolve-expr.cc
parent79434fabf762d60b7aa54e2319c44c1610dd8065 (diff)
downloadgcc-31b77593edbf623fb8f84e35baeb927fdd7c55b6.zip
gcc-31b77593edbf623fb8f84e35baeb927fdd7c55b6.tar.gz
gcc-31b77593edbf623fb8f84e35baeb927fdd7c55b6.tar.bz2
gccrs: Ensure uniqueness on Path probe's
When we lookup names in paths such as Foo::bar, foo is a type we resolve and then we lookup 'bar' based on what type Foo is which includes probing relevant bounds of this type. We currently return a vector of possible candidates and this patch changes it so that we return a set of unique items based on DefId. Addresses #1555 gcc/rust/ChangeLog: * backend/rust-compile-expr.cc (CompileExpr::resolve_method_address): Use auto and minor change in candidate init. * typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::resolve_segments): Likewise. * typecheck/rust-hir-type-check-type.cc: Likewise. * backend/rust-compile-resolve-path.cc (HIRCompileBase::query_compile): Likewise. Removecall to set_ty_ref. * typecheck/rust-hir-path-probe.h (struct PathProbeCandidate): Add locus initializer in ctor, implement get_defid. (class PathProbeType::Probe): return a set instead of vector. Adjust class impl. (class ReportMultipleCandidateError): Do not inherit from HIRImplVisitor anymore and remove corresponding impl. Adjust for change in Probe. Simplify Report handling. (class PathProbeImplTrait::Probe): Adjust return type.
Diffstat (limited to 'gcc/rust/resolve/rust-ast-resolve-expr.cc')
0 files changed, 0 insertions, 0 deletions