]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
nr2.0: Fix test self-path2.rs
authorOwen Avery <powerboat9.gamer@gmail.com>
Sun, 9 Feb 2025 20:16:59 +0000 (15:16 -0500)
committerP-E-P <32375388+P-E-P@users.noreply.github.com>
Wed, 19 Mar 2025 11:20:29 +0000 (11:20 +0000)
gcc/rust/ChangeLog:

* resolve/rust-ast-resolve-path.cc
(ResolvePath::resolve_path): Adjust the error message for a lower
self segment in the middle of a path.
* resolve/rust-ast-resolve-type.cc
(ResolveRelativeTypePath::go): Likewise.

gcc/testsuite/ChangeLog:

* rust/compile/nr2/exclude: Remove self-path2.rs
* rust/compile/self-path2.rs: Adjust expected errors.

Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
gcc/rust/resolve/rust-ast-resolve-path.cc
gcc/rust/resolve/rust-ast-resolve-type.cc
gcc/testsuite/rust/compile/nr2/exclude
gcc/testsuite/rust/compile/self-path2.rs

index 9fefc0f6a421252e7d0c39c56eb76613076a8261..656b7e64bb73eadc6f19a97745f4c6232ab0990c 100644 (file)
@@ -68,8 +68,8 @@ ResolvePath::resolve_path (AST::PathInExpression &expr)
       if (in_middle_of_path && segment.is_lower_self_seg ())
        {
          rust_error_at (segment.get_locus (), ErrorCode::E0433,
-                        "failed to resolve: %<%s%> in paths can only be used "
-                        "in start position",
+                        "leading path segment %qs can only be used at the "
+                        "beginning of a path",
                         segment.as_string ().c_str ());
          return UNKNOWN_NODEID;
        }
index 22af563f0a730c8b82799f959c250879141e8221..243291751290e91259b6233fc8833c95781028fd 100644 (file)
@@ -176,8 +176,8 @@ ResolveRelativeTypePath::go (AST::TypePath &path, NodeId &resolved_node_id)
          if (in_middle_of_path && segment->is_lower_self_seg ())
            {
              rust_error_at (segment->get_locus (), ErrorCode::E0433,
-                            "failed to resolve: %qs in paths can only be used "
-                            "in start position",
+                            "leading path segment %qs can only be used at the "
+                            "beginning of a path",
                             segment->as_string ().c_str ());
              return false;
            }
index a4bac9ac836585244c9a1fecec45061049bc1647..a2a833f90738710ab12a02fd6ed354d5ba76cd09 100644 (file)
@@ -28,7 +28,6 @@ pub_restricted_2.rs
 pub_restricted_3.rs
 redef_error2.rs
 redef_error5.rs
-self-path2.rs
 sizeof-stray-infer-var-bug.rs
 struct-expr-parse.rs
 undeclared_label.rs
index b9b82cae5a6a502a6e6223976f8da8c5b0e7bc7b..6441c3328f91b6cc1c041effb80e63182ed4f790 100644 (file)
@@ -11,11 +11,11 @@ fn baz() {
     crate::bar();
 
     crate::self::foo();
-    // { dg-error "failed to resolve: .self. in paths can only be used in start position" "" { target *-*-* } .-1 }
+    // { dg-error "leading path segment .self. can only be used at the beginning of a path" "" { target *-*-* } .-1 }
 }
 
 type a = foo;
 type b = crate::foo;
 type c = self::foo;
 type d = crate::self::foo;
-// { dg-error "failed to resolve: .self. in paths can only be used in start position" "" { target *-*-* } .-1 }
+// { dg-error "leading path segment .self. can only be used at the beginning of a path" "" { target *-*-* } .-1 }