]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: Force crash when retrieving meta item location
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Wed, 1 Oct 2025 14:26:47 +0000 (16:26 +0200)
committerArthur Cohen <arthur.cohen@embecosm.com>
Thu, 30 Oct 2025 20:30:55 +0000 (21:30 +0100)
We still don't know which location should be preferred over the other,
this means that nobody should rely on this function's return value.

gcc/rust/ChangeLog:

* ast/rust-expr.h: Force crash when retrieving locus.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
gcc/rust/ast/rust-expr.h

index 239b9511f67f1ef3dc0c658423232d3289798bbf..3c36238c6ee6f40ed49b1e4237243e8ceed3b195 100644 (file)
@@ -298,7 +298,11 @@ public:
   //  we have no idea use which of them, just simply return UNKNOWN_LOCATION
   //  now.
   // Maybe we will figure out when we really need the location in the future.
-  location_t get_locus () const override { return UNKNOWN_LOCATION; }
+  location_t get_locus () const override
+  {
+    rust_unreachable ();
+    return UNKNOWN_LOCATION;
+  }
 
   void accept_vis (ASTVisitor &vis) override;