diff options
author | Philip Herron <herron.philip@googlemail.com> | 2023-06-20 12:21:02 +0100 |
---|---|---|
committer | Philip Herron <philip.herron@embecosm.com> | 2023-06-21 09:00:30 +0000 |
commit | 7bb7c2a44e6e2b3ea6f95891ee60e2b91cc8cd59 (patch) | |
tree | 278c945180efbda52d36383f55b2579077e07da5 /gcc/rust/resolve | |
parent | 3a27f1e9058c67a153f5911af052ccbf253e7e58 (diff) | |
download | gcc-7bb7c2a44e6e2b3ea6f95891ee60e2b91cc8cd59.zip gcc-7bb7c2a44e6e2b3ea6f95891ee60e2b91cc8cd59.tar.gz gcc-7bb7c2a44e6e2b3ea6f95891ee60e2b91cc8cd59.tar.bz2 |
gccrs: add new method to infer impl block type
When we resolve a path segment the associated impl Self may not be a type
which 'binds' generic types. Which would be any type which does not inherit
SubstitionRef base class. There is a case where an impl block for generic
type T has bound generics on the trait bound of the trait impl block this
allows us to infer the T for this case.
Addresses #1893
gcc/rust/ChangeLog:
* typecheck/rust-hir-type-check-item.cc (TypeCheckItem::ResolveImplBlockSelfWithInference):
New helper utility to infer non concrete types and handle the case where its not a
binding generic type (which inherits SubstitutionRef)
* typecheck/rust-hir-type-check-item.h: new helper prototype
* typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::resolve_segments): use this helper
Signed-off-by: Philip Herron <herron.philip@googlemail.com>
Diffstat (limited to 'gcc/rust/resolve')
0 files changed, 0 insertions, 0 deletions