about summary refs log tree commit diff
path: root/tests/ui/autoref-autoderef
diff options
context:
space:
mode:
authorMatthias Krüger <476013+matthiaskrgr@users.noreply.github.com>2025-06-04 07:54:35 +0200
committerGitHub <noreply@github.com>2025-06-04 07:54:35 +0200
commitadd4bde99f14f8df3039ce3a1ef849d89ba5e56f (patch)
tree69c3154dc0573ccdc39d9e32f0b86ac020d39b96 /tests/ui/autoref-autoderef
parente63e53a3f64051a80d47e42ea56e740c8879100d (diff)
parent23d523160748045ca24a5d1acd7372dd444eaa6e (diff)
downloadrust-add4bde99f14f8df3039ce3a1ef849d89ba5e56f.tar.gz
rust-add4bde99f14f8df3039ce3a1ef849d89ba5e56f.zip
Rollup merge of #141888 - ferrocene:lw/decouple-tests-from-2015, r=compiler-errors
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/autoref-autoderef')
-rw-r--r--tests/ui/autoref-autoderef/autoderef-privacy.rs16
1 files changed, 8 insertions, 8 deletions
diff --git a/tests/ui/autoref-autoderef/autoderef-privacy.rs b/tests/ui/autoref-autoderef/autoderef-privacy.rs
index d2a217257e5..5fa28750f73 100644
--- a/tests/ui/autoref-autoderef/autoderef-privacy.rs
+++ b/tests/ui/autoref-autoderef/autoderef-privacy.rs
@@ -14,28 +14,28 @@ impl Bar2 {
 
 mod foo {
     #[derive(Default)]
-    pub struct Bar { i: ::Bar2 }
+    pub struct Bar { i: crate::Bar2 }
     #[derive(Default)]
-    pub struct Baz(::Baz2);
+    pub struct Baz(crate::Baz2);
 
     impl Bar {
         fn f(&self) -> bool { false }
     }
 
     impl ::std::ops::Deref for Bar {
-        type Target = ::Bar2;
-        fn deref(&self) -> &::Bar2 { &self.i }
+        type Target = crate::Bar2;
+        fn deref(&self) -> &crate::Bar2 { &self.i }
     }
 
     impl ::std::ops::Deref for Baz {
-        type Target = ::Baz2;
-        fn deref(&self) -> &::Baz2 { &self.0 }
+        type Target = crate::Baz2;
+        fn deref(&self) -> &crate::Baz2 { &self.0 }
     }
 
     pub fn f(bar: &Bar, baz: &Baz) {
         // Since the private fields and methods are visible here, there should be no autoderefs.
-        let _: &::Bar2 = &bar.i;
-        let _: &::Baz2 = &baz.0;
+        let _: &crate::Bar2 = &bar.i;
+        let _: &crate::Baz2 = &baz.0;
         assert!(!bar.f());
     }
 }