about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2015-01-03 03:25:21 +0000
committerbors <bors@rust-lang.org>2015-01-03 03:25:21 +0000
commit9c3e6082e71618c088afd93f7a4a9a7708c9dcbd (patch)
tree7f0a4f049f87f845a99751add69cda3409a91c20 /src/test
parenta6b109723aa78154ffcfa4db80f3f36b76a9c0a7 (diff)
parentd9769ec3834b62318da892925dc24c8883bb1635 (diff)
downloadrust-9c3e6082e71618c088afd93f7a4a9a7708c9dcbd.tar.gz
rust-9c3e6082e71618c088afd93f7a4a9a7708c9dcbd.zip
auto merge of #20154 : P1start/rust/qualified-assoc-type-generics, r=nikomatsakis
This modifies `Parser::eat_lt` to always split up `<<`s, instead of doing so only when a lifetime name followed or the `force` parameter (now removed) was `true`. This is because `Foo<<TYPE` is now a valid start to a type, whereas previously only `Foo<<LIFETIME` was valid.

This is a [breaking-change]. Change code that looks like this:

```rust
let x = foo as bar << 13;
```

to use parentheses, like this:

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

Closes #17362.
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 d9dfd65d5b3..a1386843303 100644
--- a/src/test/bench/shootout-reverse-complement.rs
+++ b/src/test/bench/shootout-reverse-complement.rs
@@ -63,7 +63,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() {}