]> git.lizzy.rs Git - rust.git/commitdiff
Auto merge of #51463 - estebank:error-codes, r=nikomatsakis
authorbors <bors@rust-lang.org>
Fri, 22 Jun 2018 03:24:36 +0000 (03:24 +0000)
committerbors <bors@rust-lang.org>
Fri, 22 Jun 2018 03:24:36 +0000 (03:24 +0000)
Various changes to existing diagnostics

* [Add code to `invalid ABI` error, add span label, move list to help to make message shorter](https://github.com/rust-lang/rust/pull/51463/commits/23ae5af274defa9ff884f593e44a2bbcaf814a02):
```
error[E0697]: invalid ABI: found `路濫狼á́́`
  --> $DIR/unicode.rs:11:8
   |
LL | extern "路濫狼á́́" fn foo() {} //~ ERROR invalid ABI
   |        ^^^^^^^^^ invalid ABI
   |
   = help: valid ABIs: cdecl, stdcall, fastcall, vectorcall, thiscall, aapcs, win64, sysv64, ptx-kernel, msp430-interrupt, x86-interrupt, Rust, C, system, rust-intrinsic, rust-call, platform-intrinsic, unadjusted
```
* [Add code to incorrect `pub` restriction error](https://github.com/rust-lang/rust/pull/51463/commits/e96fdea8a38f39f99f8b9a4000a689187a457e08)
* [Add message to `rustc_on_unimplemented` attributes in core to have them set a custom message _and_ label](https://github.com/rust-lang/rust/pull/51463/commits/2cc7e5ed307aee936c20479cfdc7409d6b52a464):
```
error[E0277]: `W` does not have a constant size known at compile-time
  --> $DIR/unsized-enum2.rs:33:8
   |
LL |     VA(W),
   |        ^ `W` does not have a constant size known at compile-time
   |
   = help: the trait `std::marker::Sized` is not implemented for `W`
   = help: consider adding a `where W: std::marker::Sized` bound
   = note: no field of an enum variant may have a dynamically sized type
```
```
error[E0277]: `Foo` cannot be sent between threads safely
  --> $DIR/E0277-2.rs:26:5
   |
LL |     is_send::<Foo>();
   |     ^^^^^^^^^^^^^^ `Foo` cannot be sent between threads safely
   |
   = help: the trait `std::marker::Send` is not implemented for `Foo`
```
```
error[E0277]: can't compare `{integer}` with `std::string::String`
  --> $DIR/binops.rs:16:7
   |
LL |     5 < String::new();
   |       ^ no implementation for `{integer} < std::string::String` and `{integer} > std::string::String`
   |
   = help: the trait `std::cmp::PartialOrd<std::string::String>` is not implemented for `{integer}`
```
```
error[E0277]: can't compare `{integer}` with `std::result::Result<{integer}, _>`
  --> $DIR/binops.rs:17:7
   |
LL |     6 == Ok(1);
   |       ^^ no implementation for `{integer} == std::result::Result<{integer}, _>`
   |
   = help: the trait `std::cmp::PartialEq<std::result::Result<{integer}, _>>` is not implemented for `{integer}`
```
```
error[E0277]: a collection of type `i32` cannot be built from an iterator over elements of type `i32`
  --> $DIR/type-check-defaults.rs:16:19
   |
LL | struct WellFormed<Z = Foo<i32, i32>>(Z);
   |                   ^ a collection of type `i32` cannot be built from `std::iter::Iterator<Item=i32>`
   |
   = help: the trait `std::iter::FromIterator<i32>` is not implemented for `i32`
note: required by `Foo`
  --> $DIR/type-check-defaults.rs:15:1
   |
LL | struct Foo<T, U: FromIterator<T>>(T, U);
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
```
* [Add link to book for `Sized` errors](https://github.com/rust-lang/rust/pull/51463/commits/1244dc7c283323aea1a3457a4458d590a3e160c8):
```
error[E0277]: `std::fmt::Debug + std::marker::Sync + 'static` does not have a constant size known at compile-time
  --> $DIR/const-unsized.rs:13:29
   |
LL | const CONST_0: Debug+Sync = *(&0 as &(Debug+Sync));
   |                             ^^^^^^^^^^^^^^^^^^^^^^ `std::fmt::Debug + std::marker::Sync + 'static` does not have a constant size known at compile-time
   |
   = help: the trait `std::marker::Sized` is not implemented for `std::fmt::Debug + std::marker::Sync + 'static`
   = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
   = note: constant expressions must have a statically known size
```
* [Point to previous line for single expected token not found](https://github.com/rust-lang/rust/pull/51463/commits/48165168fb0f059d8536cd4a2276b609d4a7f721) (if the current token is in a different line)

117 files changed:
src/liballoc/vec.rs
src/libcore/cmp.rs
src/libcore/iter/traits.rs
src/libcore/marker.rs
src/libcore/ops/index.rs
src/libstd/panic.rs
src/libsyntax/diagnostic_list.rs
src/libsyntax/parse/parser.rs
src/test/compile-fail/associated-types-unsized.rs
src/test/compile-fail/bad-method-typaram-kind.rs
src/test/compile-fail/bad-sized.rs
src/test/compile-fail/builtin-superkinds-double-superkind.rs
src/test/compile-fail/builtin-superkinds-in-metadata.rs
src/test/compile-fail/builtin-superkinds-simple.rs
src/test/compile-fail/builtin-superkinds-typaram-not-send.rs
src/test/compile-fail/closure-bounds-cant-promote-superkind-in-struct.rs
src/test/compile-fail/dst-bad-assign-2.rs
src/test/compile-fail/dst-bad-assign-3.rs
src/test/compile-fail/dst-bad-assign.rs
src/test/compile-fail/dst-bad-deep-2.rs
src/test/compile-fail/dst-bad-deep.rs
src/test/compile-fail/dst-object-from-unsized-type.rs
src/test/compile-fail/dst-sized-trait-param.rs
src/test/compile-fail/extern-types-not-sync-send.rs
src/test/compile-fail/extern-types-unsized.rs
src/test/compile-fail/issue-14366.rs
src/test/compile-fail/issue-15756.rs
src/test/compile-fail/issue-17651.rs
src/test/compile-fail/issue-18107.rs
src/test/compile-fail/issue-18919.rs
src/test/compile-fail/issue-20005.rs
src/test/compile-fail/issue-20433.rs
src/test/compile-fail/issue-20605.rs
src/test/compile-fail/issue-21763.rs
src/test/compile-fail/issue-22874.rs
src/test/compile-fail/issue-23281.rs
src/test/compile-fail/issue-24446.rs
src/test/compile-fail/issue-27060-2.rs
src/test/compile-fail/issue-27078.rs
src/test/compile-fail/issue-35988.rs
src/test/compile-fail/issue-38954.rs
src/test/compile-fail/issue-41229-ref-str.rs
src/test/compile-fail/issue-42312.rs
src/test/compile-fail/issue-5883.rs
src/test/compile-fail/issue-7013.rs
src/test/compile-fail/kindck-impl-type-params.rs
src/test/compile-fail/kindck-nonsendable-1.rs
src/test/compile-fail/kindck-send-object.rs
src/test/compile-fail/kindck-send-object1.rs
src/test/compile-fail/kindck-send-object2.rs
src/test/compile-fail/kindck-send-owned.rs
src/test/compile-fail/kindck-send-unsafe.rs
src/test/compile-fail/no-send-res-ports.rs
src/test/compile-fail/no_send-enum.rs
src/test/compile-fail/no_send-rc.rs
src/test/compile-fail/no_send-struct.rs
src/test/compile-fail/not-panic-safe-2.rs
src/test/compile-fail/not-panic-safe-3.rs
src/test/compile-fail/not-panic-safe-4.rs
src/test/compile-fail/not-panic-safe-6.rs
src/test/compile-fail/not-panic-safe.rs
src/test/compile-fail/range-1.rs
src/test/compile-fail/range_traits-1.rs
src/test/compile-fail/str-idx.rs
src/test/compile-fail/str-mut-idx.rs
src/test/compile-fail/substs-ppaux.rs
src/test/compile-fail/trait-bounds-not-on-bare-trait.rs
src/test/compile-fail/traits-negative-impls.rs
src/test/compile-fail/typeck-default-trait-impl-negation-send.rs
src/test/compile-fail/union/union-unsized.rs
src/test/compile-fail/unsized-bare-typaram.rs
src/test/compile-fail/unsized-enum.rs
src/test/compile-fail/unsized-inherent-impl-self-type.rs
src/test/compile-fail/unsized-struct.rs
src/test/compile-fail/unsized-trait-impl-self-type.rs
src/test/compile-fail/unsized-trait-impl-trait-arg.rs
src/test/compile-fail/unsized3.rs
src/test/compile-fail/unsized5.rs
src/test/compile-fail/unsized6.rs
src/test/compile-fail/unsized7.rs
src/test/ui/codemap_tests/unicode.stderr
src/test/ui/const-unsized.rs
src/test/ui/const-unsized.stderr
src/test/ui/error-codes/E0277-2.rs
src/test/ui/error-codes/E0277-2.stderr
src/test/ui/error-codes/E0277.rs
src/test/ui/error-codes/E0277.stderr
src/test/ui/feature-gate-trivial_bounds.stderr
src/test/ui/generator/sized-yield.rs
src/test/ui/generator/sized-yield.stderr
src/test/ui/impl-trait/auto-trait-leak.rs
src/test/ui/impl-trait/auto-trait-leak.stderr
src/test/ui/impl-trait/auto-trait-leak2.rs
src/test/ui/impl-trait/auto-trait-leak2.stderr
src/test/ui/interior-mutability/interior-mutability.rs
src/test/ui/interior-mutability/interior-mutability.stderr
src/test/ui/mismatched_types/binops.rs
src/test/ui/mismatched_types/binops.stderr
src/test/ui/mismatched_types/cast-rfc0401.rs
src/test/ui/mismatched_types/cast-rfc0401.stderr
src/test/ui/parser/expected-comma-found-token.rs [new file with mode: 0644]
src/test/ui/parser/expected-comma-found-token.stderr [new file with mode: 0644]
src/test/ui/partialeq_help.stderr
src/test/ui/pub/pub-restricted.stderr
src/test/ui/resolve/issue-5035-2.rs
src/test/ui/resolve/issue-5035-2.stderr
src/test/ui/suggestions/str-array-assignment.rs
src/test/ui/suggestions/str-array-assignment.stderr
src/test/ui/trait-suggest-where-clause.rs
src/test/ui/trait-suggest-where-clause.stderr
src/test/ui/trivial-bounds-leak.stderr
src/test/ui/type-check-defaults.rs
src/test/ui/type-check-defaults.stderr
src/test/ui/union/union-sized-field.rs
src/test/ui/union/union-sized-field.stderr
src/test/ui/unsized-enum2.rs
src/test/ui/unsized-enum2.stderr

index b5739e1a825538ceffa016bd3f2a550d5e39ae28..752a6c966d51a35bcd4de701b6055f640255d4f9 100644 (file)
@@ -1693,7 +1693,10 @@ fn hash<H: hash::Hasher>(&self, state: &mut H) {
 }
 
 #[stable(feature = "rust1", since = "1.0.0")]
-#[rustc_on_unimplemented = "vector indices are of type `usize` or ranges of `usize`"]
+#[rustc_on_unimplemented(
+    message="vector indices are of type `usize` or ranges of `usize`",
+    label="vector indices are of type `usize` or ranges of `usize`",
+)]
 impl<T, I> Index<I> for Vec<T>
 where
     I: ::core::slice::SliceIndex<[T]>,
@@ -1707,7 +1710,10 @@ fn index(&self, index: I) -> &Self::Output {
 }
 
 #[stable(feature = "rust1", since = "1.0.0")]
-#[rustc_on_unimplemented = "vector indices are of type `usize` or ranges of `usize`"]
+#[rustc_on_unimplemented(
+    message="vector indices are of type `usize` or ranges of `usize`",
+    label="vector indices are of type `usize` or ranges of `usize`",
+)]
 impl<T, I> IndexMut<I> for Vec<T>
 where
     I: ::core::slice::SliceIndex<[T]>,
index 13e838773a5875faf0a0da4117644d9f45776c94..3626a266ad5d3f0d86cd059ede2c21fbae92c816 100644 (file)
 #[stable(feature = "rust1", since = "1.0.0")]
 #[doc(alias = "==")]
 #[doc(alias = "!=")]
-#[rustc_on_unimplemented = "can't compare `{Self}` with `{Rhs}`"]
+#[rustc_on_unimplemented(
+    message="can't compare `{Self}` with `{Rhs}`",
+    label="no implementation for `{Self} == {Rhs}`",
+)]
 pub trait PartialEq<Rhs: ?Sized = Self> {
     /// This method tests for `self` and `other` values to be equal, and is used
     /// by `==`.
@@ -611,7 +614,10 @@ fn partial_cmp(&self, other: &Ordering) -> Option<Ordering> {
 #[doc(alias = "<")]
 #[doc(alias = "<=")]
 #[doc(alias = ">=")]
-#[rustc_on_unimplemented = "can't compare `{Self}` with `{Rhs}`"]
+#[rustc_on_unimplemented(
+    message="can't compare `{Self}` with `{Rhs}`",
+    label="no implementation for `{Self} < {Rhs}` and `{Self} > {Rhs}`",
+)]
 pub trait PartialOrd<Rhs: ?Sized = Self>: PartialEq<Rhs> {
     /// This method returns an ordering between `self` and `other` values if one exists.
     ///
index 3d2ce9e6b104bc9aae32559816e10a81eb9bf9bb..4b2c1aa551e994ad7470de7480abea31edb20e42 100644 (file)
 /// assert_eq!(c.0, vec![0, 1, 2, 3, 4]);
 /// ```
 #[stable(feature = "rust1", since = "1.0.0")]
-#[rustc_on_unimplemented="a collection of type `{Self}` cannot be \
-                          built from an iterator over elements of type `{A}`"]
+#[rustc_on_unimplemented(
+    message="a collection of type `{Self}` cannot be built from an iterator \
+             over elements of type `{A}`",
+    label="a collection of type `{Self}` cannot be built from `std::iter::Iterator<Item={A}>`",
+)]
 pub trait FromIterator<A>: Sized {
     /// Creates a value from an iterator.
     ///
index 3d3f63ecf37d57e1c5eb46ca640ef449ef336ab2..5db5d88d4a5ff9bc2e3036ba5e9d1ecb46ed7c7b 100644 (file)
 /// [arc]: ../../std/sync/struct.Arc.html
 /// [ub]: ../../reference/behavior-considered-undefined.html
 #[stable(feature = "rust1", since = "1.0.0")]
-#[rustc_on_unimplemented = "`{Self}` cannot be sent between threads safely"]
+#[rustc_on_unimplemented(
+    message="`{Self}` cannot be sent between threads safely",
+    label="`{Self}` cannot be sent between threads safely"
+)]
 pub unsafe auto trait Send {
     // empty.
 }
@@ -88,7 +91,12 @@ impl<T: ?Sized> !Send for *mut T { }
 /// [trait object]: ../../book/first-edition/trait-objects.html
 #[stable(feature = "rust1", since = "1.0.0")]
 #[lang = "sized"]
-#[rustc_on_unimplemented = "`{Self}` does not have a constant size known at compile-time"]
+#[rustc_on_unimplemented(
+    message="the size for value values of type `{Self}` cannot be known at compilation time",
+    label="doesn't have a size known at compile-time",
+    note="to learn more, visit <https://doc.rust-lang.org/book/second-edition/\
+          ch19-04-advanced-types.html#dynamically-sized-types--sized>",
+)]
 #[fundamental] // for Default, for example, which requires that `[T]: !Default` be evaluatable
 pub trait Sized {
     // Empty.
index 0a0e92a91800614a75608bd7099eb2e4fe79ab54..1ac80ecc96ffeb775cd6fc3ffc2d52f018aacbb2 100644 (file)
 /// assert_eq!(nucleotide_count[Nucleotide::T], 12);
 /// ```
 #[lang = "index"]
-#[rustc_on_unimplemented = "the type `{Self}` cannot be indexed by `{Idx}`"]
+#[rustc_on_unimplemented(
+    message="the type `{Self}` cannot be indexed by `{Idx}`",
+    label="`{Self}` cannot be indexed by `{Idx}`",
+)]
 #[stable(feature = "rust1", since = "1.0.0")]
 #[doc(alias = "]")]
 #[doc(alias = "[")]
@@ -147,7 +150,10 @@ pub trait Index<Idx: ?Sized> {
 /// balance[Side::Left] = Weight::Kilogram(3.0);
 /// ```
 #[lang = "index_mut"]
-#[rustc_on_unimplemented = "the type `{Self}` cannot be mutably indexed by `{Idx}`"]
+#[rustc_on_unimplemented(
+    message="the type `{Self}` cannot be mutably indexed by `{Idx}`",
+    label="`{Self}` cannot be mutably indexed by `{Idx}`",
+)]
 #[stable(feature = "rust1", since = "1.0.0")]
 #[doc(alias = "[")]
 #[doc(alias = "]")]
index 4b5a063ea73aa2a5b823be0667a874022da31ef6..2c11c262488b2d04f396ea37e74d9e785971b4f0 100644 (file)
 ///
 /// [`AssertUnwindSafe`]: ./struct.AssertUnwindSafe.html
 #[stable(feature = "catch_unwind", since = "1.9.0")]
-#[rustc_on_unimplemented = "the type {Self} may not be safely transferred \
-                            across an unwind boundary"]
+#[rustc_on_unimplemented(
+    message="the type `{Self}` may not be safely transferred across an unwind boundary",
+    label="`{Self}` may not be safely transferred across an unwind boundary",
+)]
 pub auto trait UnwindSafe {}
 
 /// A marker trait representing types where a shared reference is considered
 /// [`UnsafeCell`]: ../cell/struct.UnsafeCell.html
 /// [`UnwindSafe`]: ./trait.UnwindSafe.html
 #[stable(feature = "catch_unwind", since = "1.9.0")]
-#[rustc_on_unimplemented = "the type {Self} may contain interior mutability \
-                            and a reference may not be safely transferrable \
-                            across a catch_unwind boundary"]
+#[rustc_on_unimplemented(
+    message="the type `{Self}` may contain interior mutability and a reference may not be safely \
+             transferrable across a catch_unwind boundary",
+    label="`{Self}` may contain interior mutability and a reference may not be safely \
+           transferrable across a catch_unwind boundary",
+)]
 pub auto trait RefUnwindSafe {}
 
 /// A simple wrapper around a type to assert that it is unwind safe.
index ab8317bfa027ea5b9b22fd04300985c8b92c47a2..8534969c623bc5c906c0c40625b6a7435b33d7c2 100644 (file)
@@ -397,4 +397,6 @@ fn main() {}
     E0630, // rustc_const_unstable attribute must be paired with stable/unstable attribute
     E0693, // incorrect `repr(align)` attribute format
     E0694, // an unknown tool name found in scoped attributes
+    E0703, // invalid ABI
+    E0704, // incorrect visibility restriction
 }
index 6f78ae9ebca5dd0c2d7f22d1f7c2272ce945b4cb..3955ccb4c420a1d8f870d81f706e48b62152e841 100644 (file)
@@ -638,7 +638,26 @@ pub fn expect(&mut self, t: &token::Token) -> PResult<'a,  ()> {
                 let mut err = self.fatal(&format!("expected `{}`, found `{}`",
                                                   token_str,
                                                   this_token_str));
-                err.span_label(self.span, format!("expected `{}`", token_str));
+
+                let sp = if self.token == token::Token::Eof {
+                    // EOF, don't want to point at the following char, but rather the last token
+                    self.prev_span
+                } else {
+                    self.sess.codemap().next_point(self.prev_span)
+                };
+                let label_exp = format!("expected `{}`", token_str);
+                let cm = self.sess.codemap();
+                match (cm.lookup_line(self.span.lo()), cm.lookup_line(sp.lo())) {
+                    (Ok(ref a), Ok(ref b)) if a.line == b.line => {
+                        // When the spans are in the same line, it means that the only content
+                        // between them is whitespace, point only at the found token.
+                        err.span_label(self.span, label_exp);
+                    }
+                    _ => {
+                        err.span_label(sp, label_exp);
+                        err.span_label(self.span, "unexpected token");
+                    }
+                }
                 Err(err)
             }
         } else {
@@ -1205,14 +1224,6 @@ pub fn span_fatal<S: Into<MultiSpan>>(&self, sp: S, m: &str) -> DiagnosticBuilde
     fn span_fatal_err<S: Into<MultiSpan>>(&self, sp: S, err: Error) -> DiagnosticBuilder<'a> {
         err.span_err(sp, self.diagnostic())
     }
-    fn span_fatal_help<S: Into<MultiSpan>>(&self,
-                                            sp: S,
-                                            m: &str,
-                                            help: &str) -> DiagnosticBuilder<'a> {
-        let mut err = self.sess.span_diagnostic.struct_span_fatal(sp, m);
-        err.help(help);
-        err
-    }
     fn bug(&self, m: &str) -> ! {
         self.sess.span_diagnostic.span_bug(self.span, m)
     }
@@ -5985,12 +5996,13 @@ pub fn parse_visibility(&mut self, can_take_tuple: bool) -> PResult<'a, Visibili
 `pub(super)`: visible only in the current module's parent
 `pub(in path::to::module)`: visible only on the specified path"##;
                 let path = self.parse_path(PathStyle::Mod)?;
-                let path_span = self.prev_span;
+                let sp = self.prev_span;
                 let help_msg = format!("make this visible only to module `{}` with `in`", path);
                 self.expect(&token::CloseDelim(token::Paren))?;  // `)`
-                let mut err = self.span_fatal_help(path_span, msg, suggestion);
+                let mut err = struct_span_err!(self.sess.span_diagnostic, sp, E0704, "{}", msg);
+                err.help(suggestion);
                 err.span_suggestion_with_applicability(
-                    path_span, &help_msg, format!("in {}", path), Applicability::MachineApplicable
+                    sp, &help_msg, format!("in {}", path), Applicability::MachineApplicable
                 );
                 err.emit();  // emit diagnostic, but continue with public visibility
             }
@@ -6534,12 +6546,15 @@ fn parse_opt_abi(&mut self) -> PResult<'a, Option<Abi>> {
                     Some(abi) => Ok(Some(abi)),
                     None => {
                         let prev_span = self.prev_span;
-                        self.span_err(
+                        let mut err = struct_span_err!(
+                            self.sess.span_diagnostic,
                             prev_span,
-                            &format!("invalid ABI: expected one of [{}], \
-                                     found `{}`",
-                                    abi::all_names().join(", "),
-                                    s));
+                            E0703,
+                            "invalid ABI: found `{}`",
+                            s);
+                        err.span_label(prev_span, "invalid ABI");
+                        err.help(&format!("valid ABIs: {}", abi::all_names().join(", ")));
+                        err.emit();
                         Ok(None)
                     }
                 }
index f1827022964169293e55e73260846c06158fca5e..3bb0382ef037be8299c335d675a14253ca13d9b1 100644 (file)
@@ -14,7 +14,7 @@ trait Get {
 }
 
 fn foo<T:Get>(t: T) {
-    let x = t.get(); //~ ERROR `<T as Get>::Value: std::marker::Sized` is not
+    let x = t.get(); //~ ERROR the size for value values of type
 }
 
 fn main() {
index 5be90f05018331389eddcbee6a33e2a9dbfa9061..7cef3f13dfc2cef2c574a2916f839748471d0aa0 100644 (file)
@@ -9,7 +9,7 @@
 // except according to those terms.
 
 fn foo<T:'static>() {
-    1.bar::<T>(); //~ ERROR `T: std::marker::Send` is not satisfied
+    1.bar::<T>(); //~ ERROR `T` cannot be sent between threads safely
 }
 
 trait bar {
index df3da5096bf538d9d57639d729b92b178b0bbcb3..9b87ec4d446cd155bf5ce4f2a8b18317973b20fb 100644 (file)
@@ -13,6 +13,6 @@ trait Trait {}
 pub fn main() {
     let x: Vec<Trait + Sized> = Vec::new();
     //~^ ERROR only auto traits can be used as additional traits in a trait object
-    //~| ERROR the trait bound `Trait: std::marker::Sized` is not satisfied
-    //~| ERROR the trait bound `Trait: std::marker::Sized` is not satisfied
+    //~| ERROR the size for value values of type
+    //~| ERROR the size for value values of type
 }
index 261881d880bf9fcd8074f34c6d371cfa86046114..3f7f2adabdfb114d5dae43c5502319c942028642 100644 (file)
@@ -14,7 +14,7 @@
 trait Foo : Send+Sync { }
 
 impl <T: Sync+'static> Foo for (T,) { }
-//~^ ERROR the trait bound `T: std::marker::Send` is not satisfied in `(T,)` [E0277]
+//~^ ERROR `T` cannot be sent between threads safely [E0277]
 
 impl <T: Send> Foo for (T,T) { }
 //~^ ERROR `T` cannot be shared between threads safely [E0277]
index de2084c4e8187baa3d52ae9dc0323d8c128ba662..88b5a3fbb55b63337fbcd6cb14cacf4f8580f12d 100644 (file)
@@ -22,6 +22,6 @@
 impl <T:Sync> RequiresShare for X<T> { }
 
 impl <T:Sync+'static> RequiresRequiresShareAndSend for X<T> { }
-//~^ ERROR `T: std::marker::Send` is not satisfied
+//~^ ERROR `T` cannot be sent between threads safely [E0277]
 
 fn main() { }
index 6dc5f39cb30dfa05a8cc741781deed0fd0bffefe..22dc9598d29ca1d373d409a63d9a5c261434a53e 100644 (file)
@@ -14,6 +14,6 @@
 trait Foo : Send { }
 
 impl Foo for std::rc::Rc<i8> { }
-//~^ ERROR `std::rc::Rc<i8>: std::marker::Send` is not satisfied
+//~^ ERROR `std::rc::Rc<i8>` cannot be sent between threads safely
 
 fn main() { }
index d4bb8de13d056fc84ff13e5eb52853f66520524b..e0b2043c1107c80e6fdc81f7565cbdaa94455dac 100644 (file)
@@ -12,6 +12,7 @@
 
 trait Foo : Send { }
 
-impl <T: Sync+'static> Foo for T { } //~ ERROR `T: std::marker::Send` is not satisfied
+impl <T: Sync+'static> Foo for T { }
+//~^ ERROR `T` cannot be sent between threads safely
 
 fn main() { }
index b9224e7be7f12eddf404f034462e1ccabf2f7305..12e9fb30902b5a5dafc6a488393984ebee701f57 100644 (file)
@@ -13,7 +13,7 @@ struct X<F> where F: FnOnce() + 'static + Send {
 }
 
 fn foo<F>(blk: F) -> X<F> where F: FnOnce() + 'static {
-    //~^ ERROR `F: std::marker::Send` is not satisfied
+    //~^ ERROR `F` cannot be sent between threads safely
     return X { field: blk };
 }
 
index 10c8f1eed00b0dfe89e26e241c48f738d69db49d..1dbdd42ca36e267e8e32f9bdcefe0cc9f54b9431 100644 (file)
@@ -43,5 +43,6 @@ pub fn main() {
     let f5: &mut Fat<ToBar> = &mut Fat { f1: 5, f2: "some str", ptr: Bar1 {f :42} };
     let z: Box<ToBar> = Box::new(Bar1 {f: 36});
     f5.ptr = *z;
-    //~^ ERROR `ToBar: std::marker::Sized` is not satisfied
+    //~^ ERROR the size for value values of type
+
 }
index ceaa371623223647c6eed876b18004a785f465a1..5bc6c6cda263afe3ca4762d48c83bd742198d714 100644 (file)
@@ -45,5 +45,5 @@ pub fn main() {
     //~| expected type `ToBar`
     //~| found type `Bar1`
     //~| expected trait ToBar, found struct `Bar1`
-    //~| ERROR `ToBar: std::marker::Sized` is not satisfied
+    //~| ERROR the size for value values of type
 }
index 4f7d07600ad154e68712ea96b736c627d8161d0c..37b6056d1a762328eea2d61e52f245bdbd109547 100644 (file)
@@ -47,5 +47,5 @@ pub fn main() {
     //~| expected type `ToBar`
     //~| found type `Bar1`
     //~| expected trait ToBar, found struct `Bar1`
-    //~| ERROR `ToBar: std::marker::Sized` is not satisfied
+    //~| ERROR the size for value values of type
 }
index 0c812b1d815ab000da92254d3c9cf6d4affb9a6e..82d81913cd3a3dbd6a290bc52ccb72c742d61459 100644 (file)
@@ -19,5 +19,5 @@ pub fn main() {
     let f: ([isize; 3],) = ([5, 6, 7],);
     let g: &([isize],) = &f;
     let h: &(([isize],),) = &(*g,);
-    //~^ ERROR `[isize]: std::marker::Sized` is not satisfied
+    //~^ ERROR the size for value values of type
 }
index f508364d75115fa74f7a10baab0c7f6f6a658a55..b8ca22185bc3c9dd33e4ca8f7c5833e2bb997eb1 100644 (file)
@@ -21,5 +21,5 @@ pub fn main() {
     let f: Fat<[isize; 3]> = Fat { ptr: [5, 6, 7] };
     let g: &Fat<[isize]> = &f;
     let h: &Fat<Fat<[isize]>> = &Fat { ptr: *g };
-    //~^ ERROR `[isize]: std::marker::Sized` is not satisfied
+    //~^ ERROR the size for value values of type
 }
index 8fafd78d407969ec26ee9b2cdf998a2554789a3f..4a892753595a72cb4f3c7a76550878aa8848cd05 100644 (file)
@@ -16,22 +16,22 @@ impl Foo for [u8] {}
 
 fn test1<T: ?Sized + Foo>(t: &T) {
     let u: &Foo = t;
-    //~^ ERROR `T: std::marker::Sized` is not satisfied
+    //~^ ERROR the size for value values of type
 }
 
 fn test2<T: ?Sized + Foo>(t: &T) {
     let v: &Foo = t as &Foo;
-    //~^ ERROR `T: std::marker::Sized` is not satisfied
+    //~^ ERROR the size for value values of type
 }
 
 fn test3() {
     let _: &[&Foo] = &["hi"];
-    //~^ ERROR `str: std::marker::Sized` is not satisfied
+    //~^ ERROR the size for value values of type
 }
 
 fn test4(x: &[u8]) {
     let _: &Foo = x as &Foo;
-    //~^ ERROR `[u8]: std::marker::Sized` is not satisfied
+    //~^ ERROR the size for value values of type
 }
 
 fn main() { }
index bd5fd3ee3b71eff738117678b3e34f4cf2da068c..0679556743228c28af4c363ed92fb6b08e72ddc1 100644 (file)
@@ -15,9 +15,9 @@
 trait Foo<T> : Sized { fn take(self, x: &T) { } } // Note: T is sized
 
 impl Foo<[isize]> for usize { }
-//~^ ERROR `[isize]: std::marker::Sized` is not satisfied
+//~^ ERROR the size for value values of type
 
 impl Foo<isize> for [usize] { }
-//~^ ERROR `[usize]: std::marker::Sized` is not satisfied
+//~^ ERROR the size for value values of type
 
 pub fn main() { }
index 6a7a515ba5fbba41d5f773408bbef7d4f8300b92..10abb80a2f71b9072c0422bc60926ef4a29fec1b 100644 (file)
@@ -24,5 +24,5 @@ fn main() {
     //~^ ERROR `A` cannot be shared between threads safely [E0277]
 
     assert_send::<A>();
-    //~^ ERROR the trait bound `A: std::marker::Send` is not satisfied
+    //~^ ERROR `A` cannot be sent between threads safely [E0277]
 }
index faa27894806f8d81c7f049d90086403069e6dd97..135b466161d77a0cbe88c62d9314bf9da04eebcd 100644 (file)
@@ -30,14 +30,14 @@ fn assert_sized<T>() { }
 
 fn main() {
     assert_sized::<A>();
-    //~^ ERROR the trait bound `A: std::marker::Sized` is not satisfied
+    //~^ ERROR the size for value values of type
 
     assert_sized::<Foo>();
-    //~^ ERROR the trait bound `A: std::marker::Sized` is not satisfied
+    //~^ ERROR the size for value values of type
 
     assert_sized::<Bar<A>>();
-    //~^ ERROR the trait bound `A: std::marker::Sized` is not satisfied
+    //~^ ERROR the size for value values of type
 
     assert_sized::<Bar<Bar<A>>>();
-    //~^ ERROR the trait bound `A: std::marker::Sized` is not satisfied
+    //~^ ERROR the size for value values of type
 }
index 84452accc9a4ac4abec7e0134f6a81c628cbaf24..5212cbb004efadffd955977b1e68fd8367cf749e 100644 (file)
@@ -10,5 +10,5 @@
 
 fn main() {
     let _x = "test" as &::std::any::Any;
-//~^ ERROR `str: std::marker::Sized` is not satisfied
+    //~^ ERROR the size for value values of type
 }
index 41349d7d7443b056bcaeb16498090e66b22ca71e..4756099ab95689c954112855ecfba28136c177e0 100644 (file)
@@ -15,7 +15,7 @@ fn dft_iter<'a, T>(arg1: Chunks<'a,T>, arg2: ChunksMut<'a,T>)
 {
     for
     &mut something
-//~^ ERROR `[T]: std::marker::Sized` is not satisfied
+    //~^ ERROR the size for value values of type
     in arg2
     {
     }
index 4996da057dd8ebc7be04358282479c5810b8a486..e7019ff7c0d21193caaa0a91119a31596622cdc1 100644 (file)
@@ -13,5 +13,5 @@
 
 fn main() {
     (|| Box::new(*(&[0][..])))();
-    //~^ ERROR `[{integer}]: std::marker::Sized` is not satisfied
+    //~^ ERROR the size for value values of type
 }
index 33d68c121bf2674a9d11e854690129b1b5a284fe..9239ceb341fc6da523732dbd941e7ccf80195488 100644 (file)
@@ -12,7 +12,7 @@ pub trait AbstractRenderer {}
 
 fn _create_render(_: &()) ->
     AbstractRenderer
-//~^ ERROR: `AbstractRenderer + 'static: std::marker::Sized` is not satisfied
+//~^ ERROR the size for value values of type
 {
     match 0 {
         _ => unimplemented!()
index 3e21360721b6d87a9076a72e7efdea81fe9d0405..0b717ec641375d8a27af24804aef5a8ebf91263b 100644 (file)
@@ -11,7 +11,7 @@
 type FuncType<'f> = Fn(&isize) -> isize + 'f;
 
 fn ho_func(f: Option<FuncType>) {
-    //~^ ERROR: `for<'r> std::ops::Fn(&'r isize) -> isize: std::marker::Sized` is not satisfied
+    //~^ ERROR the size for value values of type
 }
 
 fn main() {}
index b02757fb5a3133acdf5f81f1fdda9a98f644d0bd..426657ac92e2c868a902d9edec48f5701ce410e4 100644 (file)
@@ -15,7 +15,7 @@ trait From<Src> {
 }
 
 trait To {
-    fn to<Dst>(  //~ ERROR `Self: std::marker::Sized` is not satisfied
+    fn to<Dst>(  //~ ERROR the size for value values of type
         self
     ) -> <Dst as From<Self>>::Result where Dst: From<Self> {
         From::from(self)
index d1a139e698e12e78e876973aad18e49a00524495..8b7f2d5a4588e3334ce464e0959643bf2cc52a19 100644 (file)
@@ -14,5 +14,5 @@ fn main() {}
 
 impl The {
     fn iceman(c: Vec<[i32]>) {}
-    //~^ ERROR the trait bound `[i32]: std::marker::Sized` is not satisfied
+    //~^ ERROR the size for value values of type
 }
index 5eb0e4360fc93beeb208a294674ca837dded48d3..2d8d9c6565532c84ed65e24bb2b07a9e41c627f9 100644 (file)
@@ -10,7 +10,7 @@
 
 fn changer<'a>(mut things: Box<Iterator<Item=&'a mut u8>>) {
     for item in *things { *item = 0 }
-//~^ ERROR the trait bound `std::iter::Iterator<Item=&mut u8>: std::marker::Sized` is not satisfied
+//~^ ERROR the size for value values of type
 }
 
 fn main() {}
index cb0baee0a8787d538d5f484dc4bd15f34014cf55..b4f952c87d4aae25a705d07395a95812b67fcf1e 100644 (file)
@@ -17,5 +17,5 @@ fn foo<T: Send>() {}
 
 fn main() {
     foo::<HashMap<Rc<()>, Rc<()>>>();
-    //~^ ERROR: `std::rc::Rc<()>: std::marker::Send` is not satisfied
+    //~^ ERROR `std::rc::Rc<()>` cannot be sent between threads safely
 }
index 0df84a436c0a936f0409dd159ac6f8934e09d428..cb199580b10dd182137a89de62dd8404dea87a63 100644 (file)
@@ -10,7 +10,7 @@
 
 struct Table {
     rows: [[String]],
-    //~^ ERROR the trait bound `[std::string::String]: std::marker::Sized` is not satisfied [E0277]
+    //~^ ERROR the size for value values of type
 }
 
 fn f(table: &Table) -> &[String] {
index 5feeb36b1e4d4f86a833270e19edbbedcbf2fbb8..d6b5c32982554a3055ff4e911552bc4cd994fc6b 100644 (file)
@@ -14,7 +14,7 @@
 
 impl Struct {
     pub fn function(funs: Vec<Fn() -> ()>) {}
-    //~^ ERROR the trait bound `std::ops::Fn() + 'static: std::marker::Sized` is not satisfied
+    //~^ ERROR the size for value values of type
 }
 
 fn main() {}
index acd50bcf9e112fa0d608ba26e8f97f1c61b8f49b..74c68c50ae35aee6b8a773654d14a81c254f35d9 100644 (file)
@@ -10,8 +10,8 @@
 
 fn main() {
     static foo: Fn() -> u32 = || -> u32 {
-        //~^ ERROR: mismatched types
-        //~| ERROR: `std::ops::Fn() -> u32 + 'static: std::marker::Sized` is not satisfied
+        //~^ ERROR mismatched types
+        //~| ERROR the size for value values of type
         0
     };
 }
index 28180b05c8de8dcca986f5a6e34915d90f3df295..bc5567e1686d3ac16b35849c5d07f26cf8860c06 100644 (file)
@@ -10,7 +10,7 @@
 
 #[repr(packed)]
 pub struct Bad<T: ?Sized> {
-    data: T, //~ ERROR `T: std::marker::Sized` is not satisfied
+    data: T, //~ ERROR the size for value values of type
 }
 
 fn main() {}
index f34bef6224900620123f4fba8659e892f0efb9e6..6efc1f1024317ff8853c46faf4939921b845fb1f 100644 (file)
@@ -13,7 +13,7 @@
 trait Foo {
     const BAR: i32;
     fn foo(self) -> &'static i32 {
-        //~^ ERROR the trait bound `Self: std::marker::Sized` is not satisfied
+        //~^ ERROR the size for value values of type
         &<Self>::BAR
     }
 }
index c2e6a88a57bff7fedbc12259fc8e5c7229e9f88b..805b1a48a038012a67f2be38acb4ec080bcce1c3 100644 (file)
@@ -10,7 +10,7 @@
 
 enum E {
     V([Box<E>]),
-    //~^ ERROR the trait bound `[std::boxed::Box<E>]: std::marker::Sized` is not satisfied [E0277]
+    //~^ ERROR the size for value values of type
 }
 
 fn main() {}
index 896728b6da0f1df15d6b1a26f692556cd869f3cc..1b64d17bbeffe4b1de41f6c66aacbf2c465f68c1 100644 (file)
@@ -9,6 +9,6 @@
 // except according to those terms.
 
 fn _test(ref _p: str) {}
-//~^ ERROR the trait bound `str: std::marker::Sized` is not satisfied [E0277]
+//~^ ERROR the size for value values of type
 
 fn main() { }
index 31bc21c23ba5f08e1f2306a097717b9f4d041986..6207e669d0092ad790c994b743d3714bbe805a34 100644 (file)
@@ -9,8 +9,6 @@
 // except according to those terms.
 
 pub fn example(ref s: str) {}
-//~^ ERROR the trait bound `str: std::marker::Sized` is not satisfied
-//~| `str` does not have a constant size known at compile-time
-//~| the trait `std::marker::Sized` is not implemented for `str`
+//~^ ERROR the size for value values of type
 
 fn main() {}
index 06573b42b592db5c0dd61dc9ce62f311e39af538..2ab44433ede82151cd1e97320ad70b2127a26807 100644 (file)
 
 pub trait Foo {
     fn baz(_: Self::Target) where Self: Deref {}
-    //~^ ERROR `<Self as std::ops::Deref>::Target: std::marker::Sized` is not satisfied
+    //~^ ERROR the size for value values of type
 }
 
 pub fn f(_: ToString) {}
-//~^ ERROR the trait bound `std::string::ToString + 'static: std::marker::Sized` is not satisfied
+//~^ ERROR the size for value values of type
 
 fn main() { }
index e14d9f3a35c84ff0fda9e7f8eeca93feb2eb796a..82d4666ce549ca1a68de9c2fb58ba98a40e995b4 100644 (file)
@@ -15,8 +15,8 @@ struct Struct {
 }
 
 fn new_struct(r: A+'static)
-    -> Struct { //~^  ERROR `A + 'static: std::marker::Sized` is not satisfied
-    //~^ ERROR `A + 'static: std::marker::Sized` is not satisfied
+    -> Struct { //~^ ERROR the size for value values of type
+    //~^ ERROR the size for value values of type
     Struct { r: r }
 }
 
index 95bbd4eccf4ff08cebdb83bcad077d0847a4ebbf..0c19780bcb4cab442589df9fd9f661689308f137 100644 (file)
@@ -34,5 +34,5 @@ struct A {
 
 fn main() {
     let a = A {v: box B{v: None} as Box<Foo+Send>};
-    //~^ ERROR `std::rc::Rc<std::cell::RefCell<A>>: std::marker::Send` is not satisfied
+    //~^ ERROR `std::rc::Rc<std::cell::RefCell<A>>` cannot be sent between threads safely
 }
index 2a86cdef9812fb88da2b80c8950634921f6648a9..3a0e66f58e0765e0fd48d7a6726ae4451eb1f2bc 100644 (file)
@@ -26,15 +26,15 @@ impl<T: Send + Copy + 'static> Gettable<T> for S<T> {}
 fn f<T>(val: T) {
     let t: S<T> = S(marker::PhantomData);
     let a = &t as &Gettable<T>;
-    //~^ ERROR : std::marker::Send` is not satisfied
-    //~^^ ERROR : std::marker::Copy` is not satisfied
+    //~^ ERROR `T` cannot be sent between threads safely
+    //~| ERROR : std::marker::Copy` is not satisfied
 }
 
 fn g<T>(val: T) {
     let t: S<T> = S(marker::PhantomData);
     let a: &Gettable<T> = &t;
-    //~^ ERROR : std::marker::Send` is not satisfied
-    //~^^ ERROR : std::marker::Copy` is not satisfied
+    //~^ ERROR `T` cannot be sent between threads safely
+    //~| ERROR : std::marker::Copy` is not satisfied
 }
 
 fn foo<'a>() {
index dd77c2c138f4622df9b7a129959b05fb95e37d46..43c212b2af58278d8e7efe365edd2254d322e9e4 100644 (file)
@@ -18,5 +18,5 @@ fn bar<F:FnOnce() + Send>(_: F) { }
 fn main() {
     let x = Rc::new(3);
     bar(move|| foo(x));
-    //~^ ERROR : std::marker::Send` is not satisfied
+    //~^ ERROR `std::rc::Rc<usize>` cannot be sent between threads safely
 }
index a84eae0bfdae86c23b76bc403a58953f8ade4b48..a3eb47be3eed8a4212e2a9a7e233b5c0b25f6dee 100644 (file)
@@ -24,7 +24,8 @@ fn object_ref_with_static_bound_not_ok() {
 }
 
 fn box_object_with_no_bound_not_ok<'a>() {
-    assert_send::<Box<Dummy>>(); //~ ERROR : std::marker::Send` is not satisfied
+    assert_send::<Box<Dummy>>();
+    //~^ ERROR `Dummy` cannot be sent between threads safely
 }
 
 fn object_with_send_bound_ok() {
index 66865bbcc7ee12f162c7529f53bacd385e79b40f..673a6abc5f03df178b0abbf78bf8efc120e75c5b 100644 (file)
@@ -37,7 +37,7 @@ fn test61() {
 // them not ok
 fn test_71<'a>() {
     assert_send::<Box<Dummy+'a>>();
-    //~^ ERROR : std::marker::Send` is not satisfied
+    //~^ ERROR `Dummy + 'a` cannot be sent between threads safely
 }
 
 fn main() { }
index 51bc587d74ff83e5d84d179886a35fec57fcca2b..3a935af200054a0e3d6f20460fb88038cbe15090 100644 (file)
@@ -19,7 +19,8 @@ fn test50() {
 }
 
 fn test53() {
-    assert_send::<Box<Dummy>>(); //~ ERROR : std::marker::Send` is not satisfied
+    assert_send::<Box<Dummy>>();
+    //~^ ERROR `Dummy` cannot be sent between threads safely
 }
 
 // ...unless they are properly bounded
index 583381a1c28f5b23fc9753f8e2ef25f9b1dde529..e48460a87537f2d5aa62d2d41c6fb0e8d375696e 100644 (file)
@@ -19,7 +19,8 @@ fn assert_send<T:Send>() { }
 
 // but not if they own a bad thing
 fn test40() {
-    assert_send::<Box<*mut u8>>(); //~ ERROR : std::marker::Send` is not satisfied
+    assert_send::<Box<*mut u8>>();
+    //~^ ERROR `*mut u8` cannot be sent between threads safely
 }
 
 fn main() { }
index c717d1a72e05d31c536274cee20a703deb0062b2..99b995b0906b4edd66f0a2ee9a1770fd4a4c1389 100644 (file)
@@ -14,7 +14,7 @@ fn assert_send<T:Send>() { }
 
 fn test71<'a>() {
     assert_send::<*mut &'a isize>();
-    //~^ ERROR `*mut &'a isize: std::marker::Send` is not satisfied
+    //~^ ERROR `*mut &'a isize` cannot be sent between threads safely
 }
 
 fn main() {
index 334952cefa6e02f9612f3e761db590f966a07159..6825963c486470f69e41692e8e1a8f7058ef1fd0 100644 (file)
@@ -33,7 +33,7 @@ fn foo(x: Port<()>) -> foo {
     let x = foo(Port(Rc::new(())));
 
     thread::spawn(move|| {
-        //~^ ERROR `std::rc::Rc<()>: std::marker::Send` is not satisfied
+        //~^ ERROR `std::rc::Rc<()>` cannot be sent between threads safely
         let y = x;
         println!("{:?}", y);
     });
index 902710e96e274fbc0ffc8a83d61e739741ff1ded..83f19ed19efc22a5c0f3c4eb00388e6ea0ad45a9 100644 (file)
@@ -24,5 +24,5 @@ fn bar<T: Send>(_: T) {}
 fn main() {
     let x = Foo::A(NoSend);
     bar(x);
-    //~^ ERROR `NoSend: std::marker::Send` is not satisfied
+    //~^ ERROR `NoSend` cannot be sent between threads safely
 }
index f31d3787334916bffb1565d63bd1eaf5df7067a8..d3616d144229c648e8731f9034c7f2ce92946227 100644 (file)
@@ -15,5 +15,5 @@ fn bar<T: Send>(_: T) {}
 fn main() {
     let x = Rc::new(5);
     bar(x);
-    //~^ ERROR `std::rc::Rc<{integer}>: std::marker::Send` is not satisfied
+    //~^ ERROR `std::rc::Rc<{integer}>` cannot be sent between threads safely
 }
index b2ca4f9f5db16bb76a749cf8478733ded2a68b5e..d38d993e7e8e6f2af7b56da73b498f88b12b981b 100644 (file)
@@ -23,5 +23,5 @@ fn bar<T: Send>(_: T) {}
 fn main() {
     let x = Foo { a: 5 };
     bar(x);
-    //~^ ERROR `Foo: std::marker::Send` is not satisfied
+    //~^ ERROR `Foo` cannot be sent between threads safely
 }
index 7107211fc914b47479b2569515fee614191cca08..d750851b719e4e691a7691c24255a2480503c6df 100644 (file)
@@ -18,6 +18,6 @@ fn assert<T: UnwindSafe + ?Sized>() {}
 
 fn main() {
     assert::<Rc<RefCell<i32>>>();
-    //~^ ERROR `std::cell::UnsafeCell<i32>: std::panic::RefUnwindSafe` is not satisfied
-    //~^^ ERROR `std::cell::UnsafeCell<usize>: std::panic::RefUnwindSafe` is not satisfied
+    //~^ ERROR the type `std::cell::UnsafeCell<i32>` may contain interior mutability and a
+    //~| ERROR the type `std::cell::UnsafeCell<usize>` may contain interior mutability and a
 }
index 76c34e4dc0b448613ddaef1d2041ad8bc15f18dd..cd27b274258ea3d49619ef0622576c6cf22a003e 100644 (file)
@@ -18,6 +18,6 @@ fn assert<T: UnwindSafe + ?Sized>() {}
 
 fn main() {
     assert::<Arc<RefCell<i32>>>();
-    //~^ ERROR `std::cell::UnsafeCell<i32>: std::panic::RefUnwindSafe` is not satisfied
-    //~^^ ERROR `std::cell::UnsafeCell<usize>: std::panic::RefUnwindSafe` is not satisfied
+    //~^ ERROR the type `std::cell::UnsafeCell<i32>` may contain interior mutability and a
+    //~| ERROR the type `std::cell::UnsafeCell<usize>` may contain interior mutability and a
 }
index 177a43e2a7f71650a74955496b37f75cfc1b508f..956eca432c5f06f1602ca0e1a86723c62cce462c 100644 (file)
@@ -17,6 +17,6 @@ fn assert<T: UnwindSafe + ?Sized>() {}
 
 fn main() {
     assert::<&RefCell<i32>>();
-    //~^ ERROR `std::cell::UnsafeCell<i32>: std::panic::RefUnwindSafe` is not satisfied
-    //~^^ ERROR `std::cell::UnsafeCell<usize>: std::panic::RefUnwindSafe` is not satisfied
+    //~^ ERROR the type `std::cell::UnsafeCell<i32>` may contain interior mutability and a
+    //~| ERROR the type `std::cell::UnsafeCell<usize>` may contain interior mutability and a
 }
index f03e1d545a8083786f324118f27ebc25eb9f9a94..d0ca1db52120480d29447df6491d6f3190516b26 100644 (file)
@@ -17,6 +17,6 @@ fn assert<T: UnwindSafe + ?Sized>() {}
 
 fn main() {
     assert::<*mut RefCell<i32>>();
-    //~^ ERROR `std::cell::UnsafeCell<i32>: std::panic::RefUnwindSafe` is not satisfied
-    //~^^ ERROR `std::cell::UnsafeCell<usize>: std::panic::RefUnwindSafe` is not satisfied
+    //~^ ERROR the type `std::cell::UnsafeCell<i32>` may contain interior mutability and a
+    //~| ERROR the type `std::cell::UnsafeCell<usize>` may contain interior mutability and a
 }
index ece8fa7dc47bb12da8a4ffdbdad81c48a9a513e7..0ebf3d3fed7b5dcfb97c3764e3319c68148b15d1 100644 (file)
@@ -16,5 +16,6 @@
 fn assert<T: UnwindSafe + ?Sized>() {}
 
 fn main() {
-    assert::<&mut i32>(); //~ ERROR: UnwindSafe` is not satisfied
+    assert::<&mut i32>();
+    //~^ ERROR the type `&mut i32` may not be safely transferred across an unwind boundary
 }
index 58794e3b35d531c897a3eee98be7e5ca5e33961b..ed26204bbe10920d39a5896ae8c9d0e9a949ed03 100644 (file)
@@ -22,5 +22,5 @@ pub fn main() {
     // Unsized type.
     let arr: &[_] = &[1, 2, 3];
     let range = *arr..;
-    //~^ ERROR `[{integer}]: std::marker::Sized` is not satisfied
+    //~^ ERROR the size for value values of type
 }
index 32f9b83b6e2c77f556439d8e5cbf4851f1ecca11..78d3702b449caa7613cb167d13d30c4005a2f825 100644 (file)
 #[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)]
 struct AllTheRanges {
     a: Range<usize>,
-    //~^ ERROR PartialOrd
-    //~^^ ERROR Ord
+    //~^ ERROR can't compare
+    //~| ERROR Ord
     b: RangeTo<usize>,
-    //~^ ERROR PartialOrd
-    //~^^ ERROR Ord
+    //~^ ERROR can't compare
+    //~| ERROR Ord
     c: RangeFrom<usize>,
-    //~^ ERROR PartialOrd
-    //~^^ ERROR Ord
+    //~^ ERROR can't compare
+    //~| ERROR Ord
     d: RangeFull,
-    //~^ ERROR PartialOrd
-    //~^^ ERROR Ord
+    //~^ ERROR can't compare
+    //~| ERROR Ord
     e: RangeInclusive<usize>,
-    //~^ ERROR PartialOrd
-    //~^^ ERROR Ord
+    //~^ ERROR can't compare
+    //~| ERROR Ord
     f: RangeToInclusive<usize>,
-    //~^ ERROR PartialOrd
-    //~^^ ERROR Ord
+    //~^ ERROR can't compare
+    //~| ERROR Ord
 }
 
 fn main() {}
index 2b2c23a3ce4e92c88fee61c0c242775e1a65cc7d..b5f1ffb977ed630e85a2bebd1c8c09a67a7fb943 100644 (file)
@@ -10,5 +10,5 @@
 
 pub fn main() {
     let s: &str = "hello";
-    let c: u8 = s[4]; //~ ERROR `str: std::ops::Index<{integer}>` is not satisfied
+    let c: u8 = s[4]; //~ ERROR the type `str` cannot be indexed by `{integer}`
 }
index 219fcdfd7026531d935abbe1354da050de769ef0..cc5fd7e3f24d82fd64dcd99b7ec1a35810b90463 100644 (file)
@@ -12,10 +12,10 @@ fn bot<T>() -> T { loop {} }
 
 fn mutate(s: &mut str) {
     s[1..2] = bot();
-    //~^ ERROR `str: std::marker::Sized` is not satisfied
-    //~| ERROR `str: std::marker::Sized` is not satisfied
+    //~^ ERROR the size for value values of type
+    //~| ERROR the size for value values of type
     s[1usize] = bot();
-    //~^ ERROR `str: std::ops::IndexMut<usize>` is not satisfied
+    //~^ ERROR the type `str` cannot be mutably indexed by `usize`
 }
 
 pub fn main() {}
index c857790e342d0270921b9028c0b0329c2a5b22ae..b8557cb79e38743d5008faa28819f2cc39ac122c 100644 (file)
@@ -56,6 +56,6 @@ fn foo<'z>() where &'z (): Sized {
     //[normal]~| found type `fn() {foo::<'static>}`
 
     <str as Foo<u8>>::bar;
-    //[verbose]~^ ERROR `str: std::marker::Sized` is not satisfied
-    //[normal]~^^ ERROR `str: std::marker::Sized` is not satisfied
+    //[verbose]~^ ERROR the size for value values of type
+    //[normal]~^^ ERROR the size for value values of type
 }
index 983c66ec1c40fba449e4ba1490512cd00521d9b3..89fddf1f65f0240ea7f391358ea8d43ffc98d866 100644 (file)
@@ -15,7 +15,7 @@ fn dummy(&self) { }
 // This should emit the less confusing error, not the more confusing one.
 
 fn foo(_x: Foo + Send) {
-    //~^ ERROR the trait bound `Foo + std::marker::Send + 'static: std::marker::Sized` is not
+    //~^ ERROR the size for value values of type
 }
 
 fn main() { }
index 8014f92e1734438b5765e21caaaeb77f01395927..a272686c535738ab38071e163c12b2c14cc47d73 100644 (file)
@@ -31,8 +31,8 @@ fn dummy() {
     impl !Send for TestType {}
 
     Outer(TestType);
-    //~^ ERROR `dummy::TestType: std::marker::Send` is not satisfied
-    //~| ERROR `dummy::TestType: std::marker::Send` is not satisfied
+    //~^ ERROR `dummy::TestType` cannot be sent between threads safely
+    //~| ERROR `dummy::TestType` cannot be sent between threads safely
 }
 
 fn dummy1b() {
@@ -40,7 +40,7 @@ fn dummy1b() {
     impl !Send for TestType {}
 
     is_send(TestType);
-    //~^ ERROR `dummy1b::TestType: std::marker::Send` is not satisfied
+    //~^ ERROR `dummy1b::TestType` cannot be sent between threads safely
 }
 
 fn dummy1c() {
@@ -48,7 +48,7 @@ fn dummy1c() {
     impl !Send for TestType {}
 
     is_send((8, TestType));
-    //~^ ERROR `dummy1c::TestType: std::marker::Send` is not satisfied
+    //~^ ERROR `dummy1c::TestType` cannot be sent between threads safely
 }
 
 fn dummy2() {
@@ -56,7 +56,7 @@ fn dummy2() {
     impl !Send for TestType {}
 
     is_send(Box::new(TestType));
-    //~^ ERROR `dummy2::TestType: std::marker::Send` is not satisfied
+    //~^ ERROR `dummy2::TestType` cannot be sent between threads safely
 }
 
 fn dummy3() {
@@ -64,7 +64,7 @@ fn dummy3() {
     impl !Send for TestType {}
 
     is_send(Box::new(Outer2(TestType)));
-    //~^ ERROR `dummy3::TestType: std::marker::Send` is not satisfied
+    //~^ ERROR `dummy3::TestType` cannot be sent between threads safely
 }
 
 fn main() {
@@ -74,5 +74,5 @@ impl !Send for TestType {}
     // This will complain about a missing Send impl because `Sync` is implement *just*
     // for T that are `Send`. Look at #20366 and #19950
     is_sync(Outer2(TestType));
-    //~^ ERROR `main::TestType: std::marker::Send` is not satisfied
+    //~^ ERROR `main::TestType` cannot be sent between threads safely
 }
index 853718f1e77d08ddcc68ca765eaa4173550cc76e..65438e5df8e08e73a2256c0f961038b76ff19227 100644 (file)
@@ -27,5 +27,5 @@ fn is_send<T: Send>() {}
 fn main() {
     is_send::<MySendable>();
     is_send::<MyNotSendable>();
-    //~^ ERROR `MyNotSendable: std::marker::Send` is not satisfied
+    //~^ ERROR `MyNotSendable` cannot be sent between threads safely
 }
index a238eaf052508460677a4c59f893754a2abf70f3..a9a2a3c4c92a11064698d939d08873d183f41f8b 100644 (file)
 #![feature(untagged_unions)]
 
 union U {
-    a: str, //~ ERROR the trait bound `str: std::marker::Sized` is not satisfied
+    a: str,
+    //~^ ERROR the size for value values of type
+
     b: u8,
 }
 
 union W {
     a: u8,
-    b: str, //~ ERROR the trait bound `str: std::marker::Sized` is not satisfied
+    b: str,
+    //~^ ERROR the size for value values of type
 }
 
 fn main() {}
index 3dcc7d248d72db316eb7848174d9f19ae48c38de..736794ac5384e0c768404c791b9ce6b2dcfaf34c 100644 (file)
@@ -9,5 +9,6 @@
 // except according to those terms.
 
 fn bar<T: Sized>() { }
-fn foo<T: ?Sized>() { bar::<T>() } //~ ERROR `T: std::marker::Sized` is not satisfied
+fn foo<T: ?Sized>() { bar::<T>() }
+//~^ ERROR the size for value values of type
 fn main() { }
index 5d791215f36c60108c3819e98d69d498b252a7b5..f9702e29f1dc36ea44cc03fda326ca6859c58523 100644 (file)
@@ -15,7 +15,7 @@ fn not_sized<T: ?Sized>() { }
 enum Foo<U> { FooSome(U), FooNone }
 fn foo1<T>() { not_sized::<Foo<T>>() } // Hunky dory.
 fn foo2<T: ?Sized>() { not_sized::<Foo<T>>() }
-//~^ ERROR `T: std::marker::Sized` is not satisfied
+//~^ ERROR the size for value values of type
 //
 // Not OK: `T` is not sized.
 
index 4d0774f2ce44157743fbdc6135a37874b7808eb7..03d3d98b59f012d62b54c16c73817128db8da673 100644 (file)
@@ -14,7 +14,8 @@
 
 struct S5<Y>(Y);
 
-impl<X: ?Sized> S5<X> { //~ ERROR E0277
+impl<X: ?Sized> S5<X> {
+    //~^ ERROR the size for value values of type
 }
 
 fn main() { }
index bbefb2fcecd80f7ba78fcd03abedf8d7fa702e7e..8cb1f760664de469aec6c0572f6ab7086c1d619e 100644 (file)
@@ -15,14 +15,14 @@ fn not_sized<T: ?Sized>() { }
 struct Foo<T> { data: T }
 fn foo1<T>() { not_sized::<Foo<T>>() } // Hunky dory.
 fn foo2<T: ?Sized>() { not_sized::<Foo<T>>() }
-//~^ ERROR `T: std::marker::Sized` is not satisfied
+//~^ ERROR the size for value values of type
 //
 // Not OK: `T` is not sized.
 
 struct Bar<T: ?Sized> { data: T }
 fn bar1<T: ?Sized>() { not_sized::<Bar<T>>() }
 fn bar2<T: ?Sized>() { is_sized::<Bar<T>>() }
-//~^ ERROR `T: std::marker::Sized` is not satisfied
+//~^ ERROR the size for value values of type
 //
 // Not OK: `Bar<T>` is not sized, but it should be.
 
index c919bdf924f6566bb8b707451d7b860e3e397e31..b3610a4c9b9b64b8f0ddd5921e3e181fa9649ec7 100644 (file)
@@ -17,7 +17,8 @@ trait T3<Z: ?Sized> {
 
 struct S5<Y>(Y);
 
-impl<X: ?Sized> T3<X> for S5<X> { //~ ERROR E0277
+impl<X: ?Sized> T3<X> for S5<X> {
+    //~^ ERROR the size for value values of type
 }
 
 fn main() { }
index ad5e4c2daef9ea010cc8eb8f086f7a2721195e53..50a058a4338d8d56f9813d32dbedddce449a2cb9 100644 (file)
@@ -16,7 +16,7 @@ trait T2<Z> {
 }
 struct S4<Y: ?Sized>(Box<Y>);
 impl<X: ?Sized> T2<X> for S4<X> {
-    //~^ ERROR `X: std::marker::Sized` is not satisfied
+    //~^ ERROR the size for value values of type
 }
 
 fn main() { }
index e96e0ea3aec3623ec0d57b2a3e4aae3927c2adaf..945f20b28779ed9963fd552ca7c47a28683f830f 100644 (file)
@@ -15,7 +15,7 @@
 // Unbounded.
 fn f1<X: ?Sized>(x: &X) {
     f2::<X>(x);
-    //~^ ERROR `X: std::marker::Sized` is not satisfied
+    //~^ ERROR the size for value values of type
 }
 fn f2<X>(x: &X) {
 }
@@ -26,7 +26,7 @@ fn foo(&self) { }
 }
 fn f3<X: ?Sized + T>(x: &X) {
     f4::<X>(x);
-    //~^ ERROR `X: std::marker::Sized` is not satisfied
+    //~^ ERROR the size for value values of type
 }
 fn f4<X: T>(x: &X) {
 }
@@ -41,20 +41,20 @@ struct S<X: ?Sized> {
 
 fn f8<X: ?Sized>(x1: &S<X>, x2: &S<X>) {
     f5(x1);
-    //~^ ERROR `X: std::marker::Sized` is not satisfied
+    //~^ ERROR the size for value values of type
     f6(x2); // ok
 }
 
 // Test some tuples.
 fn f9<X: ?Sized>(x1: Box<S<X>>) {
     f5(&(*x1, 34));
-    //~^ ERROR `X: std::marker::Sized` is not satisfied
+    //~^ ERROR the size for value values of type
 }
 
 fn f10<X: ?Sized>(x1: Box<S<X>>) {
     f5(&(32, *x1));
-    //~^ ERROR `X: std::marker::Sized` is not satisfied
-    //~| ERROR `X: std::marker::Sized` is not satisfied
+    //~^ ERROR the size for value values of type
+    //~| ERROR the size for value values of type
 }
 
 pub fn main() {
index 3e6c9cc4061e1cb8ff7a02bf94e5048404f4d410..e04aa3599e9b5805e47af228ffcdf65d3287d1c5 100644 (file)
 // Test `?Sized` types not allowed in fields (except the last one).
 
 struct S1<X: ?Sized> {
-    f1: X, //~ ERROR `X: std::marker::Sized` is not satisfied
+    f1: X,
+    //~^ ERROR the size for value values of type
     f2: isize,
 }
 struct S2<X: ?Sized> {
     f: isize,
-    g: X, //~ ERROR `X: std::marker::Sized` is not satisfied
+    g: X,
+    //~^ ERROR the size for value values of type
     h: isize,
 }
 struct S3 {
-    f: str, //~ ERROR `str: std::marker::Sized` is not satisfied
+    f: str,
+    //~^ ERROR the size for value values of type
     g: [usize]
 }
 struct S4 {
-    f: [u8], //~ ERROR `[u8]: std::marker::Sized` is not satisfied
+    f: [u8],
+    //~^ ERROR the size for value values of type
     g: usize
 }
 enum E<X: ?Sized> {
-    V1(X, isize), //~ERROR `X: std::marker::Sized` is not satisfied
+    V1(X, isize),
+    //~^ ERROR the size for value values of type
 }
 enum F<X: ?Sized> {
-    V2{f1: X, f: isize}, //~ERROR `X: std::marker::Sized` is not satisfied
+    V2{f1: X, f: isize},
+    //~^ ERROR the size for value values of type
 }
 
 pub fn main() {
index dec8699f46e3b3542b67f6f22377d0292b08f691..8ac9fe4c58787b1a54cd78cb0bd4acafd4dbf2e7 100644 (file)
@@ -14,28 +14,41 @@ trait T {}
 
 fn f1<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?Sized>(x: &X) {
     let _: W; // <-- this is OK, no bindings created, no initializer.
-    let _: (isize, (X, isize)); //~ERROR `X: std::marker::Sized` is not satisfie
-    let y: Y; //~ERROR `Y: std::marker::Sized` is not satisfied
-    let y: (isize, (Z, usize)); //~ERROR `Z: std::marker::Sized` is not satisfied
+    let _: (isize, (X, isize));
+    //~^ ERROR the size for value values of type
+    let y: Y;
+    //~^ ERROR the size for value values of type
+    let y: (isize, (Z, usize));
+    //~^ ERROR the size for value values of type
 }
 fn f2<X: ?Sized, Y: ?Sized>(x: &X) {
-    let y: X; //~ERROR `X: std::marker::Sized` is not satisfied
-    let y: (isize, (Y, isize)); //~ERROR `Y: std::marker::Sized` is not satisfied
+    let y: X;
+    //~^ ERROR the size for value values of type
+    let y: (isize, (Y, isize));
+    //~^ ERROR the size for value values of type
 }
 
 fn f3<X: ?Sized>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
-    let y: X = *x1; //~ERROR `X: std::marker::Sized` is not satisfied
-    let y = *x2; //~ERROR `X: std::marker::Sized` is not satisfied
-    let (y, z) = (*x3, 4); //~ERROR `X: std::marker::Sized` is not satisfied
+    let y: X = *x1;
+    //~^ ERROR the size for value values of type
+    let y = *x2;
+    //~^ ERROR the size for value values of type
+    let (y, z) = (*x3, 4);
+    //~^ ERROR the size for value values of type
 }
 fn f4<X: ?Sized + T>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
-    let y: X = *x1;         //~ERROR `X: std::marker::Sized` is not satisfied
-    let y = *x2;            //~ERROR `X: std::marker::Sized` is not satisfied
-    let (y, z) = (*x3, 4); //~ERROR `X: std::marker::Sized` is not satisfied
+    let y: X = *x1;
+    //~^ ERROR the size for value values of type
+    let y = *x2;
+    //~^ ERROR the size for value values of type
+    let (y, z) = (*x3, 4);
+    //~^ ERROR the size for value values of type
 }
 
-fn g1<X: ?Sized>(x: X) {} //~ERROR `X: std::marker::Sized` is not satisfied
-fn g2<X: ?Sized + T>(x: X) {} //~ERROR `X: std::marker::Sized` is not satisfied
+fn g1<X: ?Sized>(x: X) {}
+//~^ ERROR the size for value values of type
+fn g2<X: ?Sized + T>(x: X) {}
+//~^ ERROR the size for value values of type
 
 pub fn main() {
 }
index 25868c594feb675326960008eff1724b43b84763..44d7df35680ce3bee8d5a6c7ea416d38514ce537 100644 (file)
@@ -20,7 +20,7 @@ trait T1<Z: T> {
 
 struct S3<Y: ?Sized>(Box<Y>);
 impl<X: ?Sized + T> T1<X> for S3<X> {
-    //~^ ERROR `X: std::marker::Sized` is not satisfied
+    //~^ ERROR the size for value values of type
 }
 
 fn main() { }
index b9b03c9b9ec6224219220fbbfeab29cab562bf68..4271382ed5b22e06e40ee85af03714854b148513 100644 (file)
@@ -1,8 +1,11 @@
-error: invalid ABI: expected one of [cdecl, stdcall, fastcall, vectorcall, thiscall, aapcs, win64, sysv64, ptx-kernel, msp430-interrupt, x86-interrupt, Rust, C, system, rust-intrinsic, rust-call, platform-intrinsic, unadjusted], found `路濫狼á́́`
+error[E0703]: invalid ABI: found `路濫狼á́́`
   --> $DIR/unicode.rs:11:8
    |
 LL | extern "路濫狼á́́" fn foo() {} //~ ERROR invalid ABI
-   |        ^^^^^^^^^
+   |        ^^^^^^^^^ invalid ABI
+   |
+   = help: valid ABIs: cdecl, stdcall, fastcall, vectorcall, thiscall, aapcs, win64, sysv64, ptx-kernel, msp430-interrupt, x86-interrupt, Rust, C, system, rust-intrinsic, rust-call, platform-intrinsic, unadjusted
 
 error: aborting due to previous error
 
+For more information about this error, try `rustc --explain E0703`.
index c6ce34b60ca770d11733b2fd88914429ab352b87..c0a367604c374be88f353433d4c2b54b5b47420d 100644 (file)
 use std::fmt::Debug;
 
 const CONST_0: Debug+Sync = *(&0 as &(Debug+Sync));
-//~^ ERROR `std::fmt::Debug + std::marker::Sync + 'static: std::marker::Sized` is not satisfied
+//~^ ERROR the size for value values of type
 
 const CONST_FOO: str = *"foo";
-//~^ ERROR `str: std::marker::Sized` is not satisfied
+//~^ ERROR the size for value values of type
 
 static STATIC_1: Debug+Sync = *(&1 as &(Debug+Sync));
-//~^ ERROR `std::fmt::Debug + std::marker::Sync + 'static: std::marker::Sized` is not satisfied
+//~^ ERROR the size for value values of type
 
 static STATIC_BAR: str = *"bar";
-//~^ ERROR `str: std::marker::Sized` is not satisfied
+//~^ ERROR the size for value values of type
 
 fn main() {
     println!("{:?} {:?} {:?} {:?}", &CONST_0, &CONST_FOO, &STATIC_1, &STATIC_BAR);
index 0bbb5debbba69c02be8cf109c2e2c26242e4d3f0..2cde4aec2b5d47b84e1fb8cc67a1264fbe88394f 100644 (file)
@@ -1,37 +1,41 @@
-error[E0277]: the trait bound `std::fmt::Debug + std::marker::Sync + 'static: std::marker::Sized` is not satisfied
+error[E0277]: the size for value values of type `std::fmt::Debug + std::marker::Sync + 'static` cannot be known at compilation time
   --> $DIR/const-unsized.rs:13:29
    |
 LL | const CONST_0: Debug+Sync = *(&0 as &(Debug+Sync));
-   |                             ^^^^^^^^^^^^^^^^^^^^^^ `std::fmt::Debug + std::marker::Sync + 'static` does not have a constant size known at compile-time
+   |                             ^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
    |
    = help: the trait `std::marker::Sized` is not implemented for `std::fmt::Debug + std::marker::Sync + 'static`
+   = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
    = note: constant expressions must have a statically known size
 
-error[E0277]: the trait bound `str: std::marker::Sized` is not satisfied
+error[E0277]: the size for value values of type `str` cannot be known at compilation time
   --> $DIR/const-unsized.rs:16:24
    |
 LL | const CONST_FOO: str = *"foo";
-   |                        ^^^^^^ `str` does not have a constant size known at compile-time
+   |                        ^^^^^^ doesn't have a size known at compile-time
    |
    = help: the trait `std::marker::Sized` is not implemented for `str`
+   = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
    = note: constant expressions must have a statically known size
 
-error[E0277]: the trait bound `std::fmt::Debug + std::marker::Sync + 'static: std::marker::Sized` is not satisfied
+error[E0277]: the size for value values of type `std::fmt::Debug + std::marker::Sync + 'static` cannot be known at compilation time
   --> $DIR/const-unsized.rs:19:31
    |
 LL | static STATIC_1: Debug+Sync = *(&1 as &(Debug+Sync));
-   |                               ^^^^^^^^^^^^^^^^^^^^^^ `std::fmt::Debug + std::marker::Sync + 'static` does not have a constant size known at compile-time
+   |                               ^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
    |
    = help: the trait `std::marker::Sized` is not implemented for `std::fmt::Debug + std::marker::Sync + 'static`
+   = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
    = note: constant expressions must have a statically known size
 
-error[E0277]: the trait bound `str: std::marker::Sized` is not satisfied
+error[E0277]: the size for value values of type `str` cannot be known at compilation time
   --> $DIR/const-unsized.rs:22:26
    |
 LL | static STATIC_BAR: str = *"bar";
-   |                          ^^^^^^ `str` does not have a constant size known at compile-time
+   |                          ^^^^^^ doesn't have a size known at compile-time
    |
    = help: the trait `std::marker::Sized` is not implemented for `str`
+   = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
    = note: constant expressions must have a statically known size
 
 error: aborting due to 4 previous errors
index 4d1c50002a39c1f6e6b53dbdcd10d1a03fb00329..313aa1f706e9320b186743ce46dcd6d7d5db648d 100644 (file)
@@ -24,5 +24,5 @@ fn is_send<T: Send>() { }
 
 fn main() {
     is_send::<Foo>();
-    //~^ ERROR the trait bound `*const u8: std::marker::Send` is not satisfied in `Foo`
+    //~^ ERROR `*const u8` cannot be sent between threads safely
 }
index bbe04cfc6e16d9ceb708e684a32915ddd719f400..32776f028b4cec69fc7657c3c899c625b3fbb807 100644 (file)
@@ -1,4 +1,4 @@
-error[E0277]: the trait bound `*const u8: std::marker::Send` is not satisfied in `Foo`
+error[E0277]: `*const u8` cannot be sent between threads safely
   --> $DIR/E0277-2.rs:26:5
    |
 LL |     is_send::<Foo>();
index b29e435701507c931552e16e8145f3094e6bbcc4..95f10e7206f92ec7816fbe2d564f9f4d88bd7333 100644 (file)
@@ -21,7 +21,7 @@ fn some_func<T: Foo>(foo: T) {
 }
 
 fn f(p: Path) { }
-//~^ ERROR the trait bound `[u8]: std::marker::Sized` is not satisfied in `std::path::Path`
+//~^ ERROR the size for value values of type
 
 fn main() {
     some_func(5i32);
index 477128d7d9f08c0ef47c864acf86a6a57e47aa7e..ca5b0d2b987d6ac2c06c43c844ba070acd334c71 100644 (file)
@@ -1,10 +1,11 @@
-error[E0277]: the trait bound `[u8]: std::marker::Sized` is not satisfied in `std::path::Path`
+error[E0277]: the size for value values of type `[u8]` cannot be known at compilation time
   --> $DIR/E0277.rs:23:6
    |
 LL | fn f(p: Path) { }
-   |      ^ `[u8]` does not have a constant size known at compile-time
+   |      ^ doesn't have a size known at compile-time
    |
    = help: within `std::path::Path`, the trait `std::marker::Sized` is not implemented for `[u8]`
+   = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
    = note: required because it appears within the type `std::path::Path`
    = note: all local variables must have a statically known size
 
index 9c2c80600b8c8f0f80204850a963298e5a62e7fd..db280f2d1f763540068c4d73fd5712b36ba610e8 100644 (file)
@@ -87,38 +87,41 @@ LL | | }
    = help: see issue #48214
    = help: add #![feature(trivial_bounds)] to the crate attributes to enable
 
-error[E0277]: the trait bound `str: std::marker::Sized` is not satisfied
+error[E0277]: the size for value values of type `str` cannot be known at compilation time
   --> $DIR/feature-gate-trivial_bounds.rs:62:1
    |
 LL | struct TwoStrs(str, str) where str: Sized; //~ ERROR
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `str` does not have a constant size known at compile-time
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
    |
    = help: the trait `std::marker::Sized` is not implemented for `str`
+   = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
    = help: see issue #48214
    = help: add #![feature(trivial_bounds)] to the crate attributes to enable
 
-error[E0277]: the trait bound `A + 'static: std::marker::Sized` is not satisfied in `Dst<A + 'static>`
+error[E0277]: the size for value values of type `A + 'static` cannot be known at compilation time
   --> $DIR/feature-gate-trivial_bounds.rs:65:1
    |
 LL | / fn unsized_local() where Dst<A>: Sized { //~ ERROR
 LL | |     let x: Dst<A> = *(Box::new(Dst { x: 1 }) as Box<Dst<A>>);
 LL | | }
-   | |_^ `A + 'static` does not have a constant size known at compile-time
+   | |_^ doesn't have a size known at compile-time
    |
    = help: within `Dst<A + 'static>`, the trait `std::marker::Sized` is not implemented for `A + 'static`
+   = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
    = note: required because it appears within the type `Dst<A + 'static>`
    = help: see issue #48214
    = help: add #![feature(trivial_bounds)] to the crate attributes to enable
 
-error[E0277]: the trait bound `str: std::marker::Sized` is not satisfied
+error[E0277]: the size for value values of type `str` cannot be known at compilation time
   --> $DIR/feature-gate-trivial_bounds.rs:69:1
    |
 LL | / fn return_str() -> str where str: Sized { //~ ERROR
 LL | |     *"Sized".to_string().into_boxed_str()
 LL | | }
-   | |_^ `str` does not have a constant size known at compile-time
+   | |_^ doesn't have a size known at compile-time
    |
    = help: the trait `std::marker::Sized` is not implemented for `str`
+   = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
    = help: see issue #48214
    = help: add #![feature(trivial_bounds)] to the crate attributes to enable
 
index a1c8ca77e41e8bf34ff228ae6c5470f98be8167a..efaee4095c1487a925c9437c992776004632c9a4 100644 (file)
 
 fn main() {
    let s = String::from("foo");
-   let mut gen = move || { //~ ERROR the trait bound `str: std::marker::Sized` is not satisfied
+   let mut gen = move || {
+   //~^ ERROR the size for value values of type
        yield s[..];
    };
-   unsafe { gen.resume(); } //~ ERROR the trait bound `str: std::marker::Sized` is not satisfied
+   unsafe { gen.resume(); }
+   //~^ ERROR the size for value values of type
 }
index 957fac172c2588dd071245ec89e53b1bd7b5e1cd..2938268a804ae1dfeb598a8dfbc6fa506920ed3e 100644 (file)
@@ -1,22 +1,25 @@
-error[E0277]: the trait bound `str: std::marker::Sized` is not satisfied
+error[E0277]: the size for value values of type `str` cannot be known at compilation time
   --> $DIR/sized-yield.rs:17:26
    |
-LL |      let mut gen = move || { //~ ERROR the trait bound `str: std::marker::Sized` is not satisfied
+LL |      let mut gen = move || {
    |  __________________________^
+LL | |    //~^ ERROR the size for value values of type
 LL | |        yield s[..];
 LL | |    };
-   | |____^ `str` does not have a constant size known at compile-time
+   | |____^ doesn't have a size known at compile-time
    |
    = help: the trait `std::marker::Sized` is not implemented for `str`
+   = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
    = note: the yield type of a generator must have a statically known size
 
-error[E0277]: the trait bound `str: std::marker::Sized` is not satisfied
-  --> $DIR/sized-yield.rs:20:17
+error[E0277]: the size for value values of type `str` cannot be known at compilation time
+  --> $DIR/sized-yield.rs:21:17
    |
-LL |    unsafe { gen.resume(); } //~ ERROR the trait bound `str: std::marker::Sized` is not satisfied
-   |                 ^^^^^^ `str` does not have a constant size known at compile-time
+LL |    unsafe { gen.resume(); }
+   |                 ^^^^^^ doesn't have a size known at compile-time
    |
    = help: the trait `std::marker::Sized` is not implemented for `str`
+   = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
 
 error: aborting due to 2 previous errors
 
index abb3682a4987a3533b8b70b8d75c53e381f6b54b..f6b64b394fc12580dfceb696ee1799170aea1713 100644 (file)
@@ -25,7 +25,7 @@ fn cycle1() -> impl Clone {
     //~^ ERROR cycle detected
     //~| ERROR cycle detected
     send(cycle2().clone());
-    //~^ ERROR Send` is not satisfied
+    //~^ ERROR `std::rc::Rc<std::string::String>` cannot be sent between threads safely
 
     Rc::new(Cell::new(5))
 }
index 4537c96c4ab3b8319984f8f5d09d1c97604c38a5..b34facd2d39ce471e76832022c5f3ca92d66377f 100644 (file)
@@ -47,7 +47,7 @@ LL | fn cycle2() -> impl Clone {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^
    = note: ...which again requires processing `cycle1::{{exist-impl-Trait}}`, completing the cycle
 
-error[E0277]: the trait bound `std::rc::Rc<std::string::String>: std::marker::Send` is not satisfied in `impl std::clone::Clone`
+error[E0277]: `std::rc::Rc<std::string::String>` cannot be sent between threads safely
   --> $DIR/auto-trait-leak.rs:27:5
    |
 LL |     send(cycle2().clone());
index 16310e67f1bb9c26f1f68d89302fb666886f0925..3c61543a711bd8f3762378c6a025d10ebd253e41 100644 (file)
@@ -23,10 +23,10 @@ fn send<T: Send>(_: T) {}
 
 fn main() {
     send(before());
-    //~^ ERROR the trait bound `std::rc::Rc<std::cell::Cell<i32>>: std::marker::Send` is not satisfied
+    //~^ ERROR `std::rc::Rc<std::cell::Cell<i32>>` cannot be sent between threads safely
 
     send(after());
-    //~^ ERROR the trait bound `std::rc::Rc<std::cell::Cell<i32>>: std::marker::Send` is not satisfied
+    //~^ ERROR `std::rc::Rc<std::cell::Cell<i32>>` cannot be sent between threads safely
 }
 
 // Deferred path, main has to wait until typeck finishes,
index 59623aed3d2b73fdb5b7c7854cc2f6c1d5653aaf..fb00c41f79c8f4c4e0fcbd357602c31bb8023ae7 100644 (file)
@@ -1,4 +1,4 @@
-error[E0277]: the trait bound `std::rc::Rc<std::cell::Cell<i32>>: std::marker::Send` is not satisfied in `impl std::ops::Fn<(i32,)>`
+error[E0277]: `std::rc::Rc<std::cell::Cell<i32>>` cannot be sent between threads safely
   --> $DIR/auto-trait-leak2.rs:25:5
    |
 LL |     send(before());
@@ -13,7 +13,7 @@ note: required by `send`
 LL | fn send<T: Send>(_: T) {}
    | ^^^^^^^^^^^^^^^^^^^^^^
 
-error[E0277]: the trait bound `std::rc::Rc<std::cell::Cell<i32>>: std::marker::Send` is not satisfied in `impl std::ops::Fn<(i32,)>`
+error[E0277]: `std::rc::Rc<std::cell::Cell<i32>>` cannot be sent between threads safely
   --> $DIR/auto-trait-leak2.rs:28:5
    |
 LL |     send(after());
index a772d1f90cc0b5050ad4f4bab5c6bb2cad20695f..b0288463e9157432aa11bacb1c07e9d1d40b3e3c 100644 (file)
@@ -12,5 +12,6 @@
 use std::panic::catch_unwind;
 fn main() {
     let mut x = Cell::new(22);
-    catch_unwind(|| { x.set(23); }); //~ ERROR the trait bound
+    catch_unwind(|| { x.set(23); });
+    //~^ ERROR the type `std::cell::UnsafeCell<i32>` may contain interior mutability and a
 }
index 4c489c5964ba7b0b4fae3c8e03908f0f0cf7d2a9..f2aecc55ccb41ad3daf01e42fcbc3c998408b72d 100644 (file)
@@ -1,8 +1,8 @@
-error[E0277]: the trait bound `std::cell::UnsafeCell<i32>: std::panic::RefUnwindSafe` is not satisfied in `std::cell::Cell<i32>`
+error[E0277]: the type `std::cell::UnsafeCell<i32>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
   --> $DIR/interior-mutability.rs:15:5
    |
-LL |     catch_unwind(|| { x.set(23); }); //~ ERROR the trait bound
-   |     ^^^^^^^^^^^^ the type std::cell::UnsafeCell<i32> may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
+LL |     catch_unwind(|| { x.set(23); });
+   |     ^^^^^^^^^^^^ `std::cell::UnsafeCell<i32>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
    |
    = help: within `std::cell::Cell<i32>`, the trait `std::panic::RefUnwindSafe` is not implemented for `std::cell::UnsafeCell<i32>`
    = note: required because it appears within the type `std::cell::Cell<i32>`
index 3f2cb59b11dee4f189eb36f543fe151c9fec17b2..86785f24f3637fbc9a9a059ece035cdd9c5dff5d 100644 (file)
@@ -13,6 +13,6 @@ fn main() {
     2 as usize - Some(1); //~ ERROR cannot subtract `std::option::Option<{integer}>` from `usize`
     3 * (); //~ ERROR cannot multiply `()` to `{integer}`
     4 / ""; //~ ERROR cannot divide `{integer}` by `&str`
-    5 < String::new(); //~ ERROR is not satisfied
-    6 == Ok(1); //~ ERROR is not satisfied
+    5 < String::new(); //~ ERROR can't compare `{integer}` with `std::string::String`
+    6 == Ok(1); //~ ERROR can't compare `{integer}` with `std::result::Result<{integer}, _>`
 }
index 9d23b256fd333bee352c51ff796d2c21630ae910..4c6d95efadb1557fa071bb0c560f8e00f6bcb4cd 100644 (file)
@@ -30,19 +30,19 @@ LL |     4 / ""; //~ ERROR cannot divide `{integer}` by `&str`
    |
    = help: the trait `std::ops::Div<&str>` is not implemented for `{integer}`
 
-error[E0277]: the trait bound `{integer}: std::cmp::PartialOrd<std::string::String>` is not satisfied
+error[E0277]: can't compare `{integer}` with `std::string::String`
   --> $DIR/binops.rs:16:7
    |
-LL |     5 < String::new(); //~ ERROR is not satisfied
-   |       ^ can't compare `{integer}` with `std::string::String`
+LL |     5 < String::new(); //~ ERROR can't compare `{integer}` with `std::string::String`
+   |       ^ no implementation for `{integer} < std::string::String` and `{integer} > std::string::String`
    |
    = help: the trait `std::cmp::PartialOrd<std::string::String>` is not implemented for `{integer}`
 
-error[E0277]: the trait bound `{integer}: std::cmp::PartialEq<std::result::Result<{integer}, _>>` is not satisfied
+error[E0277]: can't compare `{integer}` with `std::result::Result<{integer}, _>`
   --> $DIR/binops.rs:17:7
    |
-LL |     6 == Ok(1); //~ ERROR is not satisfied
-   |       ^^ can't compare `{integer}` with `std::result::Result<{integer}, _>`
+LL |     6 == Ok(1); //~ ERROR can't compare `{integer}` with `std::result::Result<{integer}, _>`
+   |       ^^ no implementation for `{integer} == std::result::Result<{integer}, _>`
    |
    = help: the trait `std::cmp::PartialEq<std::result::Result<{integer}, _>>` is not implemented for `{integer}`
 
index 15388b3a7647f9625e894f76069a61ce6ca8deb0..d76c4a015a2c2f5236ee0b5598f54d28d4110dba 100644 (file)
@@ -60,7 +60,7 @@ fn main()
 
     let _ = 42usize as *const [u8]; //~ ERROR is invalid
     let _ = v as *const [u8]; //~ ERROR cannot cast
-    let _ = fat_v as *const Foo; //~ ERROR is not satisfied
+    let _ = fat_v as *const Foo; //~ ERROR the size for value values of type
     let _ = foo as *const str; //~ ERROR is invalid
     let _ = foo as *mut str; //~ ERROR is invalid
     let _ = main as *mut str; //~ ERROR is invalid
@@ -69,7 +69,7 @@ fn main()
     let _ = fat_sv as usize; //~ ERROR is invalid
 
     let a : *const str = "hello";
-    let _ = a as *const Foo; //~ ERROR is not satisfied
+    let _ = a as *const Foo; //~ ERROR the size for value values of type
 
     // check no error cascade
     let _ = main.f as *const u32; //~ ERROR no field
index 7931e7ff07f4ce55d4e5d573d3f49daa077f8278..feaf492837f7f83b795717934763cd8890f760e8 100644 (file)
@@ -216,22 +216,24 @@ LL |     let _ = cf as *const Bar; //~ ERROR is invalid
    |
    = note: vtable kinds may not match
 
-error[E0277]: the trait bound `[u8]: std::marker::Sized` is not satisfied
+error[E0277]: the size for value values of type `[u8]` cannot be known at compilation time
   --> $DIR/cast-rfc0401.rs:63:13
    |
-LL |     let _ = fat_v as *const Foo; //~ ERROR is not satisfied
-   |             ^^^^^ `[u8]` does not have a constant size known at compile-time
+LL |     let _ = fat_v as *const Foo; //~ ERROR the size for value values of type
+   |             ^^^^^ doesn't have a size known at compile-time
    |
    = help: the trait `std::marker::Sized` is not implemented for `[u8]`
+   = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
    = note: required for the cast to the object type `Foo`
 
-error[E0277]: the trait bound `str: std::marker::Sized` is not satisfied
+error[E0277]: the size for value values of type `str` cannot be known at compilation time
   --> $DIR/cast-rfc0401.rs:72:13
    |
-LL |     let _ = a as *const Foo; //~ ERROR is not satisfied
-   |             ^ `str` does not have a constant size known at compile-time
+LL |     let _ = a as *const Foo; //~ ERROR the size for value values of type
+   |             ^ doesn't have a size known at compile-time
    |
    = help: the trait `std::marker::Sized` is not implemented for `str`
+   = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
    = note: required for the cast to the object type `Foo`
 
 error[E0606]: casting `&{float}` as `f32` is invalid
diff --git a/src/test/ui/parser/expected-comma-found-token.rs b/src/test/ui/parser/expected-comma-found-token.rs
new file mode 100644 (file)
index 0000000..3c53c3a
--- /dev/null
@@ -0,0 +1,22 @@
+// 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.
+
+// Tests that two closures cannot simultaneously have mutable
+// access to the variable, whether that mutable access be used
+// for direct assignment or for taking mutable ref. Issue #6801.
+
+#![feature(on_unimplemented)]
+
+#[rustc_on_unimplemented(
+    message="the message"
+    label="the label"
+)]
+trait T {}
+//~^^^ ERROR expected one of `)` or `,`, found `label`
diff --git a/src/test/ui/parser/expected-comma-found-token.stderr b/src/test/ui/parser/expected-comma-found-token.stderr
new file mode 100644 (file)
index 0000000..9a564bb
--- /dev/null
@@ -0,0 +1,10 @@
+error: expected one of `)` or `,`, found `label`
+  --> $DIR/expected-comma-found-token.rs:19:5
+   |
+LL |     message="the message"
+   |                          - expected one of `)` or `,` here
+LL |     label="the label"
+   |     ^^^^^ unexpected token
+
+error: aborting due to previous error
+
index c813b64d40b58ddde391f8f185b286898dba871d..43f13d45684e8c7ee46cdf5d1ce08fc74422e91d 100644 (file)
@@ -1,8 +1,8 @@
-error[E0277]: the trait bound `&T: std::cmp::PartialEq<T>` is not satisfied
+error[E0277]: can't compare `&T` with `T`
   --> $DIR/partialeq_help.rs:12:7
    |
 LL |     a == b; //~ ERROR E0277
-   |       ^^ can't compare `&T` with `T`
+   |       ^^ no implementation for `&T == T`
    |
    = help: the trait `std::cmp::PartialEq<T>` is not implemented for `&T`
    = help: consider adding a `where &T: std::cmp::PartialEq<T>` bound
index 7005088965df13f78e0b53e8922e873fdfeea3b6..de755dd6a4602e2a6ec4a0da0f86091bdd1c6614 100644 (file)
@@ -1,4 +1,4 @@
-error: incorrect visibility restriction
+error[E0704]: incorrect visibility restriction
   --> $DIR/pub-restricted.rs:15:6
    |
 LL | pub (a) fn afn() {} //~ incorrect visibility restriction
@@ -9,7 +9,7 @@ LL | pub (a) fn afn() {} //~ incorrect visibility restriction
            `pub(super)`: visible only in the current module's parent
            `pub(in path::to::module)`: visible only on the specified path
 
-error: incorrect visibility restriction
+error[E0704]: incorrect visibility restriction
   --> $DIR/pub-restricted.rs:16:6
    |
 LL | pub (b) fn bfn() {} //~ incorrect visibility restriction
@@ -20,7 +20,7 @@ LL | pub (b) fn bfn() {} //~ incorrect visibility restriction
            `pub(super)`: visible only in the current module's parent
            `pub(in path::to::module)`: visible only on the specified path
 
-error: incorrect visibility restriction
+error[E0704]: incorrect visibility restriction
   --> $DIR/pub-restricted.rs:32:14
    |
 LL |         pub (a) invalid: usize, //~ incorrect visibility restriction
@@ -31,7 +31,7 @@ LL |         pub (a) invalid: usize, //~ incorrect visibility restriction
            `pub(super)`: visible only in the current module's parent
            `pub(in path::to::module)`: visible only on the specified path
 
-error: incorrect visibility restriction
+error[E0704]: incorrect visibility restriction
   --> $DIR/pub-restricted.rs:41:6
    |
 LL | pub (xyz) fn xyz() {} //~ incorrect visibility restriction
@@ -50,3 +50,4 @@ LL |         pub (in x) non_parent_invalid: usize, //~ ERROR visibilities can on
 
 error: aborting due to 5 previous errors
 
+For more information about this error, try `rustc --explain E0704`.
index 83ff95cc2ea48f59c0086e69e970eb4a3aa1752f..ca854f9f70122c2b4750bac48c658447f6fa7a13 100644 (file)
@@ -11,6 +11,7 @@
 trait I {}
 type K = I+'static;
 
-fn foo(_x: K) {} //~ ERROR: `I + 'static: std::marker::Sized` is not satisfied
+fn foo(_x: K) {}
+//~^ ERROR the size for value values of type
 
 fn main() {}
index 92309274e844279f3b18846115cf1816f20a5c23..efcd0b3624811c76d4db90ee6c2329df367588ef 100644 (file)
@@ -1,10 +1,11 @@
-error[E0277]: the trait bound `I + 'static: std::marker::Sized` is not satisfied
+error[E0277]: the size for value values of type `I + 'static` cannot be known at compilation time
   --> $DIR/issue-5035-2.rs:14:8
    |
-LL | fn foo(_x: K) {} //~ ERROR: `I + 'static: std::marker::Sized` is not satisfied
-   |        ^^ `I + 'static` does not have a constant size known at compile-time
+LL | fn foo(_x: K) {}
+   |        ^^ doesn't have a size known at compile-time
    |
    = help: the trait `std::marker::Sized` is not implemented for `I + 'static`
+   = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
    = note: all local variables must have a statically known size
 
 error: aborting due to previous error
index b70028bd926c6ea78c2fe27eb4f55c2cddd98c4f..8fbab4022327171feb87ce682c25b0f7d3154273 100644 (file)
@@ -15,7 +15,7 @@ fn main() {
   let u: &str = if true { s[..2] } else { s };
   //~^ ERROR mismatched types
   let v = s[..2];
-  //~^ ERROR the trait bound `str: std::marker::Sized` is not satisfied
+  //~^ ERROR the size for value values of type
   let w: &str = s[..2];
   //~^ ERROR mismatched types
 }
index 76db882742a01a331e9a0cfe01ab3294ff44d344..12699d8b25f81750393da26779a59a5d70d020e1 100644 (file)
@@ -19,15 +19,16 @@ LL |   let u: &str = if true { s[..2] } else { s };
    = note: expected type `&str`
               found type `str`
 
-error[E0277]: the trait bound `str: std::marker::Sized` is not satisfied
+error[E0277]: the size for value values of type `str` cannot be known at compilation time
   --> $DIR/str-array-assignment.rs:17:7
    |
 LL |   let v = s[..2];
    |       ^   ------ help: consider borrowing here: `&s[..2]`
    |       |
-   |       `str` does not have a constant size known at compile-time
+   |       doesn't have a size known at compile-time
    |
    = help: the trait `std::marker::Sized` is not implemented for `str`
+   = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
    = note: all local variables must have a statically known size
 
 error[E0308]: mismatched types
index 5dcb4c8a220baf865e59ff4d6f70585d43d94e18..dd74f4f4797272400bc36dd0bd7f6dd9ccee42d0 100644 (file)
 fn check<T: Iterator, U: ?Sized>() {
     // suggest a where-clause, if needed
     mem::size_of::<U>();
-    //~^ ERROR `U: std::marker::Sized` is not satisfied
+    //~^ ERROR the size for value values of type
 
     mem::size_of::<Misc<U>>();
-    //~^ ERROR `U: std::marker::Sized` is not satisfied
+    //~^ ERROR the size for value values of type
 
     // ... even if T occurs as a type parameter
 
@@ -36,10 +36,10 @@ fn check<T: Iterator, U: ?Sized>() {
     // ... and also not if the error is not related to the type
 
     mem::size_of::<[T]>();
-    //~^ ERROR `[T]: std::marker::Sized` is not satisfied
+    //~^ ERROR the size for value values of type
 
     mem::size_of::<[&U]>();
-    //~^ ERROR `[&U]: std::marker::Sized` is not satisfied
+    //~^ ERROR the size for value values of type
 }
 
 fn main() {
index abd9f5a8b73f77a758d3539f481355bccaf1c83f..feb31ae22d8ca9b01fc81c982287d6b0c01ed4a9 100644 (file)
@@ -1,20 +1,22 @@
-error[E0277]: the trait bound `U: std::marker::Sized` is not satisfied
+error[E0277]: the size for value values of type `U` cannot be known at compilation time
   --> $DIR/trait-suggest-where-clause.rs:17:5
    |
 LL |     mem::size_of::<U>();
-   |     ^^^^^^^^^^^^^^^^^ `U` does not have a constant size known at compile-time
+   |     ^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
    |
    = help: the trait `std::marker::Sized` is not implemented for `U`
+   = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
    = help: consider adding a `where U: std::marker::Sized` bound
    = note: required by `std::mem::size_of`
 
-error[E0277]: the trait bound `U: std::marker::Sized` is not satisfied in `Misc<U>`
+error[E0277]: the size for value values of type `U` cannot be known at compilation time
   --> $DIR/trait-suggest-where-clause.rs:20:5
    |
 LL |     mem::size_of::<Misc<U>>();
-   |     ^^^^^^^^^^^^^^^^^^^^^^^ `U` does not have a constant size known at compile-time
+   |     ^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
    |
    = help: within `Misc<U>`, the trait `std::marker::Sized` is not implemented for `U`
+   = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
    = help: consider adding a `where U: std::marker::Sized` bound
    = note: required because it appears within the type `Misc<U>`
    = note: required by `std::mem::size_of`
@@ -45,22 +47,24 @@ LL |     <Misc<_> as From<T>>::from;
    |
    = note: required by `std::convert::From::from`
 
-error[E0277]: the trait bound `[T]: std::marker::Sized` is not satisfied
+error[E0277]: the size for value values of type `[T]` cannot be known at compilation time
   --> $DIR/trait-suggest-where-clause.rs:38:5
    |
 LL |     mem::size_of::<[T]>();
-   |     ^^^^^^^^^^^^^^^^^^^ `[T]` does not have a constant size known at compile-time
+   |     ^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
    |
    = help: the trait `std::marker::Sized` is not implemented for `[T]`
+   = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
    = note: required by `std::mem::size_of`
 
-error[E0277]: the trait bound `[&U]: std::marker::Sized` is not satisfied
+error[E0277]: the size for value values of type `[&U]` cannot be known at compilation time
   --> $DIR/trait-suggest-where-clause.rs:41:5
    |
 LL |     mem::size_of::<[&U]>();
-   |     ^^^^^^^^^^^^^^^^^^^^ `[&U]` does not have a constant size known at compile-time
+   |     ^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
    |
    = help: the trait `std::marker::Sized` is not implemented for `[&U]`
+   = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
    = note: required by `std::mem::size_of`
 
 error: aborting due to 7 previous errors
index df91ba0dd2ac5b2b6513be46ab98f5a5b9909f3d..d08574c3d878967d533fd7c36f6a4b5f8e1547fb 100644 (file)
@@ -1,10 +1,11 @@
-error[E0277]: the trait bound `str: std::marker::Sized` is not satisfied
+error[E0277]: the size for value values of type `str` cannot be known at compilation time
   --> $DIR/trivial-bounds-leak.rs:22:25
    |
 LL | fn cant_return_str() -> str { //~ ERROR
-   |                         ^^^ `str` does not have a constant size known at compile-time
+   |                         ^^^ doesn't have a size known at compile-time
    |
    = help: the trait `std::marker::Sized` is not implemented for `str`
+   = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
    = note: the return type of a function must have a statically known size
 
 error[E0599]: no method named `test` found for type `i32` in the current scope
index f916df5d32d0462826035a9e87aca7351c6ee88e..92a45db0689680e81b63a003e3200ae583f79eb5 100644 (file)
 
 struct Foo<T, U: FromIterator<T>>(T, U);
 struct WellFormed<Z = Foo<i32, i32>>(Z);
-//~^ error: the trait bound `i32: std::iter::FromIterator<i32>` is not satisfied [E0277]
+//~^ ERROR a collection of type `i32` cannot be built from an iterator over elements of type `i32`
 struct WellFormedNoBounds<Z:?Sized = Foo<i32, i32>>(Z);
-//~^ error: the trait bound `i32: std::iter::FromIterator<i32>` is not satisfied [E0277]
+//~^ ERROR a collection of type `i32` cannot be built from an iterator over elements of type `i32`
 
 struct Bounds<T:Copy=String>(T);
-//~^ error: the trait bound `std::string::String: std::marker::Copy` is not satisfied [E0277]
+//~^ ERROR the trait bound `std::string::String: std::marker::Copy` is not satisfied [E0277]
 
 struct WhereClause<T=String>(T) where T: Copy;
-//~^ error: the trait bound `std::string::String: std::marker::Copy` is not satisfied [E0277]
+//~^ ERROR the trait bound `std::string::String: std::marker::Copy` is not satisfied [E0277]
 
 trait TraitBound<T:Copy=String> {}
-//~^ error: the trait bound `std::string::String: std::marker::Copy` is not satisfied [E0277]
+//~^ ERROR the trait bound `std::string::String: std::marker::Copy` is not satisfied [E0277]
 
 trait Super<T: Copy> { }
 trait Base<T = String>: Super<T> { }
-//~^ error: the trait bound `T: std::marker::Copy` is not satisfied [E0277]
+//~^ ERROR the trait bound `T: std::marker::Copy` is not satisfied [E0277]
 
 trait ProjectionPred<T:Iterator = IntoIter<i32>> where T::Item : Add<u8> {}
-//~^ error:  cannot add `u8` to `i32` [E0277]
+//~^ ERROR cannot add `u8` to `i32` [E0277]
 
 fn main() { }
index a2d6e53df050236ac5be1dd64bb75f0486bef485..aa124110243a52cc6cdb67cedb742d45237a8843 100644 (file)
@@ -1,8 +1,8 @@
-error[E0277]: the trait bound `i32: std::iter::FromIterator<i32>` is not satisfied
+error[E0277]: a collection of type `i32` cannot be built from an iterator over elements of type `i32`
   --> $DIR/type-check-defaults.rs:16:19
    |
 LL | struct WellFormed<Z = Foo<i32, i32>>(Z);
-   |                   ^ a collection of type `i32` cannot be built from an iterator over elements of type `i32`
+   |                   ^ a collection of type `i32` cannot be built from `std::iter::Iterator<Item=i32>`
    |
    = help: the trait `std::iter::FromIterator<i32>` is not implemented for `i32`
 note: required by `Foo`
@@ -11,11 +11,11 @@ note: required by `Foo`
 LL | struct Foo<T, U: FromIterator<T>>(T, U);
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-error[E0277]: the trait bound `i32: std::iter::FromIterator<i32>` is not satisfied
+error[E0277]: a collection of type `i32` cannot be built from an iterator over elements of type `i32`
   --> $DIR/type-check-defaults.rs:18:27
    |
 LL | struct WellFormedNoBounds<Z:?Sized = Foo<i32, i32>>(Z);
-   |                           ^ a collection of type `i32` cannot be built from an iterator over elements of type `i32`
+   |                           ^ a collection of type `i32` cannot be built from `std::iter::Iterator<Item=i32>`
    |
    = help: the trait `std::iter::FromIterator<i32>` is not implemented for `i32`
 note: required by `Foo`
index 8999f1e0930bed3898474fda10a779ebf4704321..15822ae42998c5769acd0670067bdaba22396ed1 100644 (file)
 #![feature(untagged_unions)]
 
 union Foo<T: ?Sized> {
-    value: T, //~ ERROR the trait bound `T: std::marker::Sized` is not satisfied
+    value: T,
+    //~^ ERROR the size for value values of type
 }
 
 struct Foo2<T: ?Sized> {
-    value: T, //~ ERROR the trait bound `T: std::marker::Sized` is not satisfied
+    value: T,
+    //~^ ERROR the size for value values of type
     t: u32,
 }
 
 enum Foo3<T: ?Sized> {
-    Value(T), //~ ERROR the trait bound `T: std::marker::Sized` is not satisfied
+    Value(T),
+    //~^ ERROR the size for value values of type
 }
 
 fn main() {}
index ba80af6c7e037b7739310d06d14d04b020092b8d..c6b7cf4e078233c5bc6cdb86696ddc5856d01e97 100644 (file)
@@ -1,30 +1,33 @@
-error[E0277]: the trait bound `T: std::marker::Sized` is not satisfied
+error[E0277]: the size for value values of type `T` cannot be known at compilation time
   --> $DIR/union-sized-field.rs:14:5
    |
-LL |     value: T, //~ ERROR the trait bound `T: std::marker::Sized` is not satisfied
-   |     ^^^^^^^^ `T` does not have a constant size known at compile-time
+LL |     value: T,
+   |     ^^^^^^^^ doesn't have a size known at compile-time
    |
    = help: the trait `std::marker::Sized` is not implemented for `T`
+   = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
    = help: consider adding a `where T: std::marker::Sized` bound
    = note: no field of a union may have a dynamically sized type
 
-error[E0277]: the trait bound `T: std::marker::Sized` is not satisfied
-  --> $DIR/union-sized-field.rs:18:5
+error[E0277]: the size for value values of type `T` cannot be known at compilation time
+  --> $DIR/union-sized-field.rs:19:5
    |
-LL |     value: T, //~ ERROR the trait bound `T: std::marker::Sized` is not satisfied
-   |     ^^^^^^^^ `T` does not have a constant size known at compile-time
+LL |     value: T,
+   |     ^^^^^^^^ doesn't have a size known at compile-time
    |
    = help: the trait `std::marker::Sized` is not implemented for `T`
+   = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
    = help: consider adding a `where T: std::marker::Sized` bound
    = note: only the last field of a struct may have a dynamically sized type
 
-error[E0277]: the trait bound `T: std::marker::Sized` is not satisfied
-  --> $DIR/union-sized-field.rs:23:11
+error[E0277]: the size for value values of type `T` cannot be known at compilation time
+  --> $DIR/union-sized-field.rs:25:11
    |
-LL |     Value(T), //~ ERROR the trait bound `T: std::marker::Sized` is not satisfied
-   |           ^ `T` does not have a constant size known at compile-time
+LL |     Value(T),
+   |           ^ doesn't have a size known at compile-time
    |
    = help: the trait `std::marker::Sized` is not implemented for `T`
+   = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
    = help: consider adding a `where T: std::marker::Sized` bound
    = note: no field of an enum variant may have a dynamically sized type
 
index 95fc3243fbed34629eb516bc9f6799b4c32cef1b..9082ea4abddbdd669ad4a3c86539e84c83ee33fd 100644 (file)
@@ -30,37 +30,54 @@ trait PathHelper4 {}
 
 enum E<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?Sized> {
     // parameter
-    VA(W), //~ ERROR `W: std::marker::Sized` is not satisfied
-    VB{x: X}, //~ ERROR `X: std::marker::Sized` is not satisfied
-    VC(isize, Y), //~ ERROR `Y: std::marker::Sized` is not satisfied
-    VD{u: isize, x: Z}, //~ ERROR `Z: std::marker::Sized` is not satisfied
+    VA(W),
+    //~^ ERROR the size for value values of type
+    VB{x: X},
+    //~^ ERROR the size for value values of type
+    VC(isize, Y),
+    //~^ ERROR the size for value values of type
+    VD{u: isize, x: Z},
+    //~^ ERROR the size for value values of type
 
     // slice / str
-    VE([u8]), //~ ERROR `[u8]: std::marker::Sized` is not satisfied
-    VF{x: str}, //~ ERROR `str: std::marker::Sized` is not satisfied
-    VG(isize, [f32]), //~ ERROR `[f32]: std::marker::Sized` is not satisfied
-    VH{u: isize, x: [u32]}, //~ ERROR `[u32]: std::marker::Sized` is not satisfied
+    VE([u8]),
+    //~^ ERROR the size for value values of type
+    VF{x: str},
+    //~^ ERROR the size for value values of type
+    VG(isize, [f32]),
+    //~^ ERROR the size for value values of type
+    VH{u: isize, x: [u32]},
+    //~^ ERROR the size for value values of type
 
     // unsized struct
-    VI(Path1), //~ ERROR `PathHelper1 + 'static: std::marker::Sized` is not satisfied
-    VJ{x: Path2}, //~ ERROR `PathHelper2 + 'static: std::marker::Sized` is not satisfied
-    VK(isize, Path3), //~ ERROR `PathHelper3 + 'static: std::marker::Sized` is not satisfied
-    VL{u: isize, x: Path4}, //~ ERROR `PathHelper4 + 'static: std::marker::Sized` is not satisfied
+    VI(Path1),
+    //~^ ERROR the size for value values of type
+    VJ{x: Path2},
+    //~^ ERROR the size for value values of type
+    VK(isize, Path3),
+    //~^ ERROR the size for value values of type
+    VL{u: isize, x: Path4},
+    //~^ ERROR the size for value values of type
 
     // plain trait
-    VM(Foo),  //~ ERROR `Foo + 'static: std::marker::Sized` is not satisfied
-    VN{x: Bar}, //~ ERROR `Bar + 'static: std::marker::Sized` is not satisfied
-    VO(isize, FooBar), //~ ERROR `FooBar + 'static: std::marker::Sized` is not satisfied
-    VP{u: isize, x: BarFoo}, //~ ERROR `BarFoo + 'static: std::marker::Sized` is not satisfied
+    VM(Foo),
+    //~^ ERROR the size for value values of type
+    VN{x: Bar},
+    //~^ ERROR the size for value values of type
+    VO(isize, FooBar),
+    //~^ ERROR the size for value values of type
+    VP{u: isize, x: BarFoo},
+    //~^ ERROR the size for value values of type
 
     // projected
-    VQ(<&'static [i8] as Deref>::Target), //~ ERROR `[i8]: std::marker::Sized` is not satisfied
+    VQ(<&'static [i8] as Deref>::Target),
+    //~^ ERROR the size for value values of type
     VR{x: <&'static [char] as Deref>::Target},
-    //~^ ERROR `[char]: std::marker::Sized` is not satisfied
+    //~^ ERROR the size for value values of type
     VS(isize, <&'static [f64] as Deref>::Target),
-    //~^ ERROR `[f64]: std::marker::Sized` is not satisfied
+    //~^ ERROR the size for value values of type
     VT{u: isize, x: <&'static [i32] as Deref>::Target},
-    //~^ ERROR `[i32]: std::marker::Sized` is not satisfied
+    //~^ ERROR the size for value values of type
 }
 
 
index 0e18efbf9da3eda5b87c4e8d72e1e123bca283e8..ff2aa1d1ef91778321049ab8101d545a0732b494 100644 (file)
-error[E0277]: the trait bound `W: std::marker::Sized` is not satisfied
+error[E0277]: the size for value values of type `W` cannot be known at compilation time
   --> $DIR/unsized-enum2.rs:33:8
    |
-LL |     VA(W), //~ ERROR `W: std::marker::Sized` is not satisfied
-   |        ^ `W` does not have a constant size known at compile-time
+LL |     VA(W),
+   |        ^ doesn't have a size known at compile-time
    |
    = help: the trait `std::marker::Sized` is not implemented for `W`
+   = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
    = help: consider adding a `where W: std::marker::Sized` bound
    = note: no field of an enum variant may have a dynamically sized type
 
-error[E0277]: the trait bound `X: std::marker::Sized` is not satisfied
-  --> $DIR/unsized-enum2.rs:34:8
+error[E0277]: the size for value values of type `X` cannot be known at compilation time
+  --> $DIR/unsized-enum2.rs:35:8
    |
-LL |     VB{x: X}, //~ ERROR `X: std::marker::Sized` is not satisfied
-   |        ^^^^ `X` does not have a constant size known at compile-time
+LL |     VB{x: X},
+   |        ^^^^ doesn't have a size known at compile-time
    |
    = help: the trait `std::marker::Sized` is not implemented for `X`
+   = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
    = help: consider adding a `where X: std::marker::Sized` bound
    = note: no field of an enum variant may have a dynamically sized type
 
-error[E0277]: the trait bound `Y: std::marker::Sized` is not satisfied
-  --> $DIR/unsized-enum2.rs:35:15
+error[E0277]: the size for value values of type `Y` cannot be known at compilation time
+  --> $DIR/unsized-enum2.rs:37:15
    |
-LL |     VC(isize, Y), //~ ERROR `Y: std::marker::Sized` is not satisfied
-   |               ^ `Y` does not have a constant size known at compile-time
+LL |     VC(isize, Y),
+   |               ^ doesn't have a size known at compile-time
    |
    = help: the trait `std::marker::Sized` is not implemented for `Y`
+   = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
    = help: consider adding a `where Y: std::marker::Sized` bound
    = note: no field of an enum variant may have a dynamically sized type
 
-error[E0277]: the trait bound `Z: std::marker::Sized` is not satisfied
-  --> $DIR/unsized-enum2.rs:36:18
+error[E0277]: the size for value values of type `Z` cannot be known at compilation time
+  --> $DIR/unsized-enum2.rs:39:18
    |
-LL |     VD{u: isize, x: Z}, //~ ERROR `Z: std::marker::Sized` is not satisfied
-   |                  ^^^^ `Z` does not have a constant size known at compile-time
+LL |     VD{u: isize, x: Z},
+   |                  ^^^^ doesn't have a size known at compile-time
    |
    = help: the trait `std::marker::Sized` is not implemented for `Z`
+   = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
    = help: consider adding a `where Z: std::marker::Sized` bound
    = note: no field of an enum variant may have a dynamically sized type
 
-error[E0277]: the trait bound `[u8]: std::marker::Sized` is not satisfied
-  --> $DIR/unsized-enum2.rs:39:8
+error[E0277]: the size for value values of type `[u8]` cannot be known at compilation time
+  --> $DIR/unsized-enum2.rs:43:8
    |
-LL |     VE([u8]), //~ ERROR `[u8]: std::marker::Sized` is not satisfied
-   |        ^^^^ `[u8]` does not have a constant size known at compile-time
+LL |     VE([u8]),
+   |        ^^^^ doesn't have a size known at compile-time
    |
    = help: the trait `std::marker::Sized` is not implemented for `[u8]`
+   = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
    = note: no field of an enum variant may have a dynamically sized type
 
-error[E0277]: the trait bound `str: std::marker::Sized` is not satisfied
-  --> $DIR/unsized-enum2.rs:40:8
+error[E0277]: the size for value values of type `str` cannot be known at compilation time
+  --> $DIR/unsized-enum2.rs:45:8
    |
-LL |     VF{x: str}, //~ ERROR `str: std::marker::Sized` is not satisfied
-   |        ^^^^^^ `str` does not have a constant size known at compile-time
+LL |     VF{x: str},
+   |        ^^^^^^ doesn't have a size known at compile-time
    |
    = help: the trait `std::marker::Sized` is not implemented for `str`
+   = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
    = note: no field of an enum variant may have a dynamically sized type
 
-error[E0277]: the trait bound `[f32]: std::marker::Sized` is not satisfied
-  --> $DIR/unsized-enum2.rs:41:15
+error[E0277]: the size for value values of type `[f32]` cannot be known at compilation time
+  --> $DIR/unsized-enum2.rs:47:15
    |
-LL |     VG(isize, [f32]), //~ ERROR `[f32]: std::marker::Sized` is not satisfied
-   |               ^^^^^ `[f32]` does not have a constant size known at compile-time
+LL |     VG(isize, [f32]),
+   |               ^^^^^ doesn't have a size known at compile-time
    |
    = help: the trait `std::marker::Sized` is not implemented for `[f32]`
+   = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
    = note: no field of an enum variant may have a dynamically sized type
 
-error[E0277]: the trait bound `[u32]: std::marker::Sized` is not satisfied
-  --> $DIR/unsized-enum2.rs:42:18
+error[E0277]: the size for value values of type `[u32]` cannot be known at compilation time
+  --> $DIR/unsized-enum2.rs:49:18
    |
-LL |     VH{u: isize, x: [u32]}, //~ ERROR `[u32]: std::marker::Sized` is not satisfied
-   |                  ^^^^^^^^ `[u32]` does not have a constant size known at compile-time
+LL |     VH{u: isize, x: [u32]},
+   |                  ^^^^^^^^ doesn't have a size known at compile-time
    |
    = help: the trait `std::marker::Sized` is not implemented for `[u32]`
+   = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
    = note: no field of an enum variant may have a dynamically sized type
 
-error[E0277]: the trait bound `Foo + 'static: std::marker::Sized` is not satisfied
-  --> $DIR/unsized-enum2.rs:51:8
+error[E0277]: the size for value values of type `Foo + 'static` cannot be known at compilation time
+  --> $DIR/unsized-enum2.rs:63:8
    |
-LL |     VM(Foo),  //~ ERROR `Foo + 'static: std::marker::Sized` is not satisfied
-   |        ^^^ `Foo + 'static` does not have a constant size known at compile-time
+LL |     VM(Foo),
+   |        ^^^ doesn't have a size known at compile-time
    |
    = help: the trait `std::marker::Sized` is not implemented for `Foo + 'static`
+   = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
    = note: no field of an enum variant may have a dynamically sized type
 
-error[E0277]: the trait bound `Bar + 'static: std::marker::Sized` is not satisfied
-  --> $DIR/unsized-enum2.rs:52:8
+error[E0277]: the size for value values of type `Bar + 'static` cannot be known at compilation time
+  --> $DIR/unsized-enum2.rs:65:8
    |
-LL |     VN{x: Bar}, //~ ERROR `Bar + 'static: std::marker::Sized` is not satisfied
-   |        ^^^^^^ `Bar + 'static` does not have a constant size known at compile-time
+LL |     VN{x: Bar},
+   |        ^^^^^^ doesn't have a size known at compile-time
    |
    = help: the trait `std::marker::Sized` is not implemented for `Bar + 'static`
+   = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
    = note: no field of an enum variant may have a dynamically sized type
 
-error[E0277]: the trait bound `FooBar + 'static: std::marker::Sized` is not satisfied
-  --> $DIR/unsized-enum2.rs:53:15
+error[E0277]: the size for value values of type `FooBar + 'static` cannot be known at compilation time
+  --> $DIR/unsized-enum2.rs:67:15
    |
-LL |     VO(isize, FooBar), //~ ERROR `FooBar + 'static: std::marker::Sized` is not satisfied
-   |               ^^^^^^ `FooBar + 'static` does not have a constant size known at compile-time
+LL |     VO(isize, FooBar),
+   |               ^^^^^^ doesn't have a size known at compile-time
    |
    = help: the trait `std::marker::Sized` is not implemented for `FooBar + 'static`
+   = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
    = note: no field of an enum variant may have a dynamically sized type
 
-error[E0277]: the trait bound `BarFoo + 'static: std::marker::Sized` is not satisfied
-  --> $DIR/unsized-enum2.rs:54:18
+error[E0277]: the size for value values of type `BarFoo + 'static` cannot be known at compilation time
+  --> $DIR/unsized-enum2.rs:69:18
    |
-LL |     VP{u: isize, x: BarFoo}, //~ ERROR `BarFoo + 'static: std::marker::Sized` is not satisfied
-   |                  ^^^^^^^^^ `BarFoo + 'static` does not have a constant size known at compile-time
+LL |     VP{u: isize, x: BarFoo},
+   |                  ^^^^^^^^^ doesn't have a size known at compile-time
    |
    = help: the trait `std::marker::Sized` is not implemented for `BarFoo + 'static`
+   = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
    = note: no field of an enum variant may have a dynamically sized type
 
-error[E0277]: the trait bound `[i8]: std::marker::Sized` is not satisfied
-  --> $DIR/unsized-enum2.rs:57:8
+error[E0277]: the size for value values of type `[i8]` cannot be known at compilation time
+  --> $DIR/unsized-enum2.rs:73:8
    |
-LL |     VQ(<&'static [i8] as Deref>::Target), //~ ERROR `[i8]: std::marker::Sized` is not satisfied
-   |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `[i8]` does not have a constant size known at compile-time
+LL |     VQ(<&'static [i8] as Deref>::Target),
+   |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
    |
    = help: the trait `std::marker::Sized` is not implemented for `[i8]`
+   = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
    = note: no field of an enum variant may have a dynamically sized type
 
-error[E0277]: the trait bound `[char]: std::marker::Sized` is not satisfied
-  --> $DIR/unsized-enum2.rs:58:8
+error[E0277]: the size for value values of type `[char]` cannot be known at compilation time
+  --> $DIR/unsized-enum2.rs:75:8
    |
 LL |     VR{x: <&'static [char] as Deref>::Target},
-   |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `[char]` does not have a constant size known at compile-time
+   |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
    |
    = help: the trait `std::marker::Sized` is not implemented for `[char]`
+   = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
    = note: no field of an enum variant may have a dynamically sized type
 
-error[E0277]: the trait bound `[f64]: std::marker::Sized` is not satisfied
-  --> $DIR/unsized-enum2.rs:60:15
+error[E0277]: the size for value values of type `[f64]` cannot be known at compilation time
+  --> $DIR/unsized-enum2.rs:77:15
    |
 LL |     VS(isize, <&'static [f64] as Deref>::Target),
-   |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `[f64]` does not have a constant size known at compile-time
+   |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
    |
    = help: the trait `std::marker::Sized` is not implemented for `[f64]`
+   = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
    = note: no field of an enum variant may have a dynamically sized type
 
-error[E0277]: the trait bound `[i32]: std::marker::Sized` is not satisfied
-  --> $DIR/unsized-enum2.rs:62:18
+error[E0277]: the size for value values of type `[i32]` cannot be known at compilation time
+  --> $DIR/unsized-enum2.rs:79:18
    |
 LL |     VT{u: isize, x: <&'static [i32] as Deref>::Target},
-   |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `[i32]` does not have a constant size known at compile-time
+   |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
    |
    = help: the trait `std::marker::Sized` is not implemented for `[i32]`
+   = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
    = note: no field of an enum variant may have a dynamically sized type
 
-error[E0277]: the trait bound `PathHelper1 + 'static: std::marker::Sized` is not satisfied in `Path1`
-  --> $DIR/unsized-enum2.rs:45:8
+error[E0277]: the size for value values of type `PathHelper1 + 'static` cannot be known at compilation time
+  --> $DIR/unsized-enum2.rs:53:8
    |
-LL |     VI(Path1), //~ ERROR `PathHelper1 + 'static: std::marker::Sized` is not satisfied
-   |        ^^^^^ `PathHelper1 + 'static` does not have a constant size known at compile-time
+LL |     VI(Path1),
+   |        ^^^^^ doesn't have a size known at compile-time
    |
    = help: within `Path1`, the trait `std::marker::Sized` is not implemented for `PathHelper1 + 'static`
+   = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
    = note: required because it appears within the type `Path1`
    = note: no field of an enum variant may have a dynamically sized type
 
-error[E0277]: the trait bound `PathHelper2 + 'static: std::marker::Sized` is not satisfied in `Path2`
-  --> $DIR/unsized-enum2.rs:46:8
+error[E0277]: the size for value values of type `PathHelper2 + 'static` cannot be known at compilation time
+  --> $DIR/unsized-enum2.rs:55:8
    |
-LL |     VJ{x: Path2}, //~ ERROR `PathHelper2 + 'static: std::marker::Sized` is not satisfied
-   |        ^^^^^^^^ `PathHelper2 + 'static` does not have a constant size known at compile-time
+LL |     VJ{x: Path2},
+   |        ^^^^^^^^ doesn't have a size known at compile-time
    |
    = help: within `Path2`, the trait `std::marker::Sized` is not implemented for `PathHelper2 + 'static`
+   = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
    = note: required because it appears within the type `Path2`
    = note: no field of an enum variant may have a dynamically sized type
 
-error[E0277]: the trait bound `PathHelper3 + 'static: std::marker::Sized` is not satisfied in `Path3`
-  --> $DIR/unsized-enum2.rs:47:15
+error[E0277]: the size for value values of type `PathHelper3 + 'static` cannot be known at compilation time
+  --> $DIR/unsized-enum2.rs:57:15
    |
-LL |     VK(isize, Path3), //~ ERROR `PathHelper3 + 'static: std::marker::Sized` is not satisfied
-   |               ^^^^^ `PathHelper3 + 'static` does not have a constant size known at compile-time
+LL |     VK(isize, Path3),
+   |               ^^^^^ doesn't have a size known at compile-time
    |
    = help: within `Path3`, the trait `std::marker::Sized` is not implemented for `PathHelper3 + 'static`
+   = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
    = note: required because it appears within the type `Path3`
    = note: no field of an enum variant may have a dynamically sized type
 
-error[E0277]: the trait bound `PathHelper4 + 'static: std::marker::Sized` is not satisfied in `Path4`
-  --> $DIR/unsized-enum2.rs:48:18
+error[E0277]: the size for value values of type `PathHelper4 + 'static` cannot be known at compilation time
+  --> $DIR/unsized-enum2.rs:59:18
    |
-LL |     VL{u: isize, x: Path4}, //~ ERROR `PathHelper4 + 'static: std::marker::Sized` is not satisfied
-   |                  ^^^^^^^^ `PathHelper4 + 'static` does not have a constant size known at compile-time
+LL |     VL{u: isize, x: Path4},
+   |                  ^^^^^^^^ doesn't have a size known at compile-time
    |
    = help: within `Path4`, the trait `std::marker::Sized` is not implemented for `PathHelper4 + 'static`
+   = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
    = note: required because it appears within the type `Path4`
    = note: no field of an enum variant may have a dynamically sized type