about summary refs log tree commit diff
path: root/src/tools/rustfmt/tests
diff options
context:
space:
mode:
authorEric Holk <ericholk@microsoft.com>2024-09-23 16:07:31 -0700
committerEric Holk <ericholk@microsoft.com>2024-10-07 11:15:15 -0700
commit3aabe1e4a3518f943a20b692a0db90189fc5898c (patch)
tree90965363f251fa7004b8189b0888ebc867206ece /src/tools/rustfmt/tests
parentb490bf56b7da3a689f0ea7a46f56d7cd2339efb0 (diff)
downloadrust-3aabe1e4a3518f943a20b692a0db90189fc5898c.tar.gz
rust-3aabe1e4a3518f943a20b692a0db90189fc5898c.zip
Add basic pin sugar support to rustfmt
Diffstat (limited to 'src/tools/rustfmt/tests')
-rw-r--r--src/tools/rustfmt/tests/source/pin_sugar.rs10
-rw-r--r--src/tools/rustfmt/tests/target/pin_sugar.rs9
2 files changed, 19 insertions, 0 deletions
diff --git a/src/tools/rustfmt/tests/source/pin_sugar.rs b/src/tools/rustfmt/tests/source/pin_sugar.rs
new file mode 100644
index 00000000000..0eb3c0770c4
--- /dev/null
+++ b/src/tools/rustfmt/tests/source/pin_sugar.rs
@@ -0,0 +1,10 @@
+// See #130494
+
+#![feature(pin_ergonomics)]
+#![allow(incomplete_features)]
+
+fn f(x: &pin  const i32) {}
+fn g<'a>(x: &  'a pin const  i32) {}
+fn h<'a>(x: &  'a pin  
+mut i32) {}
+fn i(x: &pin      mut  i32) {}
diff --git a/src/tools/rustfmt/tests/target/pin_sugar.rs b/src/tools/rustfmt/tests/target/pin_sugar.rs
new file mode 100644
index 00000000000..c9fa883e238
--- /dev/null
+++ b/src/tools/rustfmt/tests/target/pin_sugar.rs
@@ -0,0 +1,9 @@
+// See #130494
+
+#![feature(pin_ergonomics)]
+#![allow(incomplete_features)]
+
+fn f(x: &pin const i32) {}
+fn g<'a>(x: &'a pin const i32) {}
+fn h<'a>(x: &'a pin mut i32) {}
+fn i(x: &pin mut i32) {}