]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: nr2.0: Adjust pub_restricted tests
authorOwen Avery <powerboat9.gamer@gmail.com>
Sun, 18 May 2025 02:26:20 +0000 (22:26 -0400)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 5 Aug 2025 14:36:45 +0000 (16:36 +0200)
gcc/testsuite/ChangeLog:

* rust/compile/nr2/exclude: Remove entries.
* rust/compile/pub_restricted_1.rs: Adjust expected error
messages and only run with name resolution 2.0 enabled.
* rust/compile/pub_restricted_2.rs: Likewise.

Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
gcc/testsuite/rust/compile/nr2/exclude
gcc/testsuite/rust/compile/pub_restricted_1.rs
gcc/testsuite/rust/compile/pub_restricted_2.rs

index 9d5b7dfbbd30b7289dbd28b3b938231d3c53b0e7..c02805fd2271719216fcd5060a85aa7f3cc75b18 100644 (file)
@@ -1,7 +1,5 @@
 issue-3315-2.rs
 privacy8.rs
-pub_restricted_1.rs
-pub_restricted_2.rs
 issue-2905-2.rs
 torture/alt_patterns1.rs
 torture/name_resolve1.rs
index 9bda9682403238c7d5ed528d95c806badd81a68f..44989a887e93106d70dc0561e9da4fe2d0598e06 100644 (file)
@@ -1,3 +1,5 @@
+// { dg-additional-options "-frust-name-resolution-2.0" }
+
 pub mod foo {
     pub mod bar {
         pub fn baz() {}
@@ -6,8 +8,8 @@ pub mod foo {
     }
 }
 
-pub(in foo::fah::baz) struct A1; // { dg-error "cannot find simple path segment .fah." }
-pub(in fro::bulator::saindoux) struct A2; // { dg-error "cannot find simple path segment .fro." }
-pub(in foo::bar::saindoux) struct A3; // { dg-error "cannot find simple path segment .saindoux." }
+pub(in foo::fah::baz) struct A1; // { dg-error "could not resolve path .foo::fah::baz." }
+pub(in fro::bulator::saindoux) struct A2; // { dg-error "could not resolve path .fro::bulator::saindoux." }
+pub(in foo::bar::saindoux) struct A3; // { dg-error "could not resolve path .foo::bar::saindoux." }
 
 fn main() {}
index 8588f2775cacfd3b6dbf68902d2d7ad4cada4a58..91f072e890f85754930ae0bbb82b031d47b76e52 100644 (file)
@@ -1,18 +1,18 @@
-// { dg-additional-options "-w" }
+// { dg-additional-options "-w -frust-name-resolution-2.0" }
 
 mod foo {
     mod bar {
         mod baz {
-            pub(in baz) struct A0;
-            pub(in bar::baz) struct A1;
+            pub(in super::baz) struct A0;
+            pub(in super::super::bar::baz) struct A1;
             pub(in foo::bar::baz) struct A2;
 
             mod sain {
                 mod doux {}
             }
 
-            pub(in sain) struct A3; // { dg-error "restricted path is not an ancestor of the current module" }
-            pub(in sain::doux) struct A4; // { dg-error "restricted path is not an ancestor of the current module" }
+            pub(in self::sain) struct A3; // { dg-error "restricted path is not an ancestor of the current module" }
+            pub(in self::sain::doux) struct A4; // { dg-error "restricted path is not an ancestor of the current module" }
         }
     }
 }