about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorP1start <rewi-github@whanau.org>2014-12-23 13:13:49 +1300
committerP1start <rewi-github@whanau.org>2014-12-25 18:58:47 +1300
commitd9769ec3834b62318da892925dc24c8883bb1635 (patch)
tree0455c075f4c1d37151c726fbbf6621e55448c525 /src/test
parent7e11b22713aebd28ceaaa2ecef937c9b9d247c2f (diff)
downloadrust-d9769ec3834b62318da892925dc24c8883bb1635.tar.gz
rust-d9769ec3834b62318da892925dc24c8883bb1635.zip
Parse fully-qualified associated types in generics without whitespace
This breaks code that looks like this:

    let x = foo as bar << 13;

Change such code to look like this:

    let x = (foo as bar) << 13;

Closes #17362.

[breaking-change]
Diffstat (limited to 'src/test')
-rw-r--r--src/test/bench/shootout-reverse-complement.rs2
-rw-r--r--src/test/run-pass/parse-assoc-type-lt.rs18
2 files changed, 19 insertions, 1 deletions
diff --git a/src/test/bench/shootout-reverse-complement.rs b/src/test/bench/shootout-reverse-complement.rs
index d746ec1dbab..e0939dcb43b 100644
--- a/src/test/bench/shootout-reverse-complement.rs
+++ b/src/test/bench/shootout-reverse-complement.rs
@@ -62,7 +62,7 @@ impl Tables {
         }
         let mut table16 = [0;1 << 16];
         for (i, v) in table16.iter_mut().enumerate() {
-            *v = table8[i & 255] as u16 << 8 |
+            *v = (table8[i & 255] as u16) << 8 |
                  table8[i >> 8]  as u16;
         }
         Tables { table8: table8, table16: table16 }
diff --git a/src/test/run-pass/parse-assoc-type-lt.rs b/src/test/run-pass/parse-assoc-type-lt.rs
new file mode 100644
index 00000000000..8a68711a769
--- /dev/null
+++ b/src/test/run-pass/parse-assoc-type-lt.rs
@@ -0,0 +1,18 @@
+// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+#![feature(associated_types)]
+
+trait Foo {
+    type T;
+    fn foo() -> Box<<Self as Foo>::T>;
+}
+
+fn main() {}