diff options
author | Philip Herron <philip.herron@embecosm.com> | 2022-04-08 15:17:27 +0100 |
---|---|---|
committer | Philip Herron <philip.herron@embecosm.com> | 2022-04-11 11:44:59 +0100 |
commit | 69d6fddcbb9daba68087eb38bffa9953e01b4888 (patch) | |
tree | 68a63c3700a71294758f21d8129ce6e37c7465b2 /gcc | |
parent | 0e7eef6556703cd53b336d0b5280c3696586d431 (diff) | |
download | gcc-69d6fddcbb9daba68087eb38bffa9953e01b4888.zip gcc-69d6fddcbb9daba68087eb38bffa9953e01b4888.tar.gz gcc-69d6fddcbb9daba68087eb38bffa9953e01b4888.tar.bz2 |
Allow substitutions to be handled on primitive types without causing unreachable
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/rust/typecheck/rust-substitution-mapper.h | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/gcc/rust/typecheck/rust-substitution-mapper.h b/gcc/rust/typecheck/rust-substitution-mapper.h index 5f17816..e12432e 100644 --- a/gcc/rust/typecheck/rust-substitution-mapper.h +++ b/gcc/rust/typecheck/rust-substitution-mapper.h @@ -232,19 +232,22 @@ public: } // nothing to do for these - void visit (TyTy::InferType &) override { gcc_unreachable (); } - void visit (TyTy::FnPtr &) override { gcc_unreachable (); } - void visit (TyTy::BoolType &) override { gcc_unreachable (); } - void visit (TyTy::IntType &) override { gcc_unreachable (); } - void visit (TyTy::UintType &) override { gcc_unreachable (); } - void visit (TyTy::FloatType &) override { gcc_unreachable (); } - void visit (TyTy::USizeType &) override { gcc_unreachable (); } - void visit (TyTy::ISizeType &) override { gcc_unreachable (); } - void visit (TyTy::ErrorType &) override { gcc_unreachable (); } - void visit (TyTy::CharType &) override { gcc_unreachable (); } - void visit (TyTy::StrType &) override { gcc_unreachable (); } - void visit (TyTy::NeverType &) override { gcc_unreachable (); } - void visit (TyTy::DynamicObjectType &) override { gcc_unreachable (); } + void visit (TyTy::InferType &type) override { resolved = type.clone (); } + void visit (TyTy::FnPtr &type) override { resolved = type.clone (); } + void visit (TyTy::BoolType &type) override { resolved = type.clone (); } + void visit (TyTy::IntType &type) override { resolved = type.clone (); } + void visit (TyTy::UintType &type) override { resolved = type.clone (); } + void visit (TyTy::FloatType &type) override { resolved = type.clone (); } + void visit (TyTy::USizeType &type) override { resolved = type.clone (); } + void visit (TyTy::ISizeType &type) override { resolved = type.clone (); } + void visit (TyTy::ErrorType &type) override { resolved = type.clone (); } + void visit (TyTy::CharType &type) override { resolved = type.clone (); } + void visit (TyTy::StrType &type) override { resolved = type.clone (); } + void visit (TyTy::NeverType &type) override { resolved = type.clone (); } + void visit (TyTy::DynamicObjectType &type) override + { + resolved = type.clone (); + } private: SubstMapperInternal (HirId ref, TyTy::SubstitutionArgumentMappings &mappings) |