about summary refs log tree commit diff
path: root/src/tools/rustfmt/tests
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-10-17 11:18:57 +0000
committerbors <bors@rust-lang.org>2024-10-17 11:18:57 +0000
commite09bf4c07af8a424f9022bfe8d42ec714a51f0be (patch)
tree0aa83217a4da4a550ed80601e35381bb06db1c33 /src/tools/rustfmt/tests
parentecf6fc5336a7fe24607b8c394f34a4fcd20079c8 (diff)
parent6e4f8fea36cd04f623c46d99adc3c370b1879883 (diff)
downloadrust-e09bf4c07af8a424f9022bfe8d42ec714a51f0be.tar.gz
rust-e09bf4c07af8a424f9022bfe8d42ec714a51f0be.zip
Auto merge of #18317 - lnicola:sync-from-rust, r=Veykril
minor: sync from downstream
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/anonymous-types.rs31
-rw-r--r--src/tools/rustfmt/tests/target/asyncness.rs2
-rw-r--r--src/tools/rustfmt/tests/target/pin_sugar.rs9
4 files changed, 21 insertions, 31 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/anonymous-types.rs b/src/tools/rustfmt/tests/target/anonymous-types.rs
deleted file mode 100644
index e8c2d83878c..00000000000
--- a/src/tools/rustfmt/tests/target/anonymous-types.rs
+++ /dev/null
@@ -1,31 +0,0 @@
-// Test for issue 85480
-// Pretty print anonymous struct and union types
-
-// pp-exact
-// pretty-compare-only
-
-struct Foo {
-    _: union  {
-        _: struct  {
-            a: u8,
-            b: u16,
-        },
-        c: u32,
-    },
-    d: u64,
-    e: f32,
-}
-
-// Test for https://github.com/rust-lang/rust/issues/117942
-struct Foo {
-    _: union  {
-        #[rustfmt::skip]
-    f: String,
-    },
-    #[rustfmt::skip]
-    _: struct {
-    g: i32,
-    },
-}
-
-fn main() {}
diff --git a/src/tools/rustfmt/tests/target/asyncness.rs b/src/tools/rustfmt/tests/target/asyncness.rs
index d91ac960499..dd651ed6a62 100644
--- a/src/tools/rustfmt/tests/target/asyncness.rs
+++ b/src/tools/rustfmt/tests/target/asyncness.rs
@@ -1,3 +1,5 @@
 // rustfmt-edition: 2018
 
 fn foo() -> impl async Fn() {}
+
+fn bar() -> impl for<'a> async Fn(&'a ()) {}
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) {}