about summary refs log tree commit diff
path: root/tests/ui/pattern
diff options
context:
space:
mode:
authorLukas Wirth <lukas.wirth@ferrous-systems.com>2025-06-03 10:03:42 +0200
committerLukas Wirth <lukas.wirth@ferrous-systems.com>2025-06-03 13:35:31 +0200
commiteae7fe1bdb5ca2fa3c37c84c5e93d5fb3cbeab8d (patch)
tree49a56410279d75fe97d74400d6a7f409f281a6f9 /tests/ui/pattern
parentb17dba45186c454576d0fc8fb93ecc65eb1a763a (diff)
downloadrust-eae7fe1bdb5ca2fa3c37c84c5e93d5fb3cbeab8d.tar.gz
rust-eae7fe1bdb5ca2fa3c37c84c5e93d5fb3cbeab8d.zip
Use non-2015 edition paths in tests that do not test for their resolution
This allows for testing these tests on editions other than 2015
Diffstat (limited to 'tests/ui/pattern')
-rw-r--r--tests/ui/pattern/issue-14221.rs2
-rw-r--r--tests/ui/pattern/issue-22546.rs4
-rw-r--r--tests/ui/pattern/issue-6449.rs40
-rw-r--r--tests/ui/pattern/missing_lifetime.rs2
-rw-r--r--tests/ui/pattern/usefulness/uninhabited.rs2
5 files changed, 25 insertions, 25 deletions
diff --git a/tests/ui/pattern/issue-14221.rs b/tests/ui/pattern/issue-14221.rs
index 13427d2c9b2..f5f419a6314 100644
--- a/tests/ui/pattern/issue-14221.rs
+++ b/tests/ui/pattern/issue-14221.rs
@@ -8,7 +8,7 @@ pub enum E {
 }
 
 pub mod b {
-    pub fn key(e: ::E) -> &'static str {
+    pub fn key(e: crate::E) -> &'static str {
         match e {
             A => "A",
 //~^ ERROR pattern binding `A` is named the same as one of the variants of the type `E`
diff --git a/tests/ui/pattern/issue-22546.rs b/tests/ui/pattern/issue-22546.rs
index fd1d5fb6c47..81908017b4e 100644
--- a/tests/ui/pattern/issue-22546.rs
+++ b/tests/ui/pattern/issue-22546.rs
@@ -7,7 +7,7 @@ use std::default::Default;
 #[derive(Default)]
 pub struct Foo<T>(T, T);
 
-impl<T: ::std::fmt::Display> Foo<T> {
+impl<T: std::fmt::Display> Foo<T> {
     fn foo(&self) {
         match *self {
             Foo::<T>(ref x, ref y) => println!("Goodbye, World! {} {}", x, y)
@@ -36,7 +36,7 @@ fn main() {
     let w = Wrapper { value: Foo(10u8, 11u8) };
     match w {
         Wrapper::<Foo<u8>> { value: Foo(10, 11) } => {},
-        ::Wrapper::<<Foo<_> as Tr>::U> { value: Foo::<u8>(11, 16) } => { panic!() },
+        crate::Wrapper::<<Foo<_> as Tr>::U> { value: Foo::<u8>(11, 16) } => { panic!() },
         _ => { panic!() }
     }
 
diff --git a/tests/ui/pattern/issue-6449.rs b/tests/ui/pattern/issue-6449.rs
index 38399a18793..25152cf5d29 100644
--- a/tests/ui/pattern/issue-6449.rs
+++ b/tests/ui/pattern/issue-6449.rs
@@ -13,32 +13,32 @@ enum Other {
 
 fn main() {
     match Foo::Baz {
-        ::Foo::Bar(3) => panic!(),
-        ::Foo::Bar(_) if false => panic!(),
-        ::Foo::Bar(..) if false => panic!(),
-        ::Foo::Bar(_n) => panic!(),
-        ::Foo::Baz => {}
+        crate::Foo::Bar(3) => panic!(),
+        crate::Foo::Bar(_) if false => panic!(),
+        crate::Foo::Bar(..) if false => panic!(),
+        crate::Foo::Bar(_n) => panic!(),
+        crate::Foo::Baz => {}
     }
     match Foo::Bar(3) {
-        ::Foo::Bar(3) => {}
-        ::Foo::Bar(_) if false => panic!(),
-        ::Foo::Bar(..) if false => panic!(),
-        ::Foo::Bar(_n) => panic!(),
-        ::Foo::Baz => panic!(),
+        crate::Foo::Bar(3) => {}
+        crate::Foo::Bar(_) if false => panic!(),
+        crate::Foo::Bar(..) if false => panic!(),
+        crate::Foo::Bar(_n) => panic!(),
+        crate::Foo::Baz => panic!(),
     }
     match Foo::Bar(4) {
-        ::Foo::Bar(3) => panic!(),
-        ::Foo::Bar(_) if false => panic!(),
-        ::Foo::Bar(..) if false => panic!(),
-        ::Foo::Bar(n) => assert_eq!(n, 4),
-        ::Foo::Baz => panic!(),
+        crate::Foo::Bar(3) => panic!(),
+        crate::Foo::Bar(_) if false => panic!(),
+        crate::Foo::Bar(..) if false => panic!(),
+        crate::Foo::Bar(n) => assert_eq!(n, 4),
+        crate::Foo::Baz => panic!(),
     }
 
     match Other::Other1(Foo::Baz) {
-        ::Other::Other1(::Foo::Baz) => {}
-        ::Other::Other1(::Foo::Bar(_)) => {}
-        ::Other::Other2(::Foo::Baz, ::Foo::Bar(_)) => {}
-        ::Other::Other2(::Foo::Bar(..), ::Foo::Baz) => {}
-        ::Other::Other2(..) => {}
+        crate::Other::Other1(crate::Foo::Baz) => {}
+        crate::Other::Other1(crate::Foo::Bar(_)) => {}
+        crate::Other::Other2(crate::Foo::Baz, crate::Foo::Bar(_)) => {}
+        crate::Other::Other2(crate::Foo::Bar(..), crate::Foo::Baz) => {}
+        crate::Other::Other2(..) => {}
     }
 }
diff --git a/tests/ui/pattern/missing_lifetime.rs b/tests/ui/pattern/missing_lifetime.rs
index 081f667d8f6..53f8e155019 100644
--- a/tests/ui/pattern/missing_lifetime.rs
+++ b/tests/ui/pattern/missing_lifetime.rs
@@ -20,6 +20,6 @@ enum Other {
 
 fn main() {
     match Other::Other1(Foo::Baz) {
-        ::Other::Other2(::Foo::Bar(..)) => {}
+        crate::Other::Other2(crate::Foo::Bar(..)) => {}
     }
 }
diff --git a/tests/ui/pattern/usefulness/uninhabited.rs b/tests/ui/pattern/usefulness/uninhabited.rs
index 5c774b7874a..0e2793fb448 100644
--- a/tests/ui/pattern/usefulness/uninhabited.rs
+++ b/tests/ui/pattern/usefulness/uninhabited.rs
@@ -120,7 +120,7 @@ mod visibility {
     mod c {
         use super::*;
         pub struct AlsoSecretlyUninhabited {
-            _priv: ::Struct1,
+            _priv: crate::Struct1,
         }
         assert_empty!(SometimesEmptyStruct);
         assert_non_empty!(SometimesEmptyEnum);