about summary refs log tree commit diff
path: root/src/test/ui
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2018-02-10 21:01:49 -0800
committerEsteban Küber <esteban@kuber.com.ar>2018-03-14 18:04:20 -0700
commit6d8a1739805fa81b6baa8c86efc3e79920ecb306 (patch)
tree8ca52590f0d3e738cc3d8ec277ab564653618e35 /src/test/ui
parent883e74645d350b6752cb94d48f46363f6f8789e9 (diff)
Reword E0044 and message for `!Send` types
 - Reword E0044 help.
 - Change error message for types that don't implement `Send`
Diffstat (limited to 'src/test/ui')
-rw-r--r--src/test/ui/error-codes/E0044.rs8
-rw-r--r--src/test/ui/error-codes/E0044.stderr12
-rw-r--r--src/test/ui/fmt/send-sync.rs4
-rw-r--r--src/test/ui/fmt/send-sync.stderr8
-rw-r--r--src/test/ui/generator/not-send-sync.rs4
-rw-r--r--src/test/ui/generator/not-send-sync.stderr4
6 files changed, 20 insertions, 20 deletions
diff --git a/src/test/ui/error-codes/E0044.rs b/src/test/ui/error-codes/E0044.rs
index 48fe2300031..4d20edea5fe 100644
--- a/src/test/ui/error-codes/E0044.rs
+++ b/src/test/ui/error-codes/E0044.rs
@@ -1,4 +1,4 @@
-// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
+// 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.
 //
@@ -8,7 +8,11 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-extern { fn some_func<T>(x: T); } //~ ERROR E0044
+extern {
+    fn sqrt<T>(f: T) -> T;
+    //~^ ERROR foreign items may not have type parameters [E0044]
+    //~| HELP use specialization instead of type parameters by replacing them with concrete types
+}
 
 fn main() {
 }
diff --git a/src/test/ui/error-codes/E0044.stderr b/src/test/ui/error-codes/E0044.stderr
index b823f3717b3..12324e771d3 100644
--- a/src/test/ui/error-codes/E0044.stderr
+++ b/src/test/ui/error-codes/E0044.stderr
@@ -1,14 +1,10 @@
 error[E0044]: foreign items may not have type parameters
-  --> $DIR/E0044.rs:11:10
+  --> $DIR/E0044.rs:12:5
    |
-LL | extern { fn some_func<T>(x: T); } //~ ERROR E0044
-   |          ^^^^^^^^^^^^^^^^^^^^^^
+LL |     fn sqrt<T>(f: T) -> T;
+   |     ^^^^^^^^^^^^^^^^^^^^^^
    |
-help: consider using specialization instead of type parameters
-  --> $DIR/E0044.rs:11:10
-   |
-LL | extern { fn some_func<T>(x: T); } //~ ERROR E0044
-   |          ^^^^^^^^^^^^^^^^^^^^^^
+   = help: use specialization instead of type parameters by replacing them with concrete types like `u32`
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/fmt/send-sync.rs b/src/test/ui/fmt/send-sync.rs
index 3f13fd2e491..424919a0eba 100644
--- a/src/test/ui/fmt/send-sync.rs
+++ b/src/test/ui/fmt/send-sync.rs
@@ -15,6 +15,6 @@ fn main() {
     // `Cell` is not `Sync`, so `&Cell` is neither `Sync` nor `Send`,
     // `std::fmt::Arguments` used to forget this...
     let c = std::cell::Cell::new(42);
-    send(format_args!("{:?}", c)); //~ ERROR Sync` is not satisfied
-    sync(format_args!("{:?}", c)); //~ ERROR Sync` is not satisfied
+    send(format_args!("{:?}", c)); //~ ERROR E0277
+    sync(format_args!("{:?}", c)); //~ ERROR E0277
 }
diff --git a/src/test/ui/fmt/send-sync.stderr b/src/test/ui/fmt/send-sync.stderr
index 0943b64c5c0..113a2a480aa 100644
--- a/src/test/ui/fmt/send-sync.stderr
+++ b/src/test/ui/fmt/send-sync.stderr
@@ -1,7 +1,7 @@
-error[E0277]: the trait bound `*mut std::ops::Fn() + 'static: std::marker::Sync` is not satisfied in `[std::fmt::ArgumentV1<'_>]`
+error[E0277]: `*mut std::ops::Fn() + 'static` cannot be shared between threads safely
   --> $DIR/send-sync.rs:18:5
    |
-LL |     send(format_args!("{:?}", c)); //~ ERROR Sync` is not satisfied
+LL |     send(format_args!("{:?}", c)); //~ ERROR E0277
    |     ^^^^ `*mut std::ops::Fn() + 'static` cannot be shared between threads safely
    |
    = help: within `[std::fmt::ArgumentV1<'_>]`, the trait `std::marker::Sync` is not implemented for `*mut std::ops::Fn() + 'static`
@@ -18,10 +18,10 @@ note: required by `send`
 LL | fn send<T: Send>(_: T) {}
    | ^^^^^^^^^^^^^^^^^^^^^^
 
-error[E0277]: the trait bound `*mut std::ops::Fn() + 'static: std::marker::Sync` is not satisfied in `std::fmt::Arguments<'_>`
+error[E0277]: `*mut std::ops::Fn() + 'static` cannot be shared between threads safely
   --> $DIR/send-sync.rs:19:5
    |
-LL |     sync(format_args!("{:?}", c)); //~ ERROR Sync` is not satisfied
+LL |     sync(format_args!("{:?}", c)); //~ ERROR E0277
    |     ^^^^ `*mut std::ops::Fn() + 'static` cannot be shared between threads safely
    |
    = help: within `std::fmt::Arguments<'_>`, the trait `std::marker::Sync` is not implemented for `*mut std::ops::Fn() + 'static`
diff --git a/src/test/ui/generator/not-send-sync.rs b/src/test/ui/generator/not-send-sync.rs
index 0419758d8ea..f0df05ebfdf 100644
--- a/src/test/ui/generator/not-send-sync.rs
+++ b/src/test/ui/generator/not-send-sync.rs
@@ -17,14 +17,14 @@ fn main() {
     fn assert_send<T: Send>(_: T) {}
 
     assert_sync(|| {
-        //~^ ERROR: Sync` is not satisfied
+        //~^ ERROR: E0277
         let a = Cell::new(2);
         yield;
     });
 
     let a = Cell::new(2);
     assert_send(|| {
-        //~^ ERROR: Sync` is not satisfied
+        //~^ ERROR: E0277
         drop(&a);
         yield;
     });
diff --git a/src/test/ui/generator/not-send-sync.stderr b/src/test/ui/generator/not-send-sync.stderr
index 6ca583bf16d..669e0d26cf0 100644
--- a/src/test/ui/generator/not-send-sync.stderr
+++ b/src/test/ui/generator/not-send-sync.stderr
@@ -1,4 +1,4 @@
-error[E0277]: the trait bound `std::cell::Cell<i32>: std::marker::Sync` is not satisfied
+error[E0277]: `std::cell::Cell<i32>` cannot be shared between threads safely
   --> $DIR/not-send-sync.rs:26:5
    |
 LL |     assert_send(|| {
@@ -13,7 +13,7 @@ note: required by `main::assert_send`
 LL |     fn assert_send<T: Send>(_: T) {}
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-error[E0277]: the trait bound `std::cell::Cell<i32>: std::marker::Sync` is not satisfied in `[generator@$DIR/not-send-sync.rs:19:17: 23:6 {std::cell::Cell<i32>, ()}]`
+error[E0277]: `std::cell::Cell<i32>` cannot be shared between threads safely
   --> $DIR/not-send-sync.rs:19:5
    |
 LL |     assert_sync(|| {