about summary refs log tree commit diff
diff options
context:
space:
mode:
authoryukang <moorekang@gmail.com>2023-03-15 07:10:59 +0800
committeryukang <moorekang@gmail.com>2023-05-01 16:15:17 +0800
commita74d2d7440003ada5c88fc75c4eb468335afa618 (patch)
treea038768fa5d04ac42870c6b18d04f5e0488d9db0
parent6b9c151686baf6705b4bcfb6ce3db86bc817a9b3 (diff)
downloadrust-a74d2d7440003ada5c88fc75c4eb468335afa618.tar.gz
rust-a74d2d7440003ada5c88fc75c4eb468335afa618.zip
fix tests
-rw-r--r--tests/source/type-ascription.rs10
-rw-r--r--tests/target/configs/format_macro_bodies/true.rs8
-rw-r--r--tests/target/configs/format_macro_matchers/false.rs8
-rw-r--r--tests/target/configs/format_macro_matchers/true.rs8
-rw-r--r--tests/target/macros.rs22
-rw-r--r--tests/target/type-ascription.rs11
-rw-r--r--tests/target/type.rs2
7 files changed, 27 insertions, 42 deletions
diff --git a/tests/source/type-ascription.rs b/tests/source/type-ascription.rs
index 4874094ccc4..fbdde272cb6 100644
--- a/tests/source/type-ascription.rs
+++ b/tests/source/type-ascription.rs
@@ -1,10 +1,10 @@
-
+// #101728, we remove type ascription, so this test case is changed to `var as ty`
 fn main() {
-    let xxxxxxxxxxx = yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy  :  SomeTrait<AA, BB, CC>;
+    let xxxxxxxxxxx = yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy as SomeTrait<AA, BB, CC>;
 
-    let xxxxxxxxxxxxxxx = yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy: AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA;
+    let xxxxxxxxxxxxxxx = yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy as AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA;
 
-    let z = funk(yyyyyyyyyyyyyyy, zzzzzzzzzzzzzzzz, wwwwww): AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA;
+    let z = funk(yyyyyyyyyyyyyyy, zzzzzzzzzzzzzzzz, wwwwww) as AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA;
 
-    x : u32 - 1u32 / 10f32 : u32
+    let _ = x as u32 - 1u32 / (10f32 as u32);
 }
diff --git a/tests/target/configs/format_macro_bodies/true.rs b/tests/target/configs/format_macro_bodies/true.rs
index 9dc2524c389..17ac1498c93 100644
--- a/tests/target/configs/format_macro_bodies/true.rs
+++ b/tests/target/configs/format_macro_bodies/true.rs
@@ -1,10 +1,6 @@
 // rustfmt-format_macro_bodies: true
 
 macro_rules! foo {
-    ($a: ident : $b: ty) => {
-        $a(42): $b;
-    };
-    ($a: ident $b: ident $c: ident) => {
-        $a = $b + $c;
-    };
+    ($a: ident : $b: ty) => { $a(42): $b; };
+    ($a: ident $b: ident $c: ident) => { $a=$b+$c; };
 }
diff --git a/tests/target/configs/format_macro_matchers/false.rs b/tests/target/configs/format_macro_matchers/false.rs
index 3966d21be75..01ecac9879d 100644
--- a/tests/target/configs/format_macro_matchers/false.rs
+++ b/tests/target/configs/format_macro_matchers/false.rs
@@ -1,10 +1,6 @@
 // rustfmt-format_macro_matchers: false
 
 macro_rules! foo {
-    ($a: ident : $b: ty) => {
-        $a(42): $b;
-    };
-    ($a: ident $b: ident $c: ident) => {
-        $a = $b + $c;
-    };
+    ($a: ident : $b: ty) => { $a(42): $b; };
+    ($a: ident $b: ident $c: ident) => { $a=$b+$c; };
 }
diff --git a/tests/target/configs/format_macro_matchers/true.rs b/tests/target/configs/format_macro_matchers/true.rs
index e113af96f26..fa0442e228a 100644
--- a/tests/target/configs/format_macro_matchers/true.rs
+++ b/tests/target/configs/format_macro_matchers/true.rs
@@ -1,10 +1,6 @@
 // rustfmt-format_macro_matchers: true
 
 macro_rules! foo {
-    ($a:ident : $b:ty) => {
-        $a(42): $b;
-    };
-    ($a:ident $b:ident $c:ident) => {
-        $a = $b + $c;
-    };
+    ($a: ident : $b: ty) => { $a(42): $b; };
+    ($a: ident $b: ident $c: ident) => { $a=$b+$c; };
 }
diff --git a/tests/target/macros.rs b/tests/target/macros.rs
index e930b5037d9..7b4574349df 100644
--- a/tests/target/macros.rs
+++ b/tests/target/macros.rs
@@ -122,7 +122,7 @@ fn main() {
         20, 21, 22);
 
     // #1092
-    chain!(input, a: take!(max_size), || []);
+    chain!(input, a:take!(max_size), || []);
 
     // #2727
     foo!("bar");
@@ -156,17 +156,13 @@ fn issue1178() {
 }
 
 fn issue1739() {
-    sql_function!(
-        add_rss_item,
-        add_rss_item_t,
-        (
-            a: types::Integer,
-            b: types::Timestamptz,
-            c: types::Text,
-            d: types::Text,
-            e: types::Text
-        )
-    );
+    sql_function!(add_rss_item,
+                  add_rss_item_t,
+                  (a: types::Integer,
+                   b: types::Timestamptz,
+                   c: types::Text,
+                   d: types::Text,
+                   e: types::Text));
 
     w.slice_mut(s![
         ..,
@@ -232,7 +228,7 @@ fn issue_3174() {
             "debugMessage": debug.message,
         })
     } else {
-        json!({ "errorKind": format!("{:?}", error.err_kind()) })
+        json!({"errorKind": format!("{:?}", error.err_kind())})
     };
 }
 
diff --git a/tests/target/type-ascription.rs b/tests/target/type-ascription.rs
index a2f082ba4b4..99dc0336864 100644
--- a/tests/target/type-ascription.rs
+++ b/tests/target/type-ascription.rs
@@ -1,12 +1,13 @@
+// #101728, we remove type ascription, so this test case is changed to `var as ty`
 fn main() {
     let xxxxxxxxxxx =
-        yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy: SomeTrait<AA, BB, CC>;
+        yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy as SomeTrait<AA, BB, CC>;
 
     let xxxxxxxxxxxxxxx =
-        yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy: AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA;
+        yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy as AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA;
 
-    let z = funk(yyyyyyyyyyyyyyy, zzzzzzzzzzzzzzzz, wwwwww):
-        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA;
+    let z = funk(yyyyyyyyyyyyyyy, zzzzzzzzzzzzzzzz, wwwwww)
+        as AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA;
 
-    x: u32 - 1u32 / 10f32: u32
+    let _ = x as u32 - 1u32 / (10f32 as u32);
 }
diff --git a/tests/target/type.rs b/tests/target/type.rs
index 38cf909c258..c789ecb055a 100644
--- a/tests/target/type.rs
+++ b/tests/target/type.rs
@@ -129,7 +129,7 @@ fn issue3117() {
 fn issue3139() {
     assert_eq!(
         to_json_value(&None::<i32>).unwrap(),
-        json!({ "test": None::<i32> })
+        json!(  { "test": None  ::  <i32> }  )
     );
 }