diff options
author | Philip Herron <philip.herron@embecosm.com> | 2021-10-30 16:20:45 +0100 |
---|---|---|
committer | Philip Herron <philip.herron@embecosm.com> | 2021-11-01 13:12:48 +0000 |
commit | 919a5a4c5aa7c567e2f3b3a75d7de91c1425227f (patch) | |
tree | b43a9318182f090907b94b3136d5da64e8d835db | |
parent | d18672f220ba9377d8f86fb228b7142e98b23a44 (diff) | |
download | gcc-919a5a4c5aa7c567e2f3b3a75d7de91c1425227f.zip gcc-919a5a4c5aa7c567e2f3b3a75d7de91c1425227f.tar.gz gcc-919a5a4c5aa7c567e2f3b3a75d7de91c1425227f.tar.bz2 |
Get rid of bad gcc_unreachable
-rw-r--r-- | gcc/rust/typecheck/rust-hir-path-probe.h | 25 |
1 files changed, 3 insertions, 22 deletions
diff --git a/gcc/rust/typecheck/rust-hir-path-probe.h b/gcc/rust/typecheck/rust-hir-path-probe.h index b989990..b35f37e 100644 --- a/gcc/rust/typecheck/rust-hir-path-probe.h +++ b/gcc/rust/typecheck/rust-hir-path-probe.h @@ -83,32 +83,13 @@ struct PathProbeCandidate bool is_impl_candidate () const { - switch (type) - { - case IMPL_CONST: - case IMPL_TYPE_ALIAS: - case IMPL_FUNC: - return true; - - default: - return false; - } - gcc_unreachable (); + return type == IMPL_CONST || type == IMPL_TYPE_ALIAS || type == IMPL_FUNC; } bool is_trait_candidate () const { - switch (type) - { - case TRAIT_ITEM_CONST: - case TRAIT_TYPE_ALIAS: - case TRAIT_FUNC: - return true; - - default: - return false; - } - gcc_unreachable (); + return type == TRAIT_ITEM_CONST || type == TRAIT_TYPE_ALIAS + || type == TRAIT_FUNC; } }; |