Fix unittests
This commit is contained in:
parent
78ae8feebb
commit
b477682dca
6 changed files with 8 additions and 4 deletions
|
@ -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)
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -5,3 +5,4 @@ error: expected one of `!` or `::`, found `<eof>`
|
|||
| ^^^^ expected one of `!` or `::` here
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
@ -25,3 +25,4 @@ error: expected expression, found `)`
|
|||
error: main function not found
|
||||
|
||||
error: aborting due to 4 previous errors
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue