about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorNiko Matsakis <niko@alum.mit.edu>2018-04-18 19:58:22 -0400
committerNiko Matsakis <niko@alum.mit.edu>2018-04-23 13:28:14 -0400
commit7173fd78c62c84dffbf0c05c895a2ec57fe170af (patch)
tree2902f9ef428d2423a553c7159e6d45383d92b099 /src/test
parent94639ca40697b0cb06a6c6ec77c42ec152b9b899 (diff)
downloadrust-7173fd78c62c84dffbf0c05c895a2ec57fe170af.tar.gz
rust-7173fd78c62c84dffbf0c05c895a2ec57fe170af.zip
in unit tests, use `note` to dump multiple program clauses
(rather than issuing multiple errors)

Also, reorder so that the annotations are considered "used" when the
lint runs.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/ui/chalkify/lower_impl.rs4
-rw-r--r--src/test/ui/chalkify/lower_impl.stderr12
-rw-r--r--src/test/ui/chalkify/lower_trait.rs5
-rw-r--r--src/test/ui/chalkify/lower_trait.stderr27
-rw-r--r--src/test/ui/chalkify/lower_trait_higher_rank.rs5
-rw-r--r--src/test/ui/chalkify/lower_trait_higher_rank.stderr27
-rw-r--r--src/test/ui/chalkify/lower_trait_where_clause.rs8
-rw-r--r--src/test/ui/chalkify/lower_trait_where_clause.stderr50
8 files changed, 38 insertions, 100 deletions
diff --git a/src/test/ui/chalkify/lower_impl.rs b/src/test/ui/chalkify/lower_impl.rs
index 671d77efbea..b38b87cdb12 100644
--- a/src/test/ui/chalkify/lower_impl.rs
+++ b/src/test/ui/chalkify/lower_impl.rs
@@ -12,7 +12,7 @@
 
 trait Foo { }
 
-#[rustc_dump_program_clauses] //~ ERROR Implemented(T: Foo) :-
+#[rustc_dump_program_clauses] //~ ERROR program clause dump
 impl<T: 'static> Foo for T where T: Iterator<Item = i32> { }
 
 trait Bar {
@@ -20,7 +20,7 @@ trait Bar {
 }
 
 impl<T> Bar for T where T: Iterator<Item = i32> {
-    #[rustc_dump_program_clauses] //~ ERROR Normalize(<T as Bar>::Assoc == std::vec::Vec<T>) :-
+    #[rustc_dump_program_clauses] //~ ERROR program clause dump
     type Assoc = Vec<T>;
 }
 
diff --git a/src/test/ui/chalkify/lower_impl.stderr b/src/test/ui/chalkify/lower_impl.stderr
index f253f9847d1..c497d76f8d4 100644
--- a/src/test/ui/chalkify/lower_impl.stderr
+++ b/src/test/ui/chalkify/lower_impl.stderr
@@ -1,14 +1,18 @@
-error: Implemented(T: Foo) :- ProjectionEq(<T as std::iter::Iterator>::Item == i32), TypeOutlives(T : 'static), Implemented(T: std::iter::Iterator), Implemented(T: std::marker::Sized).
+error: program clause dump
   --> $DIR/lower_impl.rs:15:1
    |
-LL | #[rustc_dump_program_clauses] //~ ERROR Implemented(T: Foo) :-
+LL | #[rustc_dump_program_clauses] //~ ERROR program clause dump
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: Implemented(T: Foo) :- ProjectionEq(<T as std::iter::Iterator>::Item == i32), TypeOutlives(T : 'static), Implemented(T: std::iter::Iterator), Implemented(T: std::marker::Sized).
 
-error: Normalize(<T as Bar>::Assoc == std::vec::Vec<T>) :- Implemented(T: Bar).
+error: program clause dump
   --> $DIR/lower_impl.rs:23:5
    |
-LL |     #[rustc_dump_program_clauses] //~ ERROR Normalize(<T as Bar>::Assoc == std::vec::Vec<T>) :-
+LL |     #[rustc_dump_program_clauses] //~ ERROR program clause dump
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: Normalize(<T as Bar>::Assoc == std::vec::Vec<T>) :- Implemented(T: Bar).
 
 error: aborting due to 2 previous errors
 
diff --git a/src/test/ui/chalkify/lower_trait.rs b/src/test/ui/chalkify/lower_trait.rs
index 74feb0105cc..7c0f233a645 100644
--- a/src/test/ui/chalkify/lower_trait.rs
+++ b/src/test/ui/chalkify/lower_trait.rs
@@ -10,10 +10,7 @@
 
 #![feature(rustc_attrs)]
 
-#[rustc_dump_program_clauses] //~ ERROR Implemented(Self: Foo<S, T, U>) :-
-                              //~| ERROR FromEnv
-                              //~| ERROR FromEnv
-                              //~| ERROR FromEnv
+#[rustc_dump_program_clauses] //~ ERROR program clause dump
 trait Foo<S, T, U> {
     fn s(S) -> S;
     fn t(T) -> T;
diff --git a/src/test/ui/chalkify/lower_trait.stderr b/src/test/ui/chalkify/lower_trait.stderr
index 45753c3bb90..2bd836a8fc1 100644
--- a/src/test/ui/chalkify/lower_trait.stderr
+++ b/src/test/ui/chalkify/lower_trait.stderr
@@ -1,26 +1,13 @@
-error: Implemented(Self: Foo<S, T, U>) :- FromEnv(Self: Foo<S, T, U>).
+error: program clause dump
   --> $DIR/lower_trait.rs:13:1
    |
-LL | #[rustc_dump_program_clauses] //~ ERROR Implemented(Self: Foo<S, T, U>) :-
+LL | #[rustc_dump_program_clauses] //~ ERROR program clause dump
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error: FromEnv(S: std::marker::Sized) :- FromEnv(Self: Foo<S, T, U>).
-  --> $DIR/lower_trait.rs:13:1
-   |
-LL | #[rustc_dump_program_clauses] //~ ERROR Implemented(Self: Foo<S, T, U>) :-
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error: FromEnv(T: std::marker::Sized) :- FromEnv(Self: Foo<S, T, U>).
-  --> $DIR/lower_trait.rs:13:1
    |
-LL | #[rustc_dump_program_clauses] //~ ERROR Implemented(Self: Foo<S, T, U>) :-
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error: FromEnv(U: std::marker::Sized) :- FromEnv(Self: Foo<S, T, U>).
-  --> $DIR/lower_trait.rs:13:1
-   |
-LL | #[rustc_dump_program_clauses] //~ ERROR Implemented(Self: Foo<S, T, U>) :-
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   = note: Implemented(Self: Foo<S, T, U>) :- FromEnv(Self: Foo<S, T, U>).
+   = note: FromEnv(S: std::marker::Sized) :- FromEnv(Self: Foo<S, T, U>).
+   = note: FromEnv(T: std::marker::Sized) :- FromEnv(Self: Foo<S, T, U>).
+   = note: FromEnv(U: std::marker::Sized) :- FromEnv(Self: Foo<S, T, U>).
 
-error: aborting due to 4 previous errors
+error: aborting due to previous error
 
diff --git a/src/test/ui/chalkify/lower_trait_higher_rank.rs b/src/test/ui/chalkify/lower_trait_higher_rank.rs
index e5eaf4591ec..47e9398d364 100644
--- a/src/test/ui/chalkify/lower_trait_higher_rank.rs
+++ b/src/test/ui/chalkify/lower_trait_higher_rank.rs
@@ -10,10 +10,7 @@
 
 #![feature(rustc_attrs)]
 
-#[rustc_dump_program_clauses] //~ ERROR Implemented(Self: Foo<F>) :-
-                              //~| ERROR FromEnv
-                              //~| ERROR FromEnv
-                              //~| ERROR FromEnv
+#[rustc_dump_program_clauses] //~ ERROR program clause dump
 trait Foo<F> where for<'a> F: Fn(&'a (u8, u16)) -> &'a u8
 {
     fn s(F) -> F;
diff --git a/src/test/ui/chalkify/lower_trait_higher_rank.stderr b/src/test/ui/chalkify/lower_trait_higher_rank.stderr
index 9aed0c018c9..11dc8740180 100644
--- a/src/test/ui/chalkify/lower_trait_higher_rank.stderr
+++ b/src/test/ui/chalkify/lower_trait_higher_rank.stderr
@@ -1,26 +1,13 @@
-error: Implemented(Self: Foo<F>) :- FromEnv(Self: Foo<F>).
+error: program clause dump
   --> $DIR/lower_trait_higher_rank.rs:13:1
    |
-LL | #[rustc_dump_program_clauses] //~ ERROR Implemented(Self: Foo<F>) :-
+LL | #[rustc_dump_program_clauses] //~ ERROR program clause dump
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error: FromEnv(F: std::marker::Sized) :- FromEnv(Self: Foo<F>).
-  --> $DIR/lower_trait_higher_rank.rs:13:1
-   |
-LL | #[rustc_dump_program_clauses] //~ ERROR Implemented(Self: Foo<F>) :-
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error: FromEnv(F: std::ops::Fn<(&'a (u8, u16),)>) :- FromEnv(Self: Foo<F>).
-  --> $DIR/lower_trait_higher_rank.rs:13:1
    |
-LL | #[rustc_dump_program_clauses] //~ ERROR Implemented(Self: Foo<F>) :-
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error: FromEnv(<F as std::ops::FnOnce<(&'a (u8, u16),)>>::Output == &'a u8) :- FromEnv(Self: Foo<F>).
-  --> $DIR/lower_trait_higher_rank.rs:13:1
-   |
-LL | #[rustc_dump_program_clauses] //~ ERROR Implemented(Self: Foo<F>) :-
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   = note: Implemented(Self: Foo<F>) :- FromEnv(Self: Foo<F>).
+   = note: FromEnv(F: std::marker::Sized) :- FromEnv(Self: Foo<F>).
+   = note: FromEnv(F: std::ops::Fn<(&'a (u8, u16),)>) :- FromEnv(Self: Foo<F>).
+   = note: FromEnv(<F as std::ops::FnOnce<(&'a (u8, u16),)>>::Output == &'a u8) :- FromEnv(Self: Foo<F>).
 
-error: aborting due to 4 previous errors
+error: aborting due to previous error
 
diff --git a/src/test/ui/chalkify/lower_trait_where_clause.rs b/src/test/ui/chalkify/lower_trait_where_clause.rs
index b2ce3ca48b2..67ee7c28b6a 100644
--- a/src/test/ui/chalkify/lower_trait_where_clause.rs
+++ b/src/test/ui/chalkify/lower_trait_where_clause.rs
@@ -13,13 +13,7 @@
 use std::fmt::{Debug, Display};
 use std::borrow::Borrow;
 
-#[rustc_dump_program_clauses] //~ ERROR Implemented(Self: Foo<'a, 'b, S, T, U>) :-
-                              //~| ERROR FromEnv
-                              //~| ERROR FromEnv
-                              //~| ERROR FromEnv
-                              //~| ERROR FromEnv
-                              //~| ERROR RegionOutlives
-                              //~| ERROR TypeOutlives
+#[rustc_dump_program_clauses] //~ ERROR program clause dump
 trait Foo<'a, 'b, S, T, U> where S: Debug, T: Borrow<U>, U: ?Sized, 'a: 'b, U: 'b {
     fn s(S) -> S;
     fn t(T) -> T;
diff --git a/src/test/ui/chalkify/lower_trait_where_clause.stderr b/src/test/ui/chalkify/lower_trait_where_clause.stderr
index a9ecaec3aff..cfea1379dab 100644
--- a/src/test/ui/chalkify/lower_trait_where_clause.stderr
+++ b/src/test/ui/chalkify/lower_trait_where_clause.stderr
@@ -1,44 +1,16 @@
-error: Implemented(Self: Foo<'a, 'b, S, T, U>) :- FromEnv(Self: Foo<'a, 'b, S, T, U>).
+error: program clause dump
   --> $DIR/lower_trait_where_clause.rs:16:1
    |
-LL | #[rustc_dump_program_clauses] //~ ERROR Implemented(Self: Foo<'a, 'b, S, T, U>) :-
+LL | #[rustc_dump_program_clauses] //~ ERROR program clause dump
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error: FromEnv(S: std::marker::Sized) :- FromEnv(Self: Foo<'a, 'b, S, T, U>).
-  --> $DIR/lower_trait_where_clause.rs:16:1
-   |
-LL | #[rustc_dump_program_clauses] //~ ERROR Implemented(Self: Foo<'a, 'b, S, T, U>) :-
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error: FromEnv(T: std::marker::Sized) :- FromEnv(Self: Foo<'a, 'b, S, T, U>).
-  --> $DIR/lower_trait_where_clause.rs:16:1
-   |
-LL | #[rustc_dump_program_clauses] //~ ERROR Implemented(Self: Foo<'a, 'b, S, T, U>) :-
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error: FromEnv(S: std::fmt::Debug) :- FromEnv(Self: Foo<'a, 'b, S, T, U>).
-  --> $DIR/lower_trait_where_clause.rs:16:1
-   |
-LL | #[rustc_dump_program_clauses] //~ ERROR Implemented(Self: Foo<'a, 'b, S, T, U>) :-
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error: FromEnv(T: std::borrow::Borrow<U>) :- FromEnv(Self: Foo<'a, 'b, S, T, U>).
-  --> $DIR/lower_trait_where_clause.rs:16:1
-   |
-LL | #[rustc_dump_program_clauses] //~ ERROR Implemented(Self: Foo<'a, 'b, S, T, U>) :-
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error: RegionOutlives('a : 'b) :- FromEnv(Self: Foo<'a, 'b, S, T, U>).
-  --> $DIR/lower_trait_where_clause.rs:16:1
    |
-LL | #[rustc_dump_program_clauses] //~ ERROR Implemented(Self: Foo<'a, 'b, S, T, U>) :-
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error: TypeOutlives(U : 'b) :- FromEnv(Self: Foo<'a, 'b, S, T, U>).
-  --> $DIR/lower_trait_where_clause.rs:16:1
-   |
-LL | #[rustc_dump_program_clauses] //~ ERROR Implemented(Self: Foo<'a, 'b, S, T, U>) :-
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error: aborting due to 7 previous errors
+   = note: Implemented(Self: Foo<'a, 'b, S, T, U>) :- FromEnv(Self: Foo<'a, 'b, S, T, U>).
+   = note: FromEnv(S: std::marker::Sized) :- FromEnv(Self: Foo<'a, 'b, S, T, U>).
+   = note: FromEnv(T: std::marker::Sized) :- FromEnv(Self: Foo<'a, 'b, S, T, U>).
+   = note: FromEnv(S: std::fmt::Debug) :- FromEnv(Self: Foo<'a, 'b, S, T, U>).
+   = note: FromEnv(T: std::borrow::Borrow<U>) :- FromEnv(Self: Foo<'a, 'b, S, T, U>).
+   = note: RegionOutlives('a : 'b) :- FromEnv(Self: Foo<'a, 'b, S, T, U>).
+   = note: TypeOutlives(U : 'b) :- FromEnv(Self: Foo<'a, 'b, S, T, U>).
+
+error: aborting due to previous error