about summary refs log tree commit diff
path: root/src/test/compile-fail
diff options
context:
space:
mode:
authorNiko Matsakis <niko@alum.mit.edu>2017-04-11 16:58:04 -0400
committerNiko Matsakis <niko@alum.mit.edu>2017-04-11 20:32:47 -0400
commit14f1e3459f02e3ce45232a84cd923c86eef55cb5 (patch)
tree00999979b018118bab6c4610974e1f6eba5bf2ce /src/test/compile-fail
parent77d9e38e9499df1dac393937d62d3bf626c51abb (diff)
downloadrust-14f1e3459f02e3ce45232a84cd923c86eef55cb5.tar.gz
rust-14f1e3459f02e3ce45232a84cd923c86eef55cb5.zip
fix a bug in compiletest JSON parsing for duplicate errors
In some cases, we give multiple primary spans, in which case we would
report one `//~` annotation per primary span. That was very confusing
because these things are reported to the user as a single error.

UI tests would be better here.
Diffstat (limited to 'src/test/compile-fail')
-rw-r--r--src/test/compile-fail/binop-move-semantics.rs2
-rw-r--r--src/test/compile-fail/borrowck/borrowck-lend-flow-loop.rs1
-rw-r--r--src/test/compile-fail/borrowck/borrowck-mut-borrow-linear-errors.rs1
-rw-r--r--src/test/compile-fail/issue-25579.rs1
-rw-r--r--src/test/compile-fail/issue-38412.rs1
-rw-r--r--src/test/compile-fail/lint-unused-imports.rs1
6 files changed, 0 insertions, 7 deletions
diff --git a/src/test/compile-fail/binop-move-semantics.rs b/src/test/compile-fail/binop-move-semantics.rs
index 0cc6ea3e984..cff0064497a 100644
--- a/src/test/compile-fail/binop-move-semantics.rs
+++ b/src/test/compile-fail/binop-move-semantics.rs
@@ -62,7 +62,6 @@ fn mut_plus_immut() {
     &mut f
     +
     &f;  //~ ERROR: cannot borrow `f` as immutable because it is also borrowed as mutable
-    //~^ cannot borrow `f` as immutable because it is also borrowed as mutable
 }
 
 fn immut_plus_mut() {
@@ -71,7 +70,6 @@ fn immut_plus_mut() {
     &f
     +
     &mut f;  //~ ERROR: cannot borrow `f` as mutable because it is also borrowed as immutable
-    //~^ cannot borrow `f` as mutable because it is also borrowed as immutable
 }
 
 fn main() {}
diff --git a/src/test/compile-fail/borrowck/borrowck-lend-flow-loop.rs b/src/test/compile-fail/borrowck/borrowck-lend-flow-loop.rs
index 56cbe0b1878..f09e7ffd7e4 100644
--- a/src/test/compile-fail/borrowck/borrowck-lend-flow-loop.rs
+++ b/src/test/compile-fail/borrowck/borrowck-lend-flow-loop.rs
@@ -109,7 +109,6 @@ fn while_aliased_mut_cond(cond: bool, cond2: bool) {
         borrow(&*v); //~ ERROR cannot borrow
         if cond2 {
             x = &mut v; //~ ERROR cannot borrow
-            //~^ ERROR cannot borrow
         }
     }
 }
diff --git a/src/test/compile-fail/borrowck/borrowck-mut-borrow-linear-errors.rs b/src/test/compile-fail/borrowck/borrowck-mut-borrow-linear-errors.rs
index f789d44016e..38e0e27a7b9 100644
--- a/src/test/compile-fail/borrowck/borrowck-mut-borrow-linear-errors.rs
+++ b/src/test/compile-fail/borrowck/borrowck-mut-borrow-linear-errors.rs
@@ -19,7 +19,6 @@ fn main() {
         match 1 {
             1 => { addr = &mut x; }
             //~^ ERROR cannot borrow `x` as mutable more than once at a time
-            //~| ERROR cannot borrow `x` as mutable more than once at a time
             2 => { addr = &mut x; }
             //~^ ERROR cannot borrow `x` as mutable more than once at a time
             _ => { addr = &mut x; }
diff --git a/src/test/compile-fail/issue-25579.rs b/src/test/compile-fail/issue-25579.rs
index 849c9aa18c9..323ce3b0adf 100644
--- a/src/test/compile-fail/issue-25579.rs
+++ b/src/test/compile-fail/issue-25579.rs
@@ -17,7 +17,6 @@ fn causes_ice(mut l: &mut Sexpression) {
     loop { match l {
         &mut Sexpression::Num(ref mut n) => {},
         &mut Sexpression::Cons(ref mut expr) => { //~ ERROR cannot borrow `l.0`
-            //~| ERROR cannot borrow `l.0`
             l = &mut **expr; //~ ERROR cannot assign to `l`
         }
     }}
diff --git a/src/test/compile-fail/issue-38412.rs b/src/test/compile-fail/issue-38412.rs
index 3b62aaf2ab8..b4feadbacf7 100644
--- a/src/test/compile-fail/issue-38412.rs
+++ b/src/test/compile-fail/issue-38412.rs
@@ -11,7 +11,6 @@
 fn main() {
     let Box(a) = loop { };
     //~^ ERROR expected tuple struct/variant, found struct `Box`
-    //~| ERROR expected tuple struct/variant, found struct `Box`
 
     // (The below is a trick to allow compiler to infer a type for
     // variable `a` without attempting to ascribe a type to the
diff --git a/src/test/compile-fail/lint-unused-imports.rs b/src/test/compile-fail/lint-unused-imports.rs
index f6f7c210f46..5bb2ab75c53 100644
--- a/src/test/compile-fail/lint-unused-imports.rs
+++ b/src/test/compile-fail/lint-unused-imports.rs
@@ -21,7 +21,6 @@ use std::fmt::{};
 // Should get errors for both 'Some' and 'None'
 use std::option::Option::{Some, None};
 //~^ ERROR unused imports: `None`, `Some`
-//~| ERROR unused imports: `None`, `Some`
 
 use test::A;       //~ ERROR unused import: `test::A`
 // Be sure that if we just bring some methods into scope that they're also