diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-09-05 00:14:00 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-05 00:14:00 +0000 |
commit | 50623899998de5a8ffe47227a351c2b3dd29aa0a (patch) | |
tree | 4fac02e7fc1b271b1bf50d8812e150ab8ee30db9 /gcc/rust/backend/rust-compile-context.h | |
parent | c33c6f3676dfca1a6bd7984cebf5028c015ea182 (diff) | |
parent | 0798add3d3c1bf4b20ecc1b4fa1047ba4ba19759 (diff) | |
download | gcc-50623899998de5a8ffe47227a351c2b3dd29aa0a.zip gcc-50623899998de5a8ffe47227a351c2b3dd29aa0a.tar.gz gcc-50623899998de5a8ffe47227a351c2b3dd29aa0a.tar.bz2 |
Merge #655
655: Generic Qualified Paths r=philberty a=philberty
This fixes how we handle associated types in relation to generic
traits. Generic traits are interesting because, a TypePath usually
resolves to a normal TyTy type which can be substituted using the
mapper classes, but a trait is a definition of behaviour which
is made up of types, constants or functions. In order to handle
generic traits we must add substitution support to the associated types
which are represented by projections see this commit for detail on the changes
0798add3d3c1bf4b20ecc1b4fa1047ba4ba19759
Also see https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/sty/struct.ProjectionTy.html
Fixes #434
Co-authored-by: Philip Herron <philip.herron@embecosm.com>
Diffstat (limited to 'gcc/rust/backend/rust-compile-context.h')
-rw-r--r-- | gcc/rust/backend/rust-compile-context.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/rust/backend/rust-compile-context.h b/gcc/rust/backend/rust-compile-context.h index 66d037d..bffe97c 100644 --- a/gcc/rust/backend/rust-compile-context.h +++ b/gcc/rust/backend/rust-compile-context.h @@ -336,7 +336,10 @@ public: void visit (TyTy::InferType &) override { gcc_unreachable (); } - void visit (TyTy::ProjectionType &) override { gcc_unreachable (); } + void visit (TyTy::ProjectionType &type) override + { + type.get ()->accept_vis (*this); + } void visit (TyTy::PlaceholderType &type) override { |