diff options
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/rust/typecheck/rust-tyty-cmp.h | 106 |
1 files changed, 100 insertions, 6 deletions
diff --git a/gcc/rust/typecheck/rust-tyty-cmp.h b/gcc/rust/typecheck/rust-tyty-cmp.h index f3118ba..07d1dea 100644 --- a/gcc/rust/typecheck/rust-tyty-cmp.h +++ b/gcc/rust/typecheck/rust-tyty-cmp.h @@ -36,12 +36,7 @@ public: if (other->get_kind () == TypeKind::PARAM) { const ParamType *p = static_cast<const ParamType *> (other); - if (p->can_resolve ()) - { - const BaseType *resolved = p->resolve (); - resolved->accept_vis (*this); - return ok; - } + other = p->resolve (); } if (other->get_kind () == TypeKind::PLACEHOLDER) { @@ -861,6 +856,17 @@ public: : BaseCmp (base, emit_errors), base (base) {} + void visit (const InferType &type) override + { + if (type.get_infer_kind () != InferType::InferTypeKind::GENERAL) + { + BaseCmp::visit (type); + return; + } + + ok = true; + } + private: const BaseType *get_base () const override { return base; } const ClosureType *base; @@ -889,6 +895,17 @@ public: ok = true; } + void visit (const InferType &type) override + { + if (type.get_infer_kind () != InferType::InferTypeKind::GENERAL) + { + BaseCmp::visit (type); + return; + } + + ok = true; + } + private: const BaseType *get_base () const override { return base; } const ArrayType *base; @@ -917,6 +934,17 @@ public: ok = true; } + void visit (const InferType &type) override + { + if (type.get_infer_kind () != InferType::InferTypeKind::GENERAL) + { + BaseCmp::visit (type); + return; + } + + ok = true; + } + private: const BaseType *get_base () const override { return base; } const SliceType *base; @@ -1074,6 +1102,17 @@ public: ok = true; } + void visit (const InferType &type) override + { + if (type.get_infer_kind () != InferType::InferTypeKind::GENERAL) + { + BaseCmp::visit (type); + return; + } + + ok = true; + } + private: const BaseType *get_base () const override { return base; } const ADTType *base; @@ -1111,6 +1150,17 @@ public: ok = true; } + void visit (const InferType &type) override + { + if (type.get_infer_kind () != InferType::InferTypeKind::GENERAL) + { + BaseCmp::visit (type); + return; + } + + ok = true; + } + private: const BaseType *get_base () const override { return base; } const TupleType *base; @@ -1209,6 +1259,17 @@ public: ok = true; } + void visit (const InferType &type) override + { + if (type.get_infer_kind () != InferType::InferTypeKind::GENERAL) + { + BaseCmp::visit (type); + return; + } + + ok = true; + } + private: const BaseType *get_base () const override { return base; } const ReferenceType *base; @@ -1246,6 +1307,17 @@ public: ok = true; } + void visit (const InferType &type) override + { + if (type.get_infer_kind () != InferType::InferTypeKind::GENERAL) + { + BaseCmp::visit (type); + return; + } + + ok = true; + } + private: const BaseType *get_base () const override { return base; } const PointerType *base; @@ -1344,6 +1416,17 @@ public: void visit (const StrType &type) override { ok = true; } + void visit (const InferType &type) override + { + if (type.get_infer_kind () != InferType::InferTypeKind::GENERAL) + { + BaseCmp::visit (type); + return; + } + + ok = true; + } + private: const BaseType *get_base () const override { return base; } const StrType *base; @@ -1360,6 +1443,17 @@ public: void visit (const NeverType &type) override { ok = true; } + void visit (const InferType &type) override + { + if (type.get_infer_kind () != InferType::InferTypeKind::GENERAL) + { + BaseCmp::visit (type); + return; + } + + ok = true; + } + private: const BaseType *get_base () const override { return base; } const NeverType *base; |