From 32fca9ab5eeba4410cfe82e9aa5692c61a4f1589 Mon Sep 17 00:00:00 2001 From: Arthur Cohen Date: Thu, 5 Dec 2024 12:45:13 +0000 Subject: [PATCH] fixup! ast --- gcc/rust/ast/rust-path.h | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) 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 (*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 (*path).get_segments ().size () == 1; + +rust_unreachable (); } Pattern::Kind get_pattern_kind () override { return Pattern::Kind::Path; }