diff options
author | Philip Herron <herron.philip@googlemail.com> | 2023-04-18 17:56:43 +0100 |
---|---|---|
committer | Philip Herron <philip.herron@embecosm.com> | 2023-04-26 15:02:40 +0000 |
commit | 34a5eebc1b98b6519d590c3b165c3bae1afa5fbb (patch) | |
tree | 2a5999e1d095be896bf4e65827f41dff10fb419b /gcc/objc/objc-runtime-hooks.h | |
parent | 198f98ec04c9f09f956fee36cfb93957e06fbe7d (diff) | |
download | gcc-34a5eebc1b98b6519d590c3b165c3bae1afa5fbb.zip gcc-34a5eebc1b98b6519d590c3b165c3bae1afa5fbb.tar.gz gcc-34a5eebc1b98b6519d590c3b165c3bae1afa5fbb.tar.bz2 |
gccrs: Track Self properly with TypePredicateBounds
When we handle generic trait bounds we never tracked its associated Self
type. Its important to remember a Trait Predicate is associated with a type
this means we end up missing a lot of helpful type information down the
line relating to higher ranked trait bounds and associated types
compuations. Remember traits have an implict Generic Type Parameter of Self
we use this in computing trait defintions so in that case no associated
type is specified which is to be expected but in all other cases we do
even if it is generic its still useful type information to keep track of.
There is one regression here with compile/issue-1893.rs this testcase
mostly worked out as a fluke rather than a proper fix so its no suprise
here it has regressed the other two test cases one where the number
generic arguments has changed, Rustc gets around this and has a seperate
error message for this case.
We need to solve this patch in order to solve #2019
gcc/rust/ChangeLog:
* typecheck/rust-hir-trait-resolve.cc (TraitResolver::resolve_trait): use new interface
* typecheck/rust-hir-type-check-base.h: update prototype to include Self
* typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): lifewise
* typecheck/rust-hir-type-check-item.cc (TypeCheckItem::resolve_impl_block_substitutions):
likewise
* typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::visit): likewise
(TypeCheckExpr::resolve_segments): likewise
* typecheck/rust-hir-type-check-type.cc (TypeCheckType::visit): likewise
(TypeResolveGenericParam::visit): likewise
(ResolveWhereClauseItem::visit): likewise
* typecheck/rust-tyty-bounds.cc (TypeCheckBase::get_predicate_from_bound): likewise
(TypeBoundPredicate::apply_generic_arguments): likewise
(TypeBoundsMappings::lookup_predicate): likewise
* typecheck/rust-tyty-bounds.h: likewise
* typecheck/rust-tyty.h:likewise
gcc/testsuite/ChangeLog:
* rust/compile/issue-1893.rs: regression
* rust/compile/traits12.rs: rustc uses a custom error message here
* rust/compile/unconstrained_type_param.rs: extra error message
Signed-off-by: Philip Herron <herron.philip@googlemail.com>
Diffstat (limited to 'gcc/objc/objc-runtime-hooks.h')
0 files changed, 0 insertions, 0 deletions