1
Fork 0

Fix unittests

This commit is contained in:
Esteban Küber 2017-03-25 19:06:19 -07:00
parent 78ae8feebb
commit b477682dca
6 changed files with 8 additions and 4 deletions

View file

@ -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)

View file

@ -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.

View file

@ -5,3 +5,4 @@ error: expected one of `!` or `::`, found `<eof>`
| ^^^^ expected one of `!` or `::` here
error: aborting due to previous error

View file

@ -25,3 +25,4 @@ error: expected expression, found `)`
error: main function not found
error: aborting due to 4 previous errors

View file

@ -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

View file

@ -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