about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/libsyntax/parse/parser.rs2
-rw-r--r--src/libsyntax_pos/lib.rs4
-rw-r--r--src/test/ui/token/bounds-obj-parens.stderr1
-rw-r--r--src/test/ui/token/issue-10636-2.stderr1
-rw-r--r--src/test/ui/token/macro-incomplete-parse.stderr1
-rw-r--r--src/test/ui/token/trailing-plus-in-bounds.stderr3
6 files changed, 8 insertions, 4 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index 4076368c180..8177d738dc8 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -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)
diff --git a/src/libsyntax_pos/lib.rs b/src/libsyntax_pos/lib.rs
index 07494ff904e..0662c1c9cfd 100644
--- a/src/libsyntax_pos/lib.rs
+++ b/src/libsyntax_pos/lib.rs
@@ -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.
diff --git a/src/test/ui/token/bounds-obj-parens.stderr b/src/test/ui/token/bounds-obj-parens.stderr
index ebee363f278..4d60be15eca 100644
--- a/src/test/ui/token/bounds-obj-parens.stderr
+++ b/src/test/ui/token/bounds-obj-parens.stderr
@@ -5,3 +5,4 @@ error: expected one of `!` or `::`, found `<eof>`
    | ^^^^ expected one of `!` or `::` here
 
 error: aborting due to previous error
+
diff --git a/src/test/ui/token/issue-10636-2.stderr b/src/test/ui/token/issue-10636-2.stderr
index 183ad30c4ef..b0bae1248b9 100644
--- a/src/test/ui/token/issue-10636-2.stderr
+++ b/src/test/ui/token/issue-10636-2.stderr
@@ -25,3 +25,4 @@ error: expected expression, found `)`
 error: main function not found
 
 error: aborting due to 4 previous errors
+
diff --git a/src/test/ui/token/macro-incomplete-parse.stderr b/src/test/ui/token/macro-incomplete-parse.stderr
index bea00a6444c..f23d97586b8 100644
--- a/src/test/ui/token/macro-incomplete-parse.stderr
+++ b/src/test/ui/token/macro-incomplete-parse.stderr
@@ -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
+
diff --git a/src/test/ui/token/trailing-plus-in-bounds.stderr b/src/test/ui/token/trailing-plus-in-bounds.stderr
index 74caf8f5c2b..c765a434b8a 100644
--- a/src/test/ui/token/trailing-plus-in-bounds.stderr
+++ b/src/test/ui/token/trailing-plus-in-bounds.stderr
@@ -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
+