]> git.lizzy.rs Git - rust.git/blobdiff - tests/source/expr.rs
Prevent duplicate comma when formatting struct pattern with ".."
[rust.git] / tests / source / expr.rs
index 7098d65f100b9dea3b24e4625e610fdfa4a83f68..21f8a4a43668a1905c55d82aef3e3d860c227f30 100644 (file)
@@ -218,6 +218,10 @@ fn returns() {
 fn addrof() {
     &    mut(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa+bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb);
     &    (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa+bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb);
+
+    // raw reference operator
+    & raw   const  a;
+    & raw   mut    b;
 }
 
 fn casts() {
@@ -450,3 +454,126 @@ fn issue_2802() {
         a: some_much_much_longer_value,
     }) * some_value
 }
+
+fn issue_3003() {
+    let mut path: PathBuf = [
+        env!("CARGO_MANIFEST_DIR"),
+        "tests",
+        "support",
+        "dejavu-fonts-ttf-2.37",
+        "ttf",
+    ]
+        .iter()
+        .collect();
+}
+
+fn issue3226() {
+    {
+        {
+            {
+                return Err(ErrorKind::ManagementInterfaceError("Server exited unexpectedly").into())
+            }
+        }
+    }
+    {
+        {
+            {
+                break Err(ErrorKind::ManagementInterfaceError("Server exited unexpectedlyy").into())
+            }
+        }
+    }
+}
+
+// #3457
+fn issue3457() {
+    {
+        {
+            {
+                {
+                    {
+                        {
+                            {
+                                {
+                                    {
+                                        {
+                                            {
+                                                {
+                                                    {
+                                                        {
+                                                            {
+                                                                {
+                                                                    {
+                                                                        {
+                                                                            {
+                                                                                {
+                                                                                    {
+                                                                                        {
+                                                                                            {
+                                                                                                {
+                                                                                                    println!("Test");
+                                                                                                }
+                                                                                            }
+                                                                                        }
+                                                                                    }
+                                                                                }
+                                                                            }
+                                                                        }
+                                                                    }
+                                                                }
+                                                            }
+                                                        }
+                                                    }
+                                                }
+                                            }
+                                        }
+                                    }
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+        }
+    }
+}
+
+// #3498
+static REPRO: &[usize] = &[#[cfg(feature = "zero")]
+                           0];
+
+fn overflow_with_attr() {
+    foo(#[cfg(feature = "zero")]
+        0);
+    foobar(#[cfg(feature = "zero")]
+           0);
+    foobar(x, y, #[cfg(feature = "zero")]
+           {});
+}
+
+
+// https://github.com/rust-lang/rustfmt/issues/3765
+fn foo() {
+    async {
+        // Do
+        // some
+        // work
+    }
+    .await;
+
+    async {
+        // Do
+        // some
+        // work
+    }
+        .await;
+}
+
+fn underscore() {
+        _= 1;
+        _;
+        [  _,a,_  ] = [1, 2, 3];
+    (a,   _) = (8, 9);
+    TupleStruct(  _, a) = TupleStruct(2, 2);
+
+    let _  : usize = foo(_, _);
+}