summaryrefslogtreecommitdiffstats
path: root/tests/ui/self/arbitrary_self_type_mut_difference.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/self/arbitrary_self_type_mut_difference.rs')
-rw-r--r--tests/ui/self/arbitrary_self_type_mut_difference.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/ui/self/arbitrary_self_type_mut_difference.rs b/tests/ui/self/arbitrary_self_type_mut_difference.rs
new file mode 100644
index 000000000..e75c00ae9
--- /dev/null
+++ b/tests/ui/self/arbitrary_self_type_mut_difference.rs
@@ -0,0 +1,13 @@
+// Related to #57994.
+use std::pin::Pin;
+struct S;
+
+impl S {
+ fn x(self: Pin<&mut Self>) {} //~ NOTE method is available for `Pin<&mut S>`
+ fn y(self: Pin<&Self>) {} //~ NOTE method is available for `Pin<&S>`
+}
+
+fn main() {
+ Pin::new(&S).x(); //~ ERROR no method named `x` found for struct `Pin<&S>` in the current scope
+ Pin::new(&mut S).y(); //~ ERROR no method named `y` found for struct `Pin<&mut S>` in the current scope
+}