1
Fork 0

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.
This commit is contained in:
bors 2015-01-03 03:25:21 +00:00
commit 9c3e6082e7
10 changed files with 53 additions and 59 deletions

View file

@ -56,10 +56,10 @@ pub enum InAddr {
pub fn ip_to_inaddr(ip: IpAddr) -> InAddr {
match ip {
Ipv4Addr(a, b, c, d) => {
let ip = (a as u32 << 24) |
(b as u32 << 16) |
(c as u32 << 8) |
(d as u32 << 0);
let ip = ((a as u32) << 24) |
((b as u32) << 16) |
((c as u32) << 8) |
((d as u32) << 0);
In4Addr(libc::in_addr {
s_addr: Int::from_be(ip)
})