diff options
author | Philip Herron <philip.herron@embecosm.com> | 2021-08-31 12:25:14 +0100 |
---|---|---|
committer | Philip Herron <philip.herron@embecosm.com> | 2021-08-31 12:25:14 +0100 |
commit | 5e7108c3582f772c28864bd08934b00dfa3539fd (patch) | |
tree | 6212e832eee66a77665337fc284e8bafd7c7e0f7 | |
parent | bd90c95ac738852f270408ad75f31144fb854239 (diff) | |
download | gcc-5e7108c3582f772c28864bd08934b00dfa3539fd.zip gcc-5e7108c3582f772c28864bd08934b00dfa3539fd.tar.gz gcc-5e7108c3582f772c28864bd08934b00dfa3539fd.tar.bz2 |
Placeholder is not a unit-type
Placeholder types are containers for associated types, the code-generation
pass has a check for is_unit on return types for functions so we can inject
void_type_node. This was a false positive for placeholders, placeholders
must resolve to check what their concrete implementation type actually is
for this type of query.
-rw-r--r-- | gcc/rust/typecheck/rust-tyty.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/rust/typecheck/rust-tyty.h b/gcc/rust/typecheck/rust-tyty.h index 743874a..181be94 100644 --- a/gcc/rust/typecheck/rust-tyty.h +++ b/gcc/rust/typecheck/rust-tyty.h @@ -1709,7 +1709,11 @@ public: std::string get_name () const override final { return as_string (); } - bool is_unit () const override { return true; } + bool is_unit () const override + { + rust_assert (can_resolve ()); + return resolve ()->is_unit (); + } std::string get_symbol () const { return symbol; } |