Skip to content

Commit

Permalink
Fix affected tests
Browse files Browse the repository at this point in the history
  • Loading branch information
estebank committed Jun 12, 2017
1 parent 3a7dbf4 commit 5fcfa08
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 13 deletions.
3 changes: 2 additions & 1 deletion src/libsyntax/parse/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2851,7 +2851,8 @@ impl<'a> Parser<'a> {
_ => "a type".to_string(),
};
err.span_suggestion(suggestion_span,
"if you want to compare the casted value then write",
"if you want to compare the casted value \
then write:",
suggestion);
err.level = Level::Warning;
err.set_message(&format!("`<` is interpreted as a start of generic \
Expand Down
2 changes: 1 addition & 1 deletion src/test/parse-fail/better-expected.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
// compile-flags: -Z parse-only

fn main() {
let x: [isize 3]; //~ ERROR expected one of `!`, `(`, `+`, `::`, `;`, `<`, or `]`, found `3`
let x: [isize 3]; //~ ERROR expected one of `!`, `(`, `+`, `::`, `;`, or `]`, found `3`
}
2 changes: 1 addition & 1 deletion src/test/parse-fail/bounds-type-where.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ type A where T: Trait + Trait = u8; // OK
type A where = u8; // OK
type A where T: Trait + = u8; // OK
type A where T, = u8;
//~^ ERROR expected one of `!`, `(`, `+`, `::`, `:`, `<`, `==`, or `=`, found `,`
//~^ ERROR expected one of `!`, `(`, `+`, `::`, `:`, `==`, or `=`, found `,`

fn main() {}
2 changes: 1 addition & 1 deletion src/test/parse-fail/closure-return-syntax.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@

fn main() {
let x = || -> i32 22;
//~^ ERROR expected one of `!`, `(`, `::`, `<`, or `{`, found `22`
//~^ ERROR expected one of `!`, `(`, `::`, or `{`, found `22`
}
2 changes: 1 addition & 1 deletion src/test/parse-fail/empty-impl-semicolon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@

// compile-flags: -Z parse-only

impl Foo; //~ ERROR expected one of `!`, `(`, `+`, `::`, `<`, `for`, `where`, or `{`, found `;`
impl Foo; //~ ERROR expected one of `!`, `(`, `+`, `::`, `for`, `where`, or `{`, found `;`
2 changes: 1 addition & 1 deletion src/test/parse-fail/multitrait.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ struct S {
}

impl Cmp, ToString for S {
//~^ ERROR: expected one of `!`, `(`, `+`, `::`, `<`, `for`, `where`, or `{`, found `,`
//~^ ERROR: expected one of `!`, `(`, `+`, `::`, `for`, `where`, or `{`, found `,`
fn eq(&&other: S) { false }
fn to_string(&self) -> String { "hi".to_string() }
}
2 changes: 1 addition & 1 deletion src/test/parse-fail/removed-syntax-closure-lifetime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
// compile-flags: -Z parse-only

type closure = Box<lt/fn()>;
//~^ ERROR expected one of `!`, `(`, `+`, `,`, `::`, `<`, or `>`, found `/`
//~^ ERROR expected one of `!`, `(`, `+`, `,`, `::`, or `>`, found `/`
2 changes: 1 addition & 1 deletion src/test/parse-fail/removed-syntax-fixed-vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@

// compile-flags: -Z parse-only

type v = [isize * 3]; //~ ERROR expected one of `!`, `(`, `+`, `::`, `;`, `<`, or `]`, found `*`
type v = [isize * 3]; //~ ERROR expected one of `!`, `(`, `+`, `::`, `;`, or `]`, found `*`
2 changes: 1 addition & 1 deletion src/test/parse-fail/removed-syntax-ptr-lifetime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@

// compile-flags: -Z parse-only

type bptr = &lifetime/isize; //~ ERROR expected one of `!`, `(`, `::`, `;`, or `<`, found `/`
type bptr = &lifetime/isize; //~ ERROR expected one of `!`, `(`, `::`, or `;`, found `/`
8 changes: 4 additions & 4 deletions src/test/ui/issue-22644.stderr
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
warning: `<` is interpreted as a start of generic arguments for `usize`, not comparison
warning: `<` is interpreted as a start of generic arguments for `usize`, not a comparison
--> $DIR/issue-22644.rs:16:33
|
16 | println!("{}", a as usize < b);
| ^ expected one of `!`, `(`, `+`, `,`, `::`, or `>` here
|
help: if you want to compare the casted value then write
help: if you want to compare the casted value then write:
| println!("{}", (a as usize) < b);

warning: `<` is interpreted as a start of generic arguments for `usize`, not comparison
warning: `<` is interpreted as a start of generic arguments for `usize`, not a comparison
--> $DIR/issue-22644.rs:17:33
|
17 | println!("{}", a as usize < 4);
| -^ unexpected token
| |
| expected one of `>`, identifier, lifetime, or type here
|
help: if you want to compare the casted value then write
help: if you want to compare the casted value then write:
| println!("{}", (a as usize) < 4);

0 comments on commit 5fcfa08

Please sign in to comment.