diff --git a/gcc/rust/ast/rust-path.h b/gcc/rust/ast/rust-path.h index 8edc4ba1443..1349bd1f36d 100644 --- a/gcc/rust/ast/rust-path.h +++ b/gcc/rust/ast/rust-path.h @@ -827,14 +827,10 @@ class PathInExpression : public Pattern, public ExprWithoutBlock bool is_single_segment () const { - switch (path->get_path_kind ()) - { - case Path::Kind::Regular: - return static_cast<RegularPath &> (*path).get_segments ().size () == 1; - case Path::Kind::Type: - case Path::Kind::LangItem: - rust_unreachable (); - } + if (path->get_path_kind () == Path::Kind::Regular) + return static_cast<RegularPath &> (*path).get_segments ().size () == 1; + +rust_unreachable (); } Pattern::Kind get_pattern_kind () override { return Pattern::Kind::Path; }