about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2018-03-14 19:10:28 -0700
committerEsteban Küber <esteban@kuber.com.ar>2018-03-15 11:59:54 -0700
commit4d5cd21a0db601636d88f4c95f50435b04bf71df (patch)
tree0bb52e32d0f72ad2851c68a977783eed058958c7 /src/test
parent883e74645d350b6752cb94d48f46363f6f8789e9 (diff)
downloadrust-4d5cd21a0db601636d88f4c95f50435b04bf71df.tar.gz
rust-4d5cd21a0db601636d88f4c95f50435b04bf71df.zip
Coherence diagnostic tweaks
Diffstat (limited to 'src/test')
-rw-r--r--src/test/ui/codemap_tests/empty_span.stderr2
-rw-r--r--src/test/ui/coherence-impls-copy.stderr6
-rw-r--r--src/test/ui/e0119/complex-impl.stderr6
-rw-r--r--src/test/ui/e0119/issue-28981.stderr6
-rw-r--r--src/test/ui/error-codes/E0117.stderr2
-rw-r--r--src/test/ui/error-codes/E0206.stderr2
-rw-r--r--src/test/ui/error-codes/E0328.rs20
-rw-r--r--src/test/ui/error-codes/E0328.stderr9
8 files changed, 43 insertions, 10 deletions
diff --git a/src/test/ui/codemap_tests/empty_span.stderr b/src/test/ui/codemap_tests/empty_span.stderr
index 63b19c9e0c6..2df1d69acdb 100644
--- a/src/test/ui/codemap_tests/empty_span.stderr
+++ b/src/test/ui/codemap_tests/empty_span.stderr
@@ -2,7 +2,7 @@ error[E0321]: cross-crate traits with a default impl, like `std::marker::Send`,
   --> $DIR/empty_span.rs:17:5
    |
 LL |     unsafe impl Send for &'static Foo { } //~ ERROR cross-crate traits with a default impl
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't implement cross-crate trait with a default impl for non-struct/enum type
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/coherence-impls-copy.stderr b/src/test/ui/coherence-impls-copy.stderr
index 029b0478952..c276d8b9510 100644
--- a/src/test/ui/coherence-impls-copy.stderr
+++ b/src/test/ui/coherence-impls-copy.stderr
@@ -32,7 +32,7 @@ error[E0117]: only traits defined in the current crate can be implemented for ar
   --> $DIR/coherence-impls-copy.rs:33:1
    |
 LL | impl Copy for (MyType, MyType) {}
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate
    |
    = note: the impl does not reference any types defined in this crate
    = note: define and implement a trait or new type instead
@@ -41,7 +41,7 @@ error[E0117]: only traits defined in the current crate can be implemented for ar
   --> $DIR/coherence-impls-copy.rs:40:1
    |
 LL | impl Copy for [MyType] {}
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate
+   | ^^^^^^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate
    |
    = note: the impl does not reference any types defined in this crate
    = note: define and implement a trait or new type instead
@@ -50,7 +50,7 @@ error[E0117]: only traits defined in the current crate can be implemented for ar
   --> $DIR/coherence-impls-copy.rs:44:1
    |
 LL | impl Copy for &'static [NotSync] {}
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate
    |
    = note: the impl does not reference any types defined in this crate
    = note: define and implement a trait or new type instead
diff --git a/src/test/ui/e0119/complex-impl.stderr b/src/test/ui/e0119/complex-impl.stderr
index b268c755404..7e0e8ff0372 100644
--- a/src/test/ui/e0119/complex-impl.stderr
+++ b/src/test/ui/e0119/complex-impl.stderr
@@ -8,11 +8,13 @@ LL | impl<R> External for (Q, R) {} //~ ERROR must be used
            - impl<'a, 'b, 'c, T, U, V, W> complex_impl_support::External for (T, complex_impl_support::M<'a, 'b, 'c, std::boxed::Box<U>, V, W>)
              where <U as std::ops::FnOnce<(T,)>>::Output == V, <V as std::iter::Iterator>::Item == T, 'b : 'a, T : 'a, U: std::ops::FnOnce<(T,)>, U : 'static, V: std::iter::Iterator, V: std::clone::Clone, W: std::ops::Add, <W as std::ops::Add>::Output: std::marker::Copy;
 
-error[E0210]: type parameter `R` must be used as the type parameter for some local type (e.g. `MyStruct<T>`); only traits defined in the current crate can be implemented for a type parameter
+error[E0210]: type parameter `R` must be used as the type parameter for some local type (e.g. `MyStruct<R>`)
   --> $DIR/complex-impl.rs:19:1
    |
 LL | impl<R> External for (Q, R) {} //~ ERROR must be used
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ type parameter `R` must be used as the type parameter for some local type
+   |
+   = note: only traits defined in the current crate can be implemented for a type parameter
 
 error: aborting due to 2 previous errors
 
diff --git a/src/test/ui/e0119/issue-28981.stderr b/src/test/ui/e0119/issue-28981.stderr
index b1ec1111ede..ade072336bc 100644
--- a/src/test/ui/e0119/issue-28981.stderr
+++ b/src/test/ui/e0119/issue-28981.stderr
@@ -8,11 +8,13 @@ LL | impl<Foo> Deref for Foo { } //~ ERROR must be used
            - impl<'a, T> std::ops::Deref for &'a T
              where T: ?Sized;
 
-error[E0210]: type parameter `Foo` must be used as the type parameter for some local type (e.g. `MyStruct<T>`); only traits defined in the current crate can be implemented for a type parameter
+error[E0210]: type parameter `Foo` must be used as the type parameter for some local type (e.g. `MyStruct<Foo>`)
   --> $DIR/issue-28981.rs:15:1
    |
 LL | impl<Foo> Deref for Foo { } //~ ERROR must be used
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   | ^^^^^^^^^^^^^^^^^^^^^^^ type parameter `Foo` must be used as the type parameter for some local type
+   |
+   = note: only traits defined in the current crate can be implemented for a type parameter
 
 error: aborting due to 2 previous errors
 
diff --git a/src/test/ui/error-codes/E0117.stderr b/src/test/ui/error-codes/E0117.stderr
index 240aa4240cc..39702886348 100644
--- a/src/test/ui/error-codes/E0117.stderr
+++ b/src/test/ui/error-codes/E0117.stderr
@@ -8,7 +8,7 @@ error[E0117]: only traits defined in the current crate can be implemented for ar
   --> $DIR/E0117.rs:11:1
    |
 LL | impl Drop for u32 {} //~ ERROR E0117
-   | ^^^^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate
+   | ^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate
    |
    = note: the impl does not reference any types defined in this crate
    = note: define and implement a trait or new type instead
diff --git a/src/test/ui/error-codes/E0206.stderr b/src/test/ui/error-codes/E0206.stderr
index 0cd22a454e1..6c671967e84 100644
--- a/src/test/ui/error-codes/E0206.stderr
+++ b/src/test/ui/error-codes/E0206.stderr
@@ -14,7 +14,7 @@ error[E0117]: only traits defined in the current crate can be implemented for ar
   --> $DIR/E0206.rs:13:1
    |
 LL | impl Copy for Foo { }
-   | ^^^^^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate
+   | ^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate
    |
    = note: the impl does not reference any types defined in this crate
    = note: define and implement a trait or new type instead
diff --git a/src/test/ui/error-codes/E0328.rs b/src/test/ui/error-codes/E0328.rs
new file mode 100644
index 00000000000..e08532b0249
--- /dev/null
+++ b/src/test/ui/error-codes/E0328.rs
@@ -0,0 +1,20 @@
+// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+#![feature(unsize)]
+
+use std::marker::Unsize;
+
+pub struct MyType;
+
+impl<T> Unsize<T> for MyType {}
+//~^ ERROR explicit impls for the `Unsize` trait are not permitted [E0328]
+
+fn main() {}
diff --git a/src/test/ui/error-codes/E0328.stderr b/src/test/ui/error-codes/E0328.stderr
new file mode 100644
index 00000000000..ad3a224279c
--- /dev/null
+++ b/src/test/ui/error-codes/E0328.stderr
@@ -0,0 +1,9 @@
+error[E0328]: explicit impls for the `Unsize` trait are not permitted
+  --> $DIR/E0328.rs:17:1
+   |
+LL | impl<T> Unsize<T> for MyType {}
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl of `Unsize` not allowed
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0328`.