diff options
author | Philip Herron <herron.philip@googlemail.com> | 2025-02-04 17:15:15 +0000 |
---|---|---|
committer | Philip Herron <herron.philip@googlemail.com> | 2025-02-04 17:19:12 +0000 |
commit | 7691105e19b0437c83d104f53ec34f8279b79c84 (patch) | |
tree | 08c9f11054c5414b16fb8592488625f7faa3eea2 /gcc/rust | |
parent | 5fb06c9be8264b67cab428035ceaefac3df90129 (diff) | |
download | gcc-7691105e19b0437c83d104f53ec34f8279b79c84.zip gcc-7691105e19b0437c83d104f53ec34f8279b79c84.tar.gz gcc-7691105e19b0437c83d104f53ec34f8279b79c84.tar.bz2 |
gccrs: remove bad type checking diagnostic
This was a bad diagnostic added when I was working on slices and iterators
also the name of the function is also bad. This is all about setting up
associated types based on the current context of the bounds assocated with
the associated trait bounds on this function.
The tell tale is that this didnt have an associated rust error code so
this is most definetly not the correct error diagnostic.
Fixes Rust-GCC#3403
gcc/rust/ChangeLog:
* typecheck/rust-tyty-subst.cc (SubstitutionRef::monomorphize): remove diagnostic
gcc/testsuite/ChangeLog:
* rust/compile/nr2/exclude: nr2 cant handle this
* rust/compile/issue-3403.rs: New test.
Signed-off-by: Philip Herron <herron.philip@googlemail.com>
Diffstat (limited to 'gcc/rust')
-rw-r--r-- | gcc/rust/typecheck/rust-tyty-subst.cc | 21 |
1 files changed, 1 insertions, 20 deletions
diff --git a/gcc/rust/typecheck/rust-tyty-subst.cc b/gcc/rust/typecheck/rust-tyty-subst.cc index 976f6af..26afe1b 100644 --- a/gcc/rust/typecheck/rust-tyty-subst.cc +++ b/gcc/rust/typecheck/rust-tyty-subst.cc @@ -934,27 +934,8 @@ SubstitutionRef::monomorphize () auto associated = Resolver::lookup_associated_impl_block (bound, binding, &ambigious); - if (associated == nullptr && ambigious) - { - // go for the first one? or error out? - auto &mappings = Analysis::Mappings::get (); - const auto &type_param = subst.get_generic_param (); - const auto *trait_ref = bound.get (); - - rich_location r (line_table, type_param.get_locus ()); - r.add_range (bound.get_locus ()); - r.add_range (mappings.lookup_location (binding->get_ref ())); - - rust_error_at (r, "ambiguous type bound for trait %s and type %s", - trait_ref->get_name ().c_str (), - binding->get_name ().c_str ()); - return false; - } - if (associated != nullptr) - { - associated->setup_associated_types (binding, bound); - } + associated->setup_associated_types (binding, bound); } } |