diff options
author | Philip Herron <philip.herron@embecosm.com> | 2021-05-10 23:27:54 +0100 |
---|---|---|
committer | Philip Herron <philip.herron@embecosm.com> | 2021-05-10 23:27:54 +0100 |
commit | 3ff2b34d5bf7bd4e9bb3cadcb72c1d91c8771f82 (patch) | |
tree | a019ea88ba64160aca858f8d1ad0e94887446cab /gcc | |
parent | a0e53ef9d1a2598425476a1b59e434c37d4942e5 (diff) | |
download | gcc-3ff2b34d5bf7bd4e9bb3cadcb72c1d91c8771f82.zip gcc-3ff2b34d5bf7bd4e9bb3cadcb72c1d91c8771f82.tar.gz gcc-3ff2b34d5bf7bd4e9bb3cadcb72c1d91c8771f82.tar.bz2 |
Types need substitution check needs hardened
When we need to check if a type needs substituted needs to take into
account if all substitutions have been mapped.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/rust/typecheck/rust-tyty.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/gcc/rust/typecheck/rust-tyty.h b/gcc/rust/typecheck/rust-tyty.h index cbb447c..dd530ec 100644 --- a/gcc/rust/typecheck/rust-tyty.h +++ b/gcc/rust/typecheck/rust-tyty.h @@ -638,8 +638,16 @@ public: bool needs_substitution () const { - return has_substitutions () - && (used_arguments.is_error () || !used_arguments.is_concrete ()); + if (!has_substitutions ()) + return false; + + if (used_arguments.is_error ()) + return true; + + if (used_arguments.size () != get_num_substitutions ()) + return true; + + return !used_arguments.is_concrete (); } bool was_substituted () const { return !needs_substitution (); } |