about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorMarcus Klaas de Vries <mail@marcusklaas.nl>2016-03-24 14:57:24 +0100
committerMarcus Klaas de Vries <mail@marcusklaas.nl>2016-03-24 14:57:24 +0100
commit8fd95df54ab5de3dddfd47d8ae9fc52fea803844 (patch)
treeab37e6eb43e62a29ac7f06329f42524708659cd2 /tests
parentca757183fedf8e89286372b91ca074c11d99c4f4 (diff)
parent9d8ce544283fd18cf1bfd6285a9dcce19aabbfea (diff)
Merge pull request #868 from rust-lang-nursery/tuple-wide
Don't apply the function args heuristic to tuple lits.
Diffstat (limited to 'tests')
-rw-r--r--tests/source/issue-510.rs1
-rw-r--r--tests/system.rs3
-rw-r--r--tests/target/closure.rs3
-rw-r--r--tests/target/issue-510.rs65
-rw-r--r--tests/target/match.rs26
-rw-r--r--tests/target/tuple.rs7
6 files changed, 39 insertions, 66 deletions
diff --git a/tests/source/issue-510.rs b/tests/source/issue-510.rs
index faf3d657ada..8f56be02e32 100644
--- a/tests/source/issue-510.rs
+++ b/tests/source/issue-510.rs
@@ -19,7 +19,6 @@ let inline_size = block.get_shrink_to_fit_inline_size(available_inline_size -
 }
 };
 
-// FIXME(#501): tuple width heuristic may not be optimal for patterns.
         let (inline_start, inline_size, margin_inline_start, margin_inline_end) =
             match (inline_start, inline_end, computed_inline_size) {
                 (MaybeAuto::Auto, MaybeAuto::Auto, MaybeAuto::Auto) => {
diff --git a/tests/system.rs b/tests/system.rs
index bc5298ae22d..eac45b83ca0 100644
--- a/tests/system.rs
+++ b/tests/system.rs
@@ -305,8 +305,7 @@ fn get_target(file_name: &str, target: Option<&str>, write_mode: Option<WriteMod
     let file_path = Path::new(file_name);
     let (source_path_prefix, target_path_prefix) = match write_mode {
         Some(WriteMode::Coverage) => {
-            (Path::new("tests/coverage-source/"),
-             "tests/coverage-target/")
+            (Path::new("tests/coverage-source/"), "tests/coverage-target/")
         }
         _ => (Path::new("tests/source/"), "tests/target/"),
     };
diff --git a/tests/target/closure.rs b/tests/target/closure.rs
index 6ab217ed6c4..382919ce403 100644
--- a/tests/target/closure.rs
+++ b/tests/target/closure.rs
@@ -9,8 +9,7 @@ fn main() {
                      b: WithType, // argument
                      // ignored
                      _| {
-        (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
-         bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb)
+        (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb)
     };
 
     let block_body = move |xxxxxxxxxxxxxxxxxxxxxxxxxxxxx,
diff --git a/tests/target/issue-510.rs b/tests/target/issue-510.rs
index 5b427ef1402..5b5860998fa 100644
--- a/tests/target/issue-510.rs
+++ b/tests/target/issue-510.rs
@@ -4,40 +4,37 @@ impl ISizeAndMarginsComputer for AbsoluteNonReplaced {
                                      input: &ISizeConstraintInput)
                                      -> ISizeConstraintSolution {
 
-        let (inline_start,
-             inline_size,
-             margin_inline_start,
-             margin_inline_end) = match (inline_startssssssxxxxxxsssssxxxxxxxxxssssssxxx,
-                                         inline_startssssssxxxxxxsssssxxxxxxxxxssssssxxx) {
-            (MaybeAuto::Auto, MaybeAuto::Auto, MaybeAuto::Auto) => {
-                let margin_start = inline_start_margin.specified_or_zero();
-                let margin_end = inline_end_margin.specified_or_zero();
-                // Now it is the same situation as inline-start Specified and inline-end
-                // and inline-size Auto.
-                //
-                // Set inline-end to zero to calculate inline-size.
-                let inline_size = block.get_shrink_to_fit_inline_size(available_inline_size -
-                                                                      (margin_start + margin_end));
-                (Au(0), inline_size, margin_start, margin_end)
-            }
-        };
+        let (inline_start, inline_size, margin_inline_start, margin_inline_end) =
+            match (inline_startssssssxxxxxxsssssxxxxxxxxxssssssxxx,
+                   inline_startssssssxxxxxxsssssxxxxxxxxxssssssxxx) {
+                (MaybeAuto::Auto, MaybeAuto::Auto, MaybeAuto::Auto) => {
+                    let margin_start = inline_start_margin.specified_or_zero();
+                    let margin_end = inline_end_margin.specified_or_zero();
+                    // Now it is the same situation as inline-start Specified and inline-end
+                    // and inline-size Auto.
+                    //
+                    // Set inline-end to zero to calculate inline-size.
+                    let inline_size = block.get_shrink_to_fit_inline_size(available_inline_size -
+                                                                          (margin_start +
+                                                                           margin_end));
+                    (Au(0), inline_size, margin_start, margin_end)
+                }
+            };
 
-        // FIXME(#501): tuple width heuristic may not be optimal for patterns.
-        let (inline_start,
-             inline_size,
-             margin_inline_start,
-             margin_inline_end) = match (inline_start, inline_end, computed_inline_size) {
-            (MaybeAuto::Auto, MaybeAuto::Auto, MaybeAuto::Auto) => {
-                let margin_start = inline_start_margin.specified_or_zero();
-                let margin_end = inline_end_margin.specified_or_zero();
-                // Now it is the same situation as inline-start Specified and inline-end
-                // and inline-size Auto.
-                //
-                // Set inline-end to zero to calculate inline-size.
-                let inline_size = block.get_shrink_to_fit_inline_size(available_inline_size -
-                                                                      (margin_start + margin_end));
-                (Au(0), inline_size, margin_start, margin_end)
-            }
-        };
+        let (inline_start, inline_size, margin_inline_start, margin_inline_end) =
+            match (inline_start, inline_end, computed_inline_size) {
+                (MaybeAuto::Auto, MaybeAuto::Auto, MaybeAuto::Auto) => {
+                    let margin_start = inline_start_margin.specified_or_zero();
+                    let margin_end = inline_end_margin.specified_or_zero();
+                    // Now it is the same situation as inline-start Specified and inline-end
+                    // and inline-size Auto.
+                    //
+                    // Set inline-end to zero to calculate inline-size.
+                    let inline_size = block.get_shrink_to_fit_inline_size(available_inline_size -
+                                                                          (margin_start +
+                                                                           margin_end));
+                    (Au(0), inline_size, margin_start, margin_end)
+                }
+            };
     }
 }
diff --git a/tests/target/match.rs b/tests/target/match.rs
index defcc13ef51..ed571d32123 100644
--- a/tests/target/match.rs
+++ b/tests/target/match.rs
@@ -32,16 +32,7 @@ fn foo() {
         }
 
         // Test that earlier patterns can take the guard space
-        (aaaa,
-         bbbbb,
-         ccccccc,
-         aaaaa,
-         bbbbbbbb,
-         cccccc,
-         aaaa,
-         bbbbbbbb,
-         cccccc,
-         dddddd) |
+        (aaaa, bbbbb, ccccccc, aaaaa, bbbbbbbb, cccccc, aaaa, bbbbbbbb, cccccc, dddddd) |
         Patternnnnnnnnnnnnnnnnnnnnnnnnn if loooooooooooooooooooooooooooooooooooooooooong_guard => {}
 
         _ => {}
@@ -75,22 +66,13 @@ fn main() {
 fn main() {
     match r {
         Variableeeeeeeeeeeeeeeeee => {
-            ("variable",
-             vec!["id", "name", "qualname", "value", "type", "scopeid"],
-             true,
-             true)
+            ("variable", vec!["id", "name", "qualname", "value", "type", "scopeid"], true, true)
         }
         Enummmmmmmmmmmmmmmmmmmmm => {
-            ("enum",
-             vec!["id", "qualname", "scopeid", "value"],
-             true,
-             true)
+            ("enum", vec!["id", "qualname", "scopeid", "value"], true, true)
         }
         Variantttttttttttttttttttttttt => {
-            ("variant",
-             vec!["id", "name", "qualname", "type", "value", "scopeid"],
-             true,
-             true)
+            ("variant", vec!["id", "name", "qualname", "type", "value", "scopeid"], true, true)
         }
     };
 
diff --git a/tests/target/tuple.rs b/tests/target/tuple.rs
index f2c929dde6d..a5bcc7f701a 100644
--- a/tests/target/tuple.rs
+++ b/tests/target/tuple.rs
@@ -2,9 +2,7 @@
 
 fn foo() {
     let a = (a, a, a, a, a);
-    let aaaaaaaaaaaaaaaa = (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
-                            aaaaaaaaaaaaaa,
-                            aaaaaaaaaaaaaa);
+    let aaaaaaaaaaaaaaaa = (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaa, aaaaaaaaaaaaaa);
     let aaaaaaaaaaaaaaaaaaaaaa = (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
                                   aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
                                   aaaaaaaaaaaaaaaaaaaaaaaaa,
@@ -26,7 +24,6 @@ fn a() {
 }
 
 fn b() {
-    ((bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb,
-      bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb),
+    ((bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb, bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb),
      bbbbbbbbbbbbbbbbbb)
 }