diff options
author | Philip Herron <herron.philip@googlemail.com> | 2023-08-12 17:06:37 +0100 |
---|---|---|
committer | Philip Herron <philip.herron@embecosm.com> | 2023-08-12 17:14:52 +0000 |
commit | 9ae3c203f76a28332af456e23fc6a7e701577783 (patch) | |
tree | 50b32e28a321552fc2b444085f19d4aed60817f9 /gcc/rust/hir/rust-hir-dump.cc | |
parent | 2691b544983d3729518b4f5c7b4fc9eac48ff21c (diff) | |
download | gcc-9ae3c203f76a28332af456e23fc6a7e701577783.zip gcc-9ae3c203f76a28332af456e23fc6a7e701577783.tar.gz gcc-9ae3c203f76a28332af456e23fc6a7e701577783.tar.bz2 |
gccrs: remove horrible hack in solving complex generics on impl blocks
We hit an assertion with range based iterators here. This code was used
to solve complex generics such as:
struct Foo<X,Y>(X,Y);
impl<T> Foo<T, i32> {
fn test<Y>(self, a: Y) { }
}
The impl item will have the signiture of:
fn test<T,Y> (Foo<T, i32> self, a:Y)
So in the case where we have:
let a = Foo(123f32, 456);
a.test<bool>(true);
We need to solve the generic argument T from the impl block by infering the
arguments there and applying them so that when we apply the generic
argument bool we dont end up in the case of missing number of generics.
Addresses #1895
gcc/rust/ChangeLog:
* typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): remove hack
Signed-off-by: Philip Herron <herron.philip@googlemail.com>
Diffstat (limited to 'gcc/rust/hir/rust-hir-dump.cc')
0 files changed, 0 insertions, 0 deletions