about summary refs log tree commit diff
path: root/tests/ui/unpretty
diff options
context:
space:
mode:
authorUrgau <urgau@numericable.fr>2025-02-22 14:50:00 +0100
committerUrgau <urgau@numericable.fr>2025-02-22 17:12:19 +0100
commitd0e7bfd2056cffc7ea0e5f7ed577e987a627ba04 (patch)
tree29a4c3a913d06ead7b13ee91a479777cebef032d /tests/ui/unpretty
parent46154c9b09b81ab02137f2ad1450d2d6277789ce (diff)
downloadrust-d0e7bfd2056cffc7ea0e5f7ed577e987a627ba04.tar.gz
rust-d0e7bfd2056cffc7ea0e5f7ed577e987a627ba04.zip
Render implicit self with their shorthand syntax in HIR pretty printing
Diffstat (limited to 'tests/ui/unpretty')
-rw-r--r--tests/ui/unpretty/debug-fmt-hir.stdout2
-rw-r--r--tests/ui/unpretty/self-hir.rs14
-rw-r--r--tests/ui/unpretty/self-hir.stdout18
3 files changed, 33 insertions, 1 deletions
diff --git a/tests/ui/unpretty/debug-fmt-hir.stdout b/tests/ui/unpretty/debug-fmt-hir.stdout
index bd7a7c4463a..2c9c96de9d1 100644
--- a/tests/ui/unpretty/debug-fmt-hir.stdout
+++ b/tests/ui/unpretty/debug-fmt-hir.stdout
@@ -13,7 +13,7 @@ struct Bar {
 }
 
 impl fmt::Debug for Bar {
-    fn fmt(self: &'_ Self, f: &'_ mut fmt::Formatter<'_>)
+    fn fmt(&self, f: &'_ mut fmt::Formatter<'_>)
         ->
             fmt::Result {
         debug_struct_field2_finish(f, "Bar", "a", &self.a, "b", &&self.b)
diff --git a/tests/ui/unpretty/self-hir.rs b/tests/ui/unpretty/self-hir.rs
new file mode 100644
index 00000000000..448d828d444
--- /dev/null
+++ b/tests/ui/unpretty/self-hir.rs
@@ -0,0 +1,14 @@
+//@ compile-flags: -Zunpretty=hir
+//@ check-pass
+
+pub struct Bar {
+    a: String,
+    b: u8,
+}
+
+impl Bar {
+    fn imm_self(self) {}
+    fn mut_self(mut self) {}
+    fn refimm_self(&self) {}
+    fn refmut_self(&mut self) {}
+}
diff --git a/tests/ui/unpretty/self-hir.stdout b/tests/ui/unpretty/self-hir.stdout
new file mode 100644
index 00000000000..4da080dc611
--- /dev/null
+++ b/tests/ui/unpretty/self-hir.stdout
@@ -0,0 +1,18 @@
+#[prelude_import]
+use ::std::prelude::rust_2015::*;
+#[macro_use]
+extern crate std;
+//@ compile-flags: -Zunpretty=hir
+//@ check-pass
+
+struct Bar {
+    a: String,
+    b: u8,
+}
+
+impl Bar {
+    fn imm_self(self) { }
+    fn mut_self(mut self) { }
+    fn refimm_self(&self) { }
+    fn refmut_self(&mut self) { }
+}