Skip to content

Commit b477682

Browse files
committed
Fix unittests
1 parent 78ae8fe commit b477682

File tree

6 files changed

+8
-4
lines changed

6 files changed

+8
-4
lines changed

src/libsyntax/parse/parser.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,7 @@ impl<'a> Parser<'a> {
571571
label_sp
572572
};
573573
err.span_label(sp, &label_exp);
574-
if label_sp != self.span {
574+
if !sp.source_equal(&self.span) {
575575
err.span_label(self.span, &"unexpected token");
576576
}
577577
Err(err)

src/libsyntax_pos/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ impl Span {
8181

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

8888
/// Returns `self` if `self` is not the dummy span, and `other` otherwise.

src/test/ui/token/bounds-obj-parens.stderr

+1
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ error: expected one of `!` or `::`, found `<eof>`
55
| ^^^^ expected one of `!` or `::` here
66

77
error: aborting due to previous error
8+

src/test/ui/token/issue-10636-2.stderr

+1
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,4 @@ error: expected expression, found `)`
2525
error: main function not found
2626

2727
error: aborting due to 4 previous errors
28+

src/test/ui/token/macro-incomplete-parse.stderr

+1
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,4 @@ note: caused by the macro expansion here; the usage of `ignored_pat!` is likely
2929
| ^^^^^^^^^^^^^^
3030

3131
error: aborting due to 3 previous errors
32+
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
error: expected one of `!` or `::`, found `<eof>`
2-
--> ../../src/test/ui/token/trailing-plus-in-bounds.rs:19:1
2+
--> $DIR/trailing-plus-in-bounds.rs:19:1
33
|
44
19 | FAIL
55
| ^^^^ expected one of `!` or `::` here
66

77
error: aborting due to previous error
8+

0 commit comments

Comments
 (0)