Skip to content

Commit

Permalink
Fix unittests
Browse files Browse the repository at this point in the history
  • Loading branch information
estebank committed Mar 28, 2017
1 parent 78ae8fe commit b477682
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/libsyntax/parse/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@ impl<'a> Parser<'a> {
label_sp
};
err.span_label(sp, &label_exp);
if label_sp != self.span {
if !sp.source_equal(&self.span) {
err.span_label(self.span, &"unexpected token");
}
Err(err)
Expand Down
4 changes: 2 additions & 2 deletions src/libsyntax_pos/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ impl Span {

/// Returns a new span representing the next character after the end-point of this span
pub fn next_point(self) -> Span {
let lo = BytePos(cmp::max(self.hi.0, self.lo.0 + 1));
Span { lo: lo, hi: lo, expn_id: self.expn_id}
let lo = cmp::max(self.hi.0, self.lo.0 + 1);
Span { lo: BytePos(lo), hi: BytePos(lo + 1), expn_id: self.expn_id}
}

/// Returns `self` if `self` is not the dummy span, and `other` otherwise.
Expand Down
1 change: 1 addition & 0 deletions src/test/ui/token/bounds-obj-parens.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ error: expected one of `!` or `::`, found `<eof>`
| ^^^^ expected one of `!` or `::` here

error: aborting due to previous error

1 change: 1 addition & 0 deletions src/test/ui/token/issue-10636-2.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,4 @@ error: expected expression, found `)`
error: main function not found

error: aborting due to 4 previous errors

1 change: 1 addition & 0 deletions src/test/ui/token/macro-incomplete-parse.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,4 @@ note: caused by the macro expansion here; the usage of `ignored_pat!` is likely
| ^^^^^^^^^^^^^^

error: aborting due to 3 previous errors

3 changes: 2 additions & 1 deletion src/test/ui/token/trailing-plus-in-bounds.stderr
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
error: expected one of `!` or `::`, found `<eof>`
--> ../../src/test/ui/token/trailing-plus-in-bounds.rs:19:1
--> $DIR/trailing-plus-in-bounds.rs:19:1
|
19 | FAIL
| ^^^^ expected one of `!` or `::` here

error: aborting due to previous error

0 comments on commit b477682

Please sign in to comment.