Skip to content

Commit

Permalink
Rollup merge of rust-lang#23930 - petrochenkov:issue23656, r=nrc
Browse files Browse the repository at this point in the history
Fixes rust-lang#22757
Fixes rust-lang#22972
Fixes rust-lang#23044
Fixes rust-lang#23151
Fixes rust-lang#23597
Fixes rust-lang#23656
Fixes rust-lang#23929
It also fixes some other corner cases in range patterns, like incorrect spans or not accepting global paths after `...`.

It passes `make check` but needs some additional tests (then it will fix rust-lang#22546 as well), I'll write them today or tomorrow.
  • Loading branch information
Manishearth committed Apr 3, 2015
2 parents 2615106 + 76567a6 commit 819dc66
Show file tree
Hide file tree
Showing 10 changed files with 138 additions and 234 deletions.
354 changes: 129 additions & 225 deletions src/libsyntax/parse/parser.rs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/test/compile-fail/issue-22426-1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
fn main() {
match 42 {
x < 7 => (),
//~^ error: unexpected token: `<`
//~^ error: expected one of `=>`, `@`, `if`, or `|`, found `<`
_ => ()
}
}
2 changes: 1 addition & 1 deletion src/test/compile-fail/issue-22426-2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
// except according to those terms.

fn a(B<) {}
//~^ error: unexpected token: `<`
//~^ error: expected one of `:` or `@`, found `<`
2 changes: 1 addition & 1 deletion src/test/compile-fail/issue-22426-3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ impl<T> Foo<T> {
fn foo(&self) {
match *self {
Foo<T>(x, y) => {
//~^ error: unexpected token: `<`
//~^ error: expected one of `=>`, `@`, `if`, or `|`, found `<`
println!("Goodbye, World!")
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/test/parse-fail/issue-22647.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
// except according to those terms.

fn main() {
let caller<F> = |f: F| //~ ERROR unexpected token: `<`
let caller<F> = |f: F| //~ ERROR expected one of `:`, `;`, `=`, or `@`, found `<`
where F: Fn() -> i32
{
let x = f();
Expand Down
2 changes: 1 addition & 1 deletion src/test/parse-fail/issue-22712.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ struct Foo<B> {
}

fn bar() {
let Foo<Vec<u8>> //~ ERROR unexpected token: `<`
let Foo<Vec<u8>> //~ ERROR expected one of `:`, `;`, `=`, or `@`, found `<`
}

fn main() {}
2 changes: 1 addition & 1 deletion src/test/parse-fail/match-vec-invalid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
fn main() {
let a = Vec::new();
match a {
[1, tail.., tail..] => {}, //~ ERROR: expected one of `!`, `,`, or `@`, found `..`
[1, tail.., tail..] => {}, //~ ERROR: expected one of `,` or `@`, found `..`
_ => ()
}
}
2 changes: 1 addition & 1 deletion src/test/parse-fail/omitted-arg-in-item-fn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

fn foo(x) { //~ ERROR expected one of `!`, `:`, or `@`, found `)`
fn foo(x) { //~ ERROR expected one of `:` or `@`, found `)`
}
2 changes: 1 addition & 1 deletion src/test/parse-fail/removed-syntax-larrow-init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
fn removed_moves() {
let mut x = 0;
let y <- x;
//~^ ERROR expected one of `!`, `:`, `;`, `=`, or `@`, found `<-`
//~^ ERROR expected one of `:`, `;`, `=`, or `@`, found `<-`
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ struct Foo {

fn main() {
match Foo {
x: 3 //~ ERROR expected one of `!`, `=>`, `@`, `if`, or `|`, found `:`
x: 3 //~ ERROR expected one of `=>`, `@`, `if`, or `|`, found `:`
} {
Foo {
x: x
Expand Down

0 comments on commit 819dc66

Please sign in to comment.