]> git.lizzy.rs Git - rust.git/commitdiff
suggest adding a where-clause when that can help
authorAriel Ben-Yehuda <arielb1@mail.tau.ac.il>
Tue, 29 Mar 2016 17:12:31 +0000 (20:12 +0300)
committerAriel Ben-Yehuda <ariel.byd@gmail.com>
Tue, 5 Apr 2016 17:58:58 +0000 (20:58 +0300)
suggest adding a where-clause when there is an unmet trait-bound that
can be satisfied if some type can implement it.

159 files changed:
src/doc/book/closures.md
src/doc/book/concurrency.md
src/doc/book/traits.md
src/doc/book/vectors.md
src/doc/nomicon/coercions.md
src/librustc/diagnostics.rs
src/librustc/traits/error_reporting.rs
src/test/compile-fail/associated-types-ICE-when-projecting-out-of-err.rs
src/test/compile-fail/associated-types-bound-failure.rs
src/test/compile-fail/associated-types-for-unimpl-trait.rs
src/test/compile-fail/associated-types-invalid-trait-ref-issue-18865.rs
src/test/compile-fail/associated-types-no-suitable-bound.rs
src/test/compile-fail/associated-types-no-suitable-supertrait-2.rs
src/test/compile-fail/associated-types-no-suitable-supertrait.rs
src/test/compile-fail/associated-types-path-2.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/cast-rfc0401.rs
src/test/compile-fail/closure-bounds-cant-promote-superkind-in-struct.rs
src/test/compile-fail/closure-bounds-subtype.rs
src/test/compile-fail/cross-fn-cache-hole.rs
src/test/compile-fail/deriving-no-inner-impl-error-message.rs
src/test/compile-fail/deriving-span-Default-struct.rs
src/test/compile-fail/destructure-trait-ref.rs
src/test/compile-fail/dst-bad-assign-2.rs
src/test/compile-fail/dst-bad-assign.rs
src/test/compile-fail/dst-bad-coerce1.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/error-should-say-copy-not-pod.rs
src/test/compile-fail/extern-wrong-value-type.rs
src/test/compile-fail/fn-trait-formatting.rs
src/test/compile-fail/for-loop-bogosity.rs
src/test/compile-fail/hrtb-conflate-regions.rs
src/test/compile-fail/hrtb-higher-ranker-supertraits-transitive.rs
src/test/compile-fail/hrtb-higher-ranker-supertraits.rs
src/test/compile-fail/hrtb-just-for-static.rs
src/test/compile-fail/hrtb-perfect-forwarding.rs
src/test/compile-fail/ifmt-unimpl.rs
src/test/compile-fail/impl-bounds-checking.rs
src/test/compile-fail/indexing-requires-a-uint.rs
src/test/compile-fail/integral-indexing.rs
src/test/compile-fail/issue-14084.rs
src/test/compile-fail/issue-14366.rs
src/test/compile-fail/issue-15756.rs
src/test/compile-fail/issue-16538.rs
src/test/compile-fail/issue-17651.rs
src/test/compile-fail/issue-17718-static-sync.rs
src/test/compile-fail/issue-18107.rs
src/test/compile-fail/issue-18611.rs
src/test/compile-fail/issue-18919.rs
src/test/compile-fail/issue-1920-1.rs
src/test/compile-fail/issue-1920-2.rs
src/test/compile-fail/issue-1920-3.rs
src/test/compile-fail/issue-20005.rs
src/test/compile-fail/issue-20162.rs
src/test/compile-fail/issue-20605.rs
src/test/compile-fail/issue-21160.rs
src/test/compile-fail/issue-21659-show-relevant-trait-impls-1.rs
src/test/compile-fail/issue-21659-show-relevant-trait-impls-2.rs
src/test/compile-fail/issue-21763.rs
src/test/compile-fail/issue-22034.rs
src/test/compile-fail/issue-22645.rs
src/test/compile-fail/issue-25076.rs
src/test/compile-fail/issue-28098.rs
src/test/compile-fail/issue-5035-2.rs
src/test/compile-fail/issue-5883.rs
src/test/compile-fail/issue-7013.rs
src/test/compile-fail/issue-7364.rs
src/test/compile-fail/kindck-copy.rs
src/test/compile-fail/kindck-impl-type-params-2.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/map-types.rs
src/test/compile-fail/mut-not-freeze.rs
src/test/compile-fail/mutable-enum-indirect.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/no_share-enum.rs
src/test/compile-fail/no_share-struct.rs
src/test/compile-fail/not-panic-safe-3.rs
src/test/compile-fail/not-panic-safe-5.rs
src/test/compile-fail/not-panic-safe.rs
src/test/compile-fail/not-sync.rs
src/test/compile-fail/object-does-not-impl-trait.rs
src/test/compile-fail/phantom-oibit.rs
src/test/compile-fail/range-1.rs
src/test/compile-fail/reflect-assoc.rs
src/test/compile-fail/reflect-object-param.rs
src/test/compile-fail/reflect.rs
src/test/compile-fail/repeat-to-run-dtor-twice.rs
src/test/compile-fail/str-idx.rs
src/test/compile-fail/str-mut-idx.rs
src/test/compile-fail/task-rng-isnt-sendable.rs
src/test/compile-fail/trait-bounds-not-on-bare-trait.rs
src/test/compile-fail/trait-bounds-on-structs-and-enums-in-fns.rs
src/test/compile-fail/trait-bounds-on-structs-and-enums-in-impls.rs
src/test/compile-fail/trait-bounds-on-structs-and-enums-locals.rs
src/test/compile-fail/trait-bounds-on-structs-and-enums-static.rs
src/test/compile-fail/trait-bounds-on-structs-and-enums-xc.rs
src/test/compile-fail/trait-bounds-on-structs-and-enums-xc1.rs
src/test/compile-fail/trait-bounds-on-structs-and-enums.rs
src/test/compile-fail/trait-coercion-generic-bad.rs
src/test/compile-fail/trait-suggest-where-clause.rs [new file with mode: 0644]
src/test/compile-fail/traits-negative-impls.rs
src/test/compile-fail/traits-repeated-supertrait-ambig.rs
src/test/compile-fail/type-params-in-different-spaces-2.rs
src/test/compile-fail/typeck-default-trait-impl-assoc-type.rs
src/test/compile-fail/typeck-default-trait-impl-constituent-types-2.rs
src/test/compile-fail/typeck-default-trait-impl-constituent-types.rs
src/test/compile-fail/typeck-default-trait-impl-negation-send.rs
src/test/compile-fail/typeck-default-trait-impl-negation-sync.rs
src/test/compile-fail/typeck-default-trait-impl-negation.rs
src/test/compile-fail/typeck-default-trait-impl-precedence.rs
src/test/compile-fail/typeck-default-trait-impl-send-param.rs
src/test/compile-fail/typeck-default-trait-impl-supertrait.rs
src/test/compile-fail/typeck-default-trait-impl-trait-where-clause-2.rs
src/test/compile-fail/typeck-default-trait-impl-trait-where-clause.rs
src/test/compile-fail/typeck-unsafe-always-share.rs
src/test/compile-fail/ufcs-qpath-self-mismatch.rs
src/test/compile-fail/unboxed-closure-sugar-default.rs
src/test/compile-fail/unboxed-closure-sugar-equiv.rs
src/test/compile-fail/unboxed-closures-fnmut-as-fn.rs
src/test/compile-fail/unboxed-closures-unsafe-extern-fn.rs
src/test/compile-fail/unboxed-closures-wrong-abi.rs
src/test/compile-fail/unboxed-closures-wrong-arg-type-extern-fn.rs
src/test/compile-fail/unique-unique-kind.rs
src/test/compile-fail/unique-vec-res.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/compile-fail/vtable-res-trait-param.rs
src/test/compile-fail/wf-impl-associated-type-trait.rs
src/test/compile-fail/where-clause-constraints-are-local-for-inherent-impl.rs
src/test/compile-fail/where-clause-constraints-are-local-for-trait-impl.rs
src/test/compile-fail/where-clause-method-substituion.rs
src/test/compile-fail/where-clauses-method-unsatisfied.rs
src/test/compile-fail/where-clauses-unsatisfied.rs
src/test/compile-fail/where-for-self-2.rs

index 2afe995aeea9a404e845313cbdbe7fa4d2165b10..1b7a0da0112bd2bca262954e3d917c902aafffef 100644 (file)
@@ -371,14 +371,13 @@ assert_eq!(6, answer);
 This gives us these long, related errors:
 
 ```text
-error: the trait `core::marker::Sized` is not implemented for the type
-`core::ops::Fn(i32) -> i32` [E0277]
+error: the predicate `core::ops::Fn(i32) -> i32 : core::marker::Sized` is not satisfied [E0277]
 fn factory() -> (Fn(i32) -> i32) {
                 ^~~~~~~~~~~~~~~~
 note: `core::ops::Fn(i32) -> i32` does not have a constant size known at compile-time
 fn factory() -> (Fn(i32) -> i32) {
                 ^~~~~~~~~~~~~~~~
-error: the trait `core::marker::Sized` is not implemented for the type `core::ops::Fn(i32) -> i32` [E0277]
+error: the predicate `core::ops::Fn(i32) -> i32 : core::marker::Sized` is not satisfied [E0277]
 let f = factory();
     ^
 note: `core::ops::Fn(i32) -> i32` does not have a constant size known at compile-time
index 87d551b68df07b6db1a584539fef0d1fb201250d..8b918d3cfeff8ffa5bbe6e3079f4c95949587c28 100644 (file)
@@ -231,8 +231,8 @@ fn main() {
 This won't work, however, and will give us the error:
 
 ```text
-13:9: 13:22 error: the trait `core::marker::Send` is not
-            implemented for the type `alloc::rc::Rc<collections::vec::Vec<i32>>`
+13:9: 13:22 error: the predicate `alloc::rc::Rc<collections::vec::Vec<i32>> : core::marker::Send`
+            is not satisfied
 ...
 13:9: 13:22 note: `alloc::rc::Rc<collections::vec::Vec<i32>>`
             cannot be sent between threads safely
index 2a164077683b29694e18628d32d32777a7c38eeb..00aa33a9308c60d3ab3487cb83d011200d6a672a 100644 (file)
@@ -154,7 +154,7 @@ print_area(5);
 We get a compile-time error:
 
 ```text
-error: the trait `HasArea` is not implemented for the type `_` [E0277]
+error: the predicate `_ : HasArea` is not satisfied [E0277]
 ```
 
 ## Trait bounds on generic structs
@@ -496,7 +496,7 @@ impl FooBar for Baz {
 If we forget to implement `Foo`, Rust will tell us:
 
 ```text
-error: the trait `main::Foo` is not implemented for the type `main::Baz` [E0277]
+error: the predicate `main::Baz : main::Foo` is not satisfied [E0277]
 ```
 
 # Deriving
index e96dddf8c82cfecc05ffd300c85c6aeea0912c56..c98274a6649bd902c13fd9bfc5c7990d59458533 100644 (file)
@@ -56,8 +56,8 @@ v[j];
 Indexing with a non-`usize` type gives an error that looks like this:
 
 ```text
-error: the trait `core::ops::Index<i32>` is not implemented for the type
-`collections::vec::Vec<_>` [E0277]
+error: the predicate `collections::vec::Vec<_> : core::ops::Index<i32>`
+is not satisfied [E0277]
 v[j];
 ^~~~
 note: the type `collections::vec::Vec<_>` cannot be indexed by `i32`
index 1d2897ce3bd1f37e260389cde03328d0d6bb5cb6..3fb7f620eeea533f52c128da0519ab61ec565010 100644 (file)
@@ -64,7 +64,7 @@ fn main() {
 ```
 
 ```text
-<anon>:10:5: 10:8 error: the trait `Trait` is not implemented for the type `&mut i32` [E0277]
+<anon>:10:5: 10:8 error: the predicate `&mut i32 : Trait` is not satisfied [E0277]
 <anon>:10     foo(t);
               ^~~
 ```
index 6f06efd0f9f2659a272b1b4b0eb14037e3202fe4..51c453c784e95f2797cff95811dee477d359cfd9 100644 (file)
@@ -1006,8 +1006,7 @@ fn some_func<T: Foo>(foo: T) {
 fn main() {
     // we now call the method with the i32 type, which doesn't implement
     // the Foo trait
-    some_func(5i32); // error: the trait `Foo` is not implemented for the
-                     //        type `i32`
+    some_func(5i32); // error: the predicate `i32 : Foo` is not satisfied
 }
 ```
 
index cbcac7f9aa4883658552150cbdcecca6c504850c..82b5dc66f7c421bdcc9aab353e5050eed0c8926c 100644 (file)
     FulfillmentErrorCode,
     MismatchedProjectionTypes,
     Obligation,
+    ObligationCause,
     ObligationCauseCode,
     OutputTypeParameterMismatch,
     TraitNotObjectSafe,
     PredicateObligation,
+    SelectionContext,
     SelectionError,
     ObjectSafetyViolation,
     MethodViolationCode,
@@ -26,8 +28,9 @@
 use fmt_macros::{Parser, Piece, Position};
 use middle::def_id::DefId;
 use infer::InferCtxt;
-use ty::{self, ToPredicate, ToPolyTraitRef, TraitRef, Ty, TyCtxt, TypeFoldable};
+use ty::{self, ToPredicate, ToPolyTraitRef, Ty, TyCtxt};
 use ty::fast_reject;
+use ty::fold::{TypeFoldable, TypeFolder};
 use util::nodemap::{FnvHashMap, FnvHashSet};
 
 use std::cmp;
@@ -100,9 +103,10 @@ pub fn report_projection_error<'a, 'tcx>(infcx: &InferCtxt<'a, 'tcx>,
     }
 }
 
-fn report_on_unimplemented<'a, 'tcx>(infcx: &InferCtxt<'a, 'tcx>,
-                                     trait_ref: &TraitRef<'tcx>,
-                                     span: Span) -> Option<String> {
+fn on_unimplemented_note<'a, 'tcx>(infcx: &InferCtxt<'a, 'tcx>,
+                                   trait_ref: ty::PolyTraitRef<'tcx>,
+                                   span: Span) -> Option<String> {
+    let trait_ref = trait_ref.skip_binder();
     let def_id = trait_ref.def_id;
     let mut report = None;
     for item in infcx.tcx.get_attrs(def_id).iter() {
@@ -357,14 +361,20 @@ pub fn report_selection_error<'a, 'tcx>(infcx: &InferCtxt<'a, 'tcx>,
                             let trait_ref = trait_predicate.to_poly_trait_ref();
                             let mut err = struct_span_err!(
                                 infcx.tcx.sess, obligation.cause.span, E0277,
-                                "the trait `{}` is not implemented for the type `{}`",
-                                trait_ref, trait_ref.self_ty());
-
-                            // Check if it has a custom "#[rustc_on_unimplemented]"
-                            // error message, report with that message if it does
-                            let custom_note = report_on_unimplemented(infcx, &trait_ref.0,
-                                                                      obligation.cause.span);
-                            if let Some(s) = custom_note {
+                                "the predicate `{}` is not satisfied",
+                                trait_ref.to_predicate());
+
+                            // Try to report a good error message.
+
+                            if !trait_ref.has_infer_types() &&
+                                predicate_can_apply(infcx, trait_ref)
+                            {
+                                err.fileline_help(obligation.cause.span, &format!(
+                                    "consider adding a `where {}` bound",
+                                    trait_ref.to_predicate()
+                                    ));
+                            } else if let Some(s) = on_unimplemented_note(infcx, trait_ref,
+                                                                          obligation.cause.span) {
                                 err.fileline_note(obligation.cause.span, &s);
                             } else {
                                 let simp = fast_reject::simplify_type(infcx.tcx,
@@ -644,6 +654,55 @@ pub fn maybe_report_ambiguity<'a, 'tcx>(infcx: &InferCtxt<'a, 'tcx>,
     }
 }
 
+/// Returns whether the trait predicate may apply for *some* assignment
+/// to the type parameters.
+fn predicate_can_apply<'a, 'tcx>(infcx: &InferCtxt<'a, 'tcx>,
+                                 pred: ty::PolyTraitRef<'tcx>)
+                                 -> bool
+{
+    struct ParamToVarFolder<'a, 'tcx: 'a> {
+        infcx: &'a InferCtxt<'a, 'tcx>,
+        var_map: FnvHashMap<Ty<'tcx>, Ty<'tcx>>
+    }
+
+    impl<'a, 'tcx> TypeFolder<'tcx> for ParamToVarFolder<'a, 'tcx>
+    {
+        fn tcx(&self) -> &TyCtxt<'tcx> { self.infcx.tcx }
+
+        fn fold_ty(&mut self, ty: Ty<'tcx>) -> Ty<'tcx> {
+            if let ty::TyParam(..) = ty.sty {
+                let infcx = self.infcx;
+                self.var_map.entry(ty).or_insert_with(|| infcx.next_ty_var())
+            } else {
+                ty.super_fold_with(self)
+            }
+        }
+    }
+
+    infcx.probe(|_| {
+        let mut selcx = SelectionContext::new(infcx);
+
+        let cleaned_pred = pred.fold_with(&mut ParamToVarFolder {
+            infcx: infcx,
+            var_map: FnvHashMap()
+        });
+
+        let cleaned_pred = super::project::normalize(
+            &mut selcx,
+            ObligationCause::dummy(),
+            &cleaned_pred
+        ).value;
+
+        let obligation = Obligation::new(
+            ObligationCause::dummy(),
+            cleaned_pred.to_predicate()
+        );
+
+        selcx.evaluate_obligation(&obligation)
+    })
+}
+
+
 fn need_type_info<'a, 'tcx>(infcx: &InferCtxt<'a, 'tcx>,
                             span: Span,
                             ty: Ty<'tcx>)
index c5a47f3e5358f1440330edbfc7427c32d4bf7f10..48bfa84fa8666cb6a5e29db6c3c5d2d18b1554b0 100644 (file)
@@ -31,5 +31,5 @@ trait Add<RHS=Self> {
 fn ice<A>(a: A) {
     let r = loop {};
     r = r + a;
-    //~^ ERROR not implemented
+    //~^ ERROR E0277
 }
index adccd73beae2dc97651f38cdc1f844e6611cd74e..cd21fb949cb84190aa147147adff53868501b9c0 100644 (file)
@@ -24,7 +24,7 @@ pub trait GetToInt
 fn foo<G>(g: G) -> isize
     where G : GetToInt
 {
-    ToInt::to_int(&g.get()) //~ ERROR not implemented
+    ToInt::to_int(&g.get()) //~ ERROR E0277
 }
 
 fn bar<G : GetToInt>(g: G) -> isize
index 9c173515793f44f84c47038fb8a51f0de08e8aa6..a8aee5fd0a593daf09abc3fe455fd9906091bc2b 100644 (file)
@@ -15,7 +15,7 @@ trait Get {
 
 trait Other {
     fn uhoh<U:Get>(&self, foo: U, bar: <Self as Get>::Value) {}
-    //~^ ERROR the trait `Get` is not implemented for the type `Self`
+    //~^ ERROR the predicate `Self : Get` is not satisfied
 }
 
 fn main() {
index d48cff405a6371d473dfafb195d95016c9f43528..32068633df6a1baf9d82bdfeb352bd593adf5ea0 100644 (file)
@@ -18,7 +18,7 @@ trait Foo<T> {
 
 fn f<T:Foo<isize>>(t: &T) {
     let u: <T as Foo<usize>>::Bar = t.get_bar();
-    //~^ ERROR the trait `Foo<usize>` is not implemented for the type `T`
+    //~^ ERROR the predicate `T : Foo<usize>` is not satisfied
 }
 
 fn main() { }
index fd60896c29885b262a657fec9efa2de3a2716162..19f0e27fa55b18c7b0a125be573a427d194836d2 100644 (file)
@@ -19,7 +19,7 @@ struct Struct {
 
 impl Struct {
     fn uhoh<T>(foo: <T as Get>::Value) {}
-    //~^ ERROR the trait `Get` is not implemented for the type `T`
+    //~^ ERROR the predicate `T : Get` is not satisfied
 }
 
 fn main() {
index bda16c8a85de15d03c00c2470688bb3cb34b158a..63e76f7eeaa51c060203632ed45e576f032a7b11 100644 (file)
@@ -25,7 +25,7 @@ trait Get {
 
 trait Other {
     fn uhoh<U:Get>(&self, foo: U, bar: <Self as Get>::Value) {}
-    //~^ ERROR the trait `Get` is not implemented for the type `Self`
+    //~^ ERROR the predicate `Self : Get` is not satisfied
 }
 
 fn main() { }
index 0b1d6a5b71ad20e0abb8a6bc1809ab559747fcb0..38f5be37bd1eded6b19d559a0bd4f093a5ee0780 100644 (file)
@@ -25,12 +25,12 @@ trait Get {
 
 trait Other {
     fn uhoh<U:Get>(&self, foo: U, bar: <Self as Get>::Value) {}
-    //~^ ERROR the trait `Get` is not implemented for the type `Self`
+    //~^ ERROR the predicate `Self : Get` is not satisfied
 }
 
 impl<T:Get> Other for T {
     fn uhoh<U:Get>(&self, foo: U, bar: <(T, U) as Get>::Value) {}
-    //~^ ERROR the trait `Get` is not implemented for the type `(T, U)`
+    //~^ ERROR the predicate `(T, U) : Get` is not satisfied
 }
 
 fn main() { }
index c9374d42938002979a871480b1e1b94987ea567b..ee228899bb378da311c238569294386db075c144 100644 (file)
@@ -38,12 +38,12 @@ pub fn f1_int_uint() {
 
 pub fn f1_uint_uint() {
     f1(2u32, 4u32);
-    //~^ ERROR the trait `Foo` is not implemented
+    //~^ ERROR `u32 : Foo` is not satisfied
 }
 
 pub fn f1_uint_int() {
     f1(2u32, 4i32);
-    //~^ ERROR the trait `Foo` is not implemented
+    //~^ ERROR `u32 : Foo` is not satisfied
 }
 
 pub fn f2_int() {
index a32d4de77557b4017f12692af54cc0db1badc70f..468b40e697185d07cf0fb608464982cb30f340c5 100644 (file)
@@ -14,7 +14,7 @@ trait Get {
 }
 
 fn foo<T:Get>(t: T) {
-    let x = t.get(); //~ ERROR the trait `std::marker::Sized` is not implemented
+    let x = t.get(); //~ ERROR `<T as Get>::Value : std::marker::Sized` is not
 }
 
 fn main() {
index 224187c8ac4cd135a48fd1bef13872861dbf6751..4de6600f2d242ef5cc491760b5cc54359b3242da 100644 (file)
@@ -9,7 +9,7 @@
 // except according to those terms.
 
 fn foo<T:'static>() {
-    1.bar::<T>(); //~ ERROR `std::marker::Send` is not implemented
+    1.bar::<T>(); //~ ERROR `T : std::marker::Send` is not satisfied
 }
 
 trait bar {
index e9dd0585fa9e91b59b9d4892b28f272a45a2b4be..d25d0081c56658b6c0f481a55eb93a7efcbbc187 100644 (file)
@@ -12,7 +12,7 @@ trait Trait {}
 
 pub fn main() {
     let x: Vec<Trait + Sized> = Vec::new();
-    //~^ ERROR the trait `std::marker::Sized` is not implemented
-    //~| ERROR the trait `std::marker::Sized` is not implemented
-    //~| ERROR the trait `std::marker::Sized` is not implemented
+    //~^ ERROR `Trait + Sized : std::marker::Sized` is not satisfied
+    //~| ERROR `Trait + Sized : std::marker::Sized` is not satisfied
+    //~| ERROR `Trait + Sized : std::marker::Sized` is not satisfied
 }
index e1bcc63fb2fed8d640a1ba396a4868383c4615d7..03ab94e5908f68957c793f95a9f16ddc8738c0fc 100644 (file)
@@ -13,9 +13,9 @@
 
 trait Foo : Send+Sync { }
 
-impl <T: Sync+'static> Foo for (T,) { } //~ ERROR the trait `std::marker::Send` is not implemented
+impl <T: Sync+'static> Foo for (T,) { } //~ ERROR `T : std::marker::Send` is not satisfied
 
-impl <T: Send> Foo for (T,T) { } //~ ERROR the trait `std::marker::Sync` is not implemented
+impl <T: Send> Foo for (T,T) { } //~ ERROR `T : std::marker::Sync` is not satisfied
 
 impl <T: Send+Sync> Foo for (T,T,T) { } // (ok)
 
index 5e2ba7a3b9d4662de77bf441bb8517960272f6d1..1063280ea2656894c8153f7d5f563754eb68e269 100644 (file)
@@ -22,6 +22,6 @@
 impl <T:Sync> RequiresShare for X<T> { }
 
 impl <T:Sync+'static> RequiresRequiresShareAndSend for X<T> { }
-//~^ ERROR the trait `std::marker::Send` is not implemented
+//~^ ERROR `T : std::marker::Send` is not satisfied
 
 fn main() { }
index 7c9c0df412a40619b3095b6199aa431d5bb411ba..40625fc82aa90e91523f394fcb79072833391b15 100644 (file)
@@ -14,6 +14,6 @@
 trait Foo : Send { }
 
 impl Foo for std::rc::Rc<i8> { }
-//~^ ERROR the trait `std::marker::Send` is not implemented
+//~^ ERROR `std::rc::Rc<i8> : std::marker::Send` is not satisfied
 
 fn main() { }
index 13ad13223466b7b80330f7c39c3ea068bf5b8b2e..7e05c6462ffa6d5b6b8eb7a7bfcb23405a99541c 100644 (file)
@@ -12,6 +12,6 @@
 
 trait Foo : Send { }
 
-impl <T: Sync+'static> Foo for T { } //~ ERROR the trait `std::marker::Send` is not implemented
+impl <T: Sync+'static> Foo for T { } //~ ERROR `T : std::marker::Send` is not satisfied
 
 fn main() { }
index 9653a1357efa00020dc59b53a868502d30d0d29a..2bc4d82ef0a4c6efaac7333858329e3eb4855ba1 100644 (file)
@@ -91,7 +91,7 @@ fn main()
     let _ = 42usize as *const [u8]; //~ ERROR casting
     let _ = v as *const [u8]; //~ ERROR cannot cast
     let _ = fat_v as *const Foo;
-    //~^ ERROR `std::marker::Sized` is not implemented for the type `[u8]`
+    //~^ ERROR the predicate `[u8] : std::marker::Sized` is not satisfied
     //~^^ HELP run `rustc --explain E0277` to see a detailed explanation
     //~^^^ NOTE `[u8]` does not have a constant size known at compile-time
     //~^^^^ NOTE required for the cast to the object type `Foo`
@@ -106,7 +106,7 @@ fn main()
 
     let a : *const str = "hello";
     let _ = a as *const Foo;
-    //~^ ERROR `std::marker::Sized` is not implemented for the type `str`
+    //~^ ERROR the predicate `str : std::marker::Sized` is not satisfied
     //~^^ HELP run `rustc --explain E0277` to see a detailed explanation
     //~^^^ NOTE `str` does not have a constant size known at compile-time
     //~^^^^ NOTE required for the cast to the object type `Foo`
index 40085d8137893bb7e455a04662587ea7d9f4f0ba..ed18ed62111cc5f75e9377abc03619fa294028b4 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 the trait `std::marker::Send` is not implemented for the type
+    //~^ ERROR `F : std::marker::Send` is not satisfied
     return X { field: blk };
 }
 
index c8fe4a1b8d268180fa9da5fee6b574e7d2e2344c..b618cd07760d61cbf268f16d883cab95ee500605 100644 (file)
@@ -21,7 +21,7 @@ fn give_any<F>(f: F) where F: FnOnce() {
 
 fn give_owned<F>(f: F) where F: FnOnce() + Send {
     take_any(f);
-    take_const_owned(f); //~ ERROR the trait `std::marker::Sync` is not implemented for the type
+    take_const_owned(f); //~ ERROR `F : std::marker::Sync` is not satisfied
 }
 
 fn main() {}
index 7d4c618de665c622712d252d60417fade9974ef5..eb063f5bc8c3c904c612108252bf189c0023855a 100644 (file)
@@ -23,7 +23,7 @@ trait Bar<X> { }
 
 // We don't always check where clauses for sanity, but in this case
 // wfcheck does report an error here:
-fn vacuous<A>() //~ ERROR the trait `Bar<u32>` is not implemented for the type `i32`
+fn vacuous<A>() //~ ERROR the predicate `i32 : Bar<u32>` is not satisfied
     where i32: Foo<u32, A>
 {
     // ... the original intention was to check that we don't use that
index 4fc922d32a0e7c5ec2709a027b199203d23a70a0..d767fc3263624711cb687c4639aadc2962b65ee8 100644 (file)
@@ -18,7 +18,7 @@ struct E {
 #[derive(Clone)]
 struct C {
     x: NoCloneOrEq
-    //~^ ERROR the trait `std::clone::Clone` is not implemented for the type `NoCloneOrEq`
+    //~^ ERROR `NoCloneOrEq : std::clone::Clone` is not satisfied
 }
 
 
index e70a1613dc2010fcb3a72ae3f12c067282d8a1d3..6b81804e028be89cbf49f2681d7bf9b04e066109 100644 (file)
@@ -17,7 +17,7 @@
 
 #[derive(Default)]
 struct Struct {
-    x: Error //~ ERROR `std::default::Default` is not implemented
+    x: Error //~ ERROR `Error : std::default::Default` is not satisfied
 }
 
 fn main() {}
index 3c642bd8b70587adecdb9596c81336b219d67263..3e6428c7d579b8843aaec9085f658e0334880d16 100644 (file)
@@ -35,7 +35,7 @@ fn main() {
     // n == m
     let &x = &1isize as &T;      //~ ERROR type `&T` cannot be dereferenced
     let &&x = &(&1isize as &T);  //~ ERROR type `&T` cannot be dereferenced
-    let box x = box 1isize as Box<T>; //~ ERROR the trait `std::marker::Sized` is not implemented
+    let box x = box 1isize as Box<T>; //~ ERROR `T : std::marker::Sized` is not satisfied
 
     // n > m
     let &&x = &1isize as &T;
index 110413cd32229408bf9fd067456627404f212ef7..6e2380da6a13c7b254a6c4483c8bdea8d7f16c88 100644 (file)
@@ -44,5 +44,5 @@ pub fn main() {
     // FIXME (#22405): Replace `Box::new` with `box` here when/if possible.
     let z: Box<ToBar> = Box::new(Bar1 {f: 36});
     f5.ptr = *z;
-    //~^ ERROR the trait `std::marker::Sized` is not implemented
+    //~^ ERROR `ToBar : std::marker::Sized` is not satisfied
 }
index d4221adfa2aceadee2bfbbbbfc490a95492b497b..ab874d4e877c05e70fe51d0776685d9e6ef3e6bd 100644 (file)
@@ -49,5 +49,5 @@ pub fn main() {
     //~| found `Bar1`
     //~| expected trait ToBar
     //~| found struct `Bar1`
-    //~| ERROR the trait `std::marker::Sized` is not implemented for the type `ToBar`
+    //~| ERROR `ToBar : std::marker::Sized` is not satisfied
 }
index 2d87345db2245f5c71701480ad892e3cceda4f61..2413bbae84c065fd41387b3a4ccc8d6ff15c657e 100644 (file)
@@ -28,5 +28,5 @@ pub fn main() {
     let f1 = Fat { ptr: Foo };
     let f2: &Fat<Foo> = &f1;
     let f3: &Fat<Bar> = f2;
-    //~^ ERROR the trait `Bar` is not implemented for the type `Foo`
+    //~^ ERROR `Foo : Bar` is not satisfied
 }
index 9e23b6ea44e3e44cc0a457be8a31154ac25beb2e..0b9d99396f7c4dd84421927de777871b7a38e690 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 the trait `std::marker::Sized` is not implemented
+    //~^ ERROR `[isize] : std::marker::Sized` is not satisfied
 }
index 68e6bc0ed7654635312ec9c3dfd1e7156378c320..36bd1a98ca9192dd11ba015c8ac176f4a176577a 100644 (file)
@@ -16,22 +16,22 @@ impl Foo for [u8] {}
 
 fn test1<T: ?Sized + Foo>(t: &T) {
     let u: &Foo = t;
-    //~^ ERROR `std::marker::Sized` is not implemented for the type `T`
+    //~^ ERROR `T : std::marker::Sized` is not satisfied
 }
 
 fn test2<T: ?Sized + Foo>(t: &T) {
     let v: &Foo = t as &Foo;
-    //~^ ERROR `std::marker::Sized` is not implemented for the type `T`
+    //~^ ERROR `T : std::marker::Sized` is not satisfied
 }
 
 fn test3() {
     let _: &[&Foo] = &["hi"];
-    //~^ ERROR `std::marker::Sized` is not implemented for the type `str`
+    //~^ ERROR `str : std::marker::Sized` is not satisfied
 }
 
 fn test4(x: &[u8]) {
     let _: &Foo = x as &Foo;
-    //~^ ERROR `std::marker::Sized` is not implemented for the type `[u8]`
+    //~^ ERROR `[u8] : std::marker::Sized` is not satisfied
 }
 
 fn main() { }
index 0241c207c9df81503bef16ec390ac328722d4f62..37500871563585669ab3e519e83db508fae84f4f 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 the trait `std::marker::Sized` is not implemented for the type `[isize]`
+//~^ ERROR `[isize] : std::marker::Sized` is not satisfied
 
 impl Foo<isize> for [usize] { }
-//~^ ERROR the trait `std::marker::Sized` is not implemented for the type `[usize]`
+//~^ ERROR `[usize] : std::marker::Sized` is not satisfied
 
 pub fn main() { }
index 14fe14ae3679b1a41147a239ceb577ecb9de0908..8b1e2fc19663dc448d87583e81eff3d2fd3b8919 100644 (file)
@@ -13,5 +13,5 @@
 fn check_bound<T:Copy>(_: T) {}
 
 fn main() {
-    check_bound("nocopy".to_string()); //~ ERROR the trait `std::marker::Copy` is not implemented
+    check_bound("nocopy".to_string()); //~ ERROR : std::marker::Copy` is not satisfied
 }
index 8437ff766919b9fbbbdc1d9d6714f54c1efedb40..89ed960c8913ba87b8ccd18b82ea07de4a00a4d6 100644 (file)
@@ -17,6 +17,6 @@ fn main() {
     // extern functions are extern "C" fn
     let _x: extern "C" fn() = f; // OK
     is_fn(f);
-    //~^ ERROR the trait `std::ops::Fn<()>` is not implemented for the type `extern "C" fn()
-    //~| ERROR the trait `std::ops::FnOnce<()>` is not implemented for the type `extern "C" fn()
+    //~^ ERROR `extern "C" fn() {f} : std::ops::Fn<()>` is not satisfied
+    //~| ERROR `extern "C" fn() {f} : std::ops::FnOnce<()>` is not satisfied
 }
index 6309beaf4b531afeddae54d6bffc260f3d3d1c20..8cbfc520ff449cc32cdf3933389d7719613d7554 100644 (file)
@@ -34,6 +34,6 @@ fn main() {
     //~| found box
 
     needs_fn(1);
-    //~^ ERROR `std::ops::Fn<(isize,)>`
-    //~| ERROR `std::ops::FnOnce<(isize,)>`
+    //~^ ERROR std::ops::Fn<(isize,)>`
+    //~| ERROR std::ops::FnOnce<(isize,)>`
 }
index de4dd422d4ffc02479d118c4e9270cae1299990b..8b127ca179585771111ef549d563cceb3866af25 100644 (file)
@@ -24,7 +24,7 @@ pub fn main() {
         x: 1,
         y: 2,
     };
-    for x in bogus { //~ ERROR `std::iter::Iterator` is not implemented for the type `MyStruct`
+    for x in bogus { //~ ERROR `MyStruct : std::iter::Iterator`
         drop(x);
     }
 }
index 3efe0501267e9b1ac6c5f031ac022586e3562548..845429d4b0c0b37a07c89fd0500d0389fe888ed0 100644 (file)
@@ -35,6 +35,6 @@ impl<'a> Foo<(&'a isize, &'a isize)> for SomeStruct
 }
 
 fn a() { want_foo1::<SomeStruct>(); } // OK -- foo wants just one region
-fn b() { want_foo2::<SomeStruct>(); } //~ ERROR not implemented
+fn b() { want_foo2::<SomeStruct>(); } //~ ERROR E0277
 
 fn main() { }
index 249256f8e01a6a0e6f2da50b6f279640caa72245..b55dccec2d56f95adec0155cfaae1dd679d5ee1d 100644 (file)
@@ -54,7 +54,7 @@ fn want_qux<B>(b: &B)
     where B : Qux
 {
     want_foo_for_any_tcx(b);
-    want_bar_for_any_ccx(b); //~ ERROR not implemented
+    want_bar_for_any_ccx(b); //~ ERROR E0277
 }
 
 fn main() {}
index 441ad76b6023ca980430def642c4c8e7ef77372a..4c5add4aceaaf15273f468de48cc5e2731bce19a 100644 (file)
@@ -25,7 +25,7 @@ fn want_foo_for_some_tcx<'x,F>(f: &'x F)
     where F : Foo<'x>
 {
     want_foo_for_some_tcx(f);
-    want_foo_for_any_tcx(f); //~ ERROR not implemented
+    want_foo_for_any_tcx(f); //~ ERROR E0277
 }
 
 fn want_foo_for_any_tcx<F>(f: &F)
@@ -42,7 +42,7 @@ fn want_bar_for_some_ccx<'x,B>(b: &B)
     want_foo_for_any_tcx(b);
 
     want_bar_for_some_ccx(b);
-    want_bar_for_any_ccx(b); //~ ERROR not implemented
+    want_bar_for_any_ccx(b); //~ ERROR E0277
 }
 
 fn want_bar_for_any_ccx<B>(b: &B)
index a1ec4a739e8cea03dbd55880b2eaf33d46eef86e..270e6b9f183a7a7c94521f1612c53fb4800e3471 100644 (file)
@@ -31,7 +31,7 @@ fn give_any() {
 struct StaticInt;
 impl Foo<&'static isize> for StaticInt { }
 fn give_static() {
-    want_hrtb::<StaticInt>() //~ ERROR `for<'a> Foo<&'a isize>` is not implemented
+    want_hrtb::<StaticInt>() //~ ERROR `for<'a> StaticInt : Foo<&'a isize>` is not satisfied
 }
 
 fn main() { }
index e8ecc0608fc4aeb1081bf617912250490c9123eb..24e59e6c29e353dd24965a85b09163173d4c6e8f 100644 (file)
@@ -53,7 +53,7 @@ fn foo_hrtb_bar_not<'b,T>(mut t: T)
     // be implemented. Thus to satisfy `&mut T : for<'a> Foo<&'a
     // isize>`, we require `T : for<'a> Bar<&'a isize>`, but the where
     // clause only specifies `T : Bar<&'b isize>`.
-    foo_hrtb_bar_not(&mut t); //~ ERROR `for<'a> Bar<&'a isize>` is not implemented for the type `T`
+    foo_hrtb_bar_not(&mut t); //~ ERROR `for<'a> T : Bar<&'a isize>` is not satisfied
 }
 
 fn foo_hrtb_bar_hrtb<T>(mut t: T)
index 19e019b58bc782d770f4aceab7625aa37c877bfa..dd14d0c91545880f5850977f0c645b44404e91b0 100644 (file)
@@ -10,5 +10,5 @@
 
 fn main() {
     format!("{:X}", "3");
-    //~^ ERROR: the trait `std::fmt::UpperHex` is not implemented
+    //~^ ERROR: `str : std::fmt::UpperHex` is not satisfied
 }
index 8c8f67e40abef59af082a594b670b2e9a9122eb6..12696585a9e619f8865303afab1d8c5d62e330d9 100644 (file)
@@ -17,7 +17,7 @@ trait Getter<T: Clone2> {
     fn get(&self) -> T;
 }
 
-impl Getter<isize> for isize { //~ ERROR the trait `Clone2` is not implemented
+impl Getter<isize> for isize { //~ ERROR `isize : Clone2` is not satisfied
     fn get(&self) -> isize { *self }
 }
 
index 8143ef84467ec6439fca7384113f886bc0be5ef8..f8979686038b00c2ef8239e1b7bf8f4cd9c5fd79 100644 (file)
@@ -13,7 +13,7 @@
 
 fn main() {
     fn bar<T>(_: T) {}
-    [0][0u8]; //~ ERROR: the trait `std::ops::Index<u8>` is not implemented
+    [0][0u8]; //~ ERROR: `[_] : std::ops::Index<u8>` is not satisfied
 
     [0][0]; // should infer to be a usize
 
index 047ab9d2a8fdbc6d9db3be37437fa7d318229e86..897aca66cbfd466705cc089e5a8b42e50d0e68f8 100644 (file)
@@ -13,14 +13,14 @@ pub fn main() {
     let s: String = "abcdef".to_string();
     v[3_usize];
     v[3];
-    v[3u8];  //~ERROR the trait `std::ops::Index<u8>` is not implemented
-    v[3i8];  //~ERROR the trait `std::ops::Index<i8>` is not implemented
-    v[3u32]; //~ERROR the trait `std::ops::Index<u32>` is not implemented
-    v[3i32]; //~ERROR the trait `std::ops::Index<i32>` is not implemented
+    v[3u8];  //~ERROR : std::ops::Index<u8>` is not satisfied
+    v[3i8];  //~ERROR : std::ops::Index<i8>` is not satisfied
+    v[3u32]; //~ERROR : std::ops::Index<u32>` is not satisfied
+    v[3i32]; //~ERROR : std::ops::Index<i32>` is not satisfied
     s.as_bytes()[3_usize];
     s.as_bytes()[3];
-    s.as_bytes()[3u8];  //~ERROR the trait `std::ops::Index<u8>` is not implemented
-    s.as_bytes()[3i8];  //~ERROR the trait `std::ops::Index<i8>` is not implemented
-    s.as_bytes()[3u32]; //~ERROR the trait `std::ops::Index<u32>` is not implemented
-    s.as_bytes()[3i32]; //~ERROR the trait `std::ops::Index<i32>` is not implemented
+    s.as_bytes()[3u8];  //~ERROR : std::ops::Index<u8>` is not satisfied
+    s.as_bytes()[3i8];  //~ERROR : std::ops::Index<i8>` is not satisfied
+    s.as_bytes()[3u32]; //~ERROR : std::ops::Index<u32>` is not satisfied
+    s.as_bytes()[3i32]; //~ERROR : std::ops::Index<i32>` is not satisfied
 }
index dfdbea5f76e03269b9026f7037f74b9fd5c0fa03..20da46dcaa29be76eab2d0ba248ef732be4fc8c8 100644 (file)
@@ -13,5 +13,5 @@
 
 fn main() {
     () <- 0;
-    //~^ ERROR: the trait `std::ops::Placer<_>` is not implemented
+    //~^ ERROR: `() : std::ops::Placer<_>` is not satisfied
 }
index 4019b265edde20695624719e4b7c7acf06ab6b40..6f4e9887dc6e619b0f89ca6c69a78e588a30d0c9 100644 (file)
@@ -10,5 +10,5 @@
 
 fn main() {
     let _x = "test" as &::std::any::Any;
-//~^ ERROR the trait `std::marker::Sized` is not implemented for the type `str`
+//~^ ERROR `str : std::marker::Sized` is not satisfied
 }
index eca6b02dbdc2ef8b409cf40a9549adb72a131976..790000a3f9234702aede2023d1ba0ffb4e18b418 100644 (file)
@@ -15,7 +15,7 @@ fn dft_iter<'a, T>(arg1: Chunks<'a,T>, arg2: ChunksMut<'a,T>)
 {
     for
     &mut something
-//~^ ERROR the trait `std::marker::Sized` is not implemented for the type `[T]`
+//~^ ERROR `[T] : std::marker::Sized` is not satisfied
     in arg2
     {
     }
index 3b819916fbd55858d1fb0ccf021b8c984e72742b..79d2224aad6f5465edf9e207f6f220970f3b0574 100644 (file)
@@ -19,7 +19,7 @@ pub fn foo(value: *const X) -> *const X {
 }
 
 static foo: *const Y::X = Y::foo(Y::x as *const Y::X);
-//~^ ERROR the trait `std::marker::Sync` is not implemented for the type
+//~^ ERROR `*const usize : std::marker::Sync` is not satisfied
 //~| ERROR cannot refer to other statics by value, use the address-of operator or a constant instead
 //~| ERROR E0015
 
index e079ef1ec12fabcd4ce561c0eb11aeaab3a57993..edd9b6e0c066edde6ad29642bf76422e79ac5d8d 100644 (file)
@@ -14,5 +14,5 @@
 fn main() {
     // FIXME (#22405): Replace `Box::new` with `box` here when/if possible.
     (|| Box::new(*(&[0][..])))();
-    //~^ ERROR the trait `std::marker::Sized` is not implemented for the type `[_]`
+    //~^ ERROR `[_] : std::marker::Sized` is not satisfied
 }
index 4b53d84f305543cc9f98748b37cba13d9f988b27..1bb3b794135238797fdb670cff6da72a704d095a 100644 (file)
@@ -17,6 +17,6 @@ impl !Sync for Foo {}
 
 static FOO: usize = 3;
 static BAR: Foo = Foo;
-//~^ ERROR: the trait `std::marker::Sync` is not implemented
+//~^ ERROR: `Foo : std::marker::Sync` is not satisfied
 
 fn main() {}
index 03a165f18dec79f510df97c889e8311ea76e8d37..6b40811bf04f8934150b9304954bcd41a609bd1c 100644 (file)
@@ -12,7 +12,7 @@ pub trait AbstractRenderer {}
 
 fn _create_render(_: &()) ->
     AbstractRenderer
-//~^ ERROR: the trait `std::marker::Sized` is not implemented
+//~^ ERROR: `AbstractRenderer + 'static : std::marker::Sized` is not satisfied
 {
     match 0 {
         _ => unimplemented!()
index a662e9ca98ee812086e338e874234fd0a00a1f91..5318b18be5c7ffdf034eb183df17b97d99e86c07 100644 (file)
@@ -9,7 +9,7 @@
 // except according to those terms.
 
 fn add_state(op: <isize as HasState>::State) {
-//~^ ERROR the trait `HasState` is not implemented for the type `isize`
+//~^ ERROR `isize : HasState` is not satisfied
 }
 
 trait HasState {
index 11083453d0518bb8b5144c0e68ce29f38f0a798b..2742162de531e08210563cd83aae949f424ad8d6 100644 (file)
@@ -11,7 +11,7 @@
 type FuncType<'f> = Fn(&isize) -> isize + 'f;
 
 fn ho_func(f: Option<FuncType>) {
-    //~^ ERROR: the trait `std::marker::Sized` is not implemented for the type
+    //~^ ERROR: `for<'r> std::ops::Fn(&'r isize) -> isize : std::marker::Sized` is not satisfied
 }
 
 fn main() {}
index 8c75d4680faebd7fbeef1258fd5a38442053b2e9..f37693d8a584ec8c50e44d35dbc75fd3018bb61e 100644 (file)
@@ -18,5 +18,5 @@ fn assert_clone<T>() where T : Clone { }
 
 fn main() {
     assert_clone::<foo::core::sync::atomic::AtomicBool>();
-    //~^ ERROR the trait `foo::core::clone::Clone` is not implemented for the type `foo::core::
+    //~^ ERROR `foo::core::sync::atomic::AtomicBool : foo::core::clone::Clone` is not satisfied
 }
index c73a17350648bfba823679cd75eb677bb969c4b1..c8d7bcaecf93319501282036896c52dd3f159e65 100644 (file)
@@ -16,5 +16,5 @@ fn assert_clone<T>() where T : Clone { }
 
 fn main() {
     assert_clone::<bar::sync::atomic::AtomicBool>();
-    //~^ ERROR the trait `bar::clone::Clone` is not implemented for the type `bar::sync::atomic::
+    //~^ ERROR `bar::sync::atomic::AtomicBool : bar::clone::Clone` is not satisfied
 }
index 0ef7747c8a84f124c4310cd9b4fe825c29053a0d..c0252deda24ce7f31b780a0ce1f12d13bbc75123 100644 (file)
@@ -20,5 +20,5 @@ fn assert_clone<T>() where T : Clone { }
 
 fn main() {
     assert_clone::<foo::core::sync::atomic::AtomicBool>();
-    //~^ ERROR the trait `core::clone::Clone` is not implemented for the type `core::sync::atomic::
+    //~^ ERROR `core::sync::atomic::AtomicBool : core::clone::Clone` is not satisfied
 }
index 23b2532639bc8ad3ded31f0ca94f16182f44cc00..a54fc0a314b61a4859b75806340fb48ac11f2a38 100644 (file)
@@ -15,7 +15,7 @@ trait From<Src> {
 }
 
 trait To {
-    fn to<Dst>(  //~ ERROR the trait `std::marker::Sized` is not implemented
+    fn to<Dst>(  //~ ERROR `Self : std::marker::Sized` is not satisfied
         self
     ) -> <Dst as From<Self>>::Result where Dst: From<Self> {
         From::from(self)
index c81bcb828248f88cf51d601c6ef7388e746a900c..5e60e2a36f62362edac5259a1c2310acf91b618c 100644 (file)
@@ -13,5 +13,5 @@ struct X { x: i32 }
 fn main() {
     let mut b: Vec<X> = vec![];
     b.sort();
-    //~^ ERROR the trait `std::cmp::Ord` is not implemented for the type `X`
+    //~^ ERROR `X : std::cmp::Ord` is not satisfied
 }
index c0eea477775b69876c02ba210a375fb3c536bb53..2634370fe902af293dcbc0442fe240b4db25c9cd 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 `std::marker::Sized` is not implemented for the type `std::iter::Iterator
+//~^ ERROR `std::iter::Iterator<Item=&mut u8> : std::marker::Sized` is not satisfied
 }
 
 fn main() {}
index f25f8721675364a4dd2032db53f8ff6082bad625..7d9ae0543c752aae2c1f00d93e7e980378601e0b 100644 (file)
@@ -16,6 +16,6 @@ fn hash<T>(&self, _: T) {}
 
 #[derive(Hash)]
 struct Foo(Bar);
-//~^ error: the trait `std::hash::Hash` is not implemented for the type `Bar`
+//~^ error: `Bar : std::hash::Hash` is not satisfied
 
 fn main() {}
index 8ea63fdf1762d5b3e891cefbb6e58d6cb4cd2a9c..452ae5df40a9a97d2614aedd55c6bd6c516a6281 100644 (file)
@@ -32,7 +32,7 @@ fn main() {
     let f1 = Bar;
 
     f1.foo(1usize);
-    //~^ error: the trait `Foo<usize>` is not implemented for the type `Bar`
+    //~^ error: the predicate `Bar : Foo<usize>` is not satisfied
     //~| help: the following implementations were found:
     //~| help:   <Bar as Foo<i32>>
     //~| help:   <Bar as Foo<u8>>
index 9460ac19596e1cae8f0977360b9a7e5258e62f63..8f52004f598b8b03baa2df5a2c3ea31e34923430 100644 (file)
@@ -36,7 +36,7 @@ fn main() {
     let f1 = Bar;
 
     f1.foo(1usize);
-    //~^ error: the trait `Foo<usize>` is not implemented for the type `Bar`
+    //~^ error: the predicate `Bar : Foo<usize>` is not satisfied
     //~| help: the following implementations were found:
     //~| help:   <Bar as Foo<i8>>
     //~| help:   <Bar as Foo<i16>>
index e535567c52e3bc11ac77a3b34bf2644da6169765..2f0611a2086e740d7f38d2596b38b21afd85b964 100644 (file)
@@ -17,5 +17,5 @@ fn foo<T: Send>() {}
 
 fn main() {
     foo::<HashMap<Rc<()>, Rc<()>>>();
-    //~^ ERROR: the trait `std::marker::Send` is not implemented for the type `std::rc::Rc<()>`
+    //~^ ERROR: `std::rc::Rc<()> : std::marker::Send` is not satisfied
 }
index a72839347105a6714cb6db35f55f29f29a0dcf48..29bef8c966a4cfd33b7ccddc4db97d08a153e242 100644 (file)
@@ -14,7 +14,7 @@ fn main() {
     let ptr: *mut () = 0 as *mut _;
     let _: &mut Fn() = unsafe {
         &mut *(ptr as *mut Fn())
-        //~^ ERROR the trait `std::ops::Fn<()>` is not implemented
-        //~| ERROR the trait `std::ops::FnOnce<()>` is not implemented
+        //~^ ERROR `() : std::ops::Fn<()>` is not satisfied
+        //~| ERROR `() : std::ops::FnOnce<()>` is not satisfied
     };
 }
index aa7fa82fa29ba843654586c2f5ad14681770ddfd..402b9a04496e9a4aeaa73652ca9bfd1cbfb905f3 100644 (file)
@@ -22,6 +22,6 @@ fn add(self, rhs : RHS) -> Bob {}
 
 fn main() {
   let b = Bob + 3.5;
-  b + 3 //~ ERROR: is not implemented
+  b + 3 //~ ERROR E0277
   //~^ ERROR: mismatched types
 }
index 40f3b72849612daef711869ec38ed0661fcb07ba..9d0b559d13d36c9662e66672636139833d3ac469 100644 (file)
@@ -17,5 +17,5 @@ fn do_fold<B, F: InOut<B, Out=B>>(init: B, f: F) {}
 fn bot<T>() -> T { loop {} }
 
 fn main() {
-    do_fold(bot(), ()); //~ ERROR is not implemented for the type `()`
+    do_fold(bot(), ()); //~ ERROR `() : InOut<_>` is not satisfied
 }
index d81abd417f11f59e5c2b94cb2028e42cc744a036..aac282370c6466f6066f8017810601bcd8de5a21 100644 (file)
 
 fn main() {
     let _ = Iterator::next(&mut ());
-    //~^ ERROR the trait `std::iter::Iterator` is not implemented
+    //~^ ERROR `() : std::iter::Iterator` is not satisfied
 
     for _ in false {}
-    //~^ ERROR the trait `std::iter::Iterator` is not implemented
+    //~^ ERROR `bool : std::iter::Iterator` is not satisfied
 
     let _ = Iterator::next(&mut ());
-    //~^ ERROR the trait `std::iter::Iterator` is not implemented
+    //~^ ERROR `() : std::iter::Iterator` is not satisfied
 
     other()
 }
@@ -25,11 +25,11 @@ pub fn other() {
     // check errors are still reported globally
 
     let _ = Iterator::next(&mut ());
-    //~^ ERROR the trait `std::iter::Iterator` is not implemented
+    //~^ ERROR `() : std::iter::Iterator` is not satisfied
 
     let _ = Iterator::next(&mut ());
-    //~^ ERROR the trait `std::iter::Iterator` is not implemented
+    //~^ ERROR `() : std::iter::Iterator` is not satisfied
 
     for _ in false {}
-    //~^ ERROR the trait `std::iter::Iterator` is not implemented
+    //~^ ERROR `bool : std::iter::Iterator` is not satisfied
 }
index a96eb0e721bd9eb97a0287d86eeffe56c92c4e07..118644ef2cb60706fb51526042e1a1403bac2c9c 100644 (file)
@@ -11,6 +11,6 @@
 trait I {}
 type K = I+'static;
 
-fn foo(_x: K) {} //~ ERROR: the trait `std::marker::Sized` is not implemented
+fn foo(_x: K) {} //~ ERROR: `I + 'static : std::marker::Sized` is not satisfied
 
 fn main() {}
index cc6c797c766197755d4b7b7d8f3e5e1612a40003..0058d5af62e4ee80c9209fef19f60ac2b433b78e 100644 (file)
@@ -15,8 +15,8 @@ struct Struct {
 }
 
 fn new_struct(r: A+'static)
-    -> Struct { //~^  ERROR the trait `std::marker::Sized` is not implemented
-    //~^ ERROR the trait `std::marker::Sized` is not implemented
+    -> Struct { //~^  ERROR `A + 'static : std::marker::Sized` is not satisfied
+    //~^ ERROR `A + 'static : std::marker::Sized` is not satisfied
     Struct { r: r }
 }
 
index 1293bf22b47defcaaffe74fb57da9c939bc43993..c676c95ad25ea3f064401ffb4767597577a67693 100644 (file)
@@ -34,5 +34,5 @@ struct A {
 
 fn main() {
     let a = A {v: box B{v: None} as Box<Foo+Send>};
-    //~^ ERROR the trait `std::marker::Send` is not implemented
+    //~^ ERROR `std::rc::Rc<std::cell::RefCell<A>> : std::marker::Send` is not satisfied
 }
index 726f789983d3cc8a5801e4086bd8fd10a164ff4e..8d4ebbe720717cd94a1400ae50eb99beeb38f6b1 100644 (file)
@@ -16,6 +16,6 @@
 // Regression test for issue 7364
 static boxed: Box<RefCell<isize>> = box RefCell::new(0);
 //~^ ERROR allocations are not allowed in statics
-//~| ERROR the trait `std::marker::Sync` is not implemented for the type
+//~| ERROR `std::cell::RefCell<isize> : std::marker::Sync` is not satisfied
 
 fn main() { }
index 4bc941628aad9e5abbb6d55af16b3aa843e3b660..08b4e1a45f3368669be85be0838ca9763c63ca8d 100644 (file)
@@ -34,14 +34,14 @@ fn test<'a,T,U:Copy>(_: &'a isize) {
     assert_copy::<&'a [isize]>();
 
     // ...unless they are mutable
-    assert_copy::<&'static mut isize>(); //~ ERROR `std::marker::Copy` is not implemented
-    assert_copy::<&'a mut isize>();  //~ ERROR `std::marker::Copy` is not implemented
+    assert_copy::<&'static mut isize>(); //~ ERROR : std::marker::Copy` is not satisfied
+    assert_copy::<&'a mut isize>();  //~ ERROR : std::marker::Copy` is not satisfied
 
     // boxes are not ok
-    assert_copy::<Box<isize>>();   //~ ERROR `std::marker::Copy` is not implemented
-    assert_copy::<String>();   //~ ERROR `std::marker::Copy` is not implemented
-    assert_copy::<Vec<isize> >(); //~ ERROR `std::marker::Copy` is not implemented
-    assert_copy::<Box<&'a mut isize>>(); //~ ERROR `std::marker::Copy` is not implemented
+    assert_copy::<Box<isize>>();   //~ ERROR : std::marker::Copy` is not satisfied
+    assert_copy::<String>();   //~ ERROR : std::marker::Copy` is not satisfied
+    assert_copy::<Vec<isize> >(); //~ ERROR : std::marker::Copy` is not satisfied
+    assert_copy::<Box<&'a mut isize>>(); //~ ERROR : std::marker::Copy` is not satisfied
 
     // borrowed object types are generally ok
     assert_copy::<&'a Dummy>();
@@ -49,11 +49,11 @@ fn test<'a,T,U:Copy>(_: &'a isize) {
     assert_copy::<&'static (Dummy+Copy)>();
 
     // owned object types are not ok
-    assert_copy::<Box<Dummy>>(); //~ ERROR `std::marker::Copy` is not implemented
-    assert_copy::<Box<Dummy+Copy>>(); //~ ERROR `std::marker::Copy` is not implemented
+    assert_copy::<Box<Dummy>>(); //~ ERROR : std::marker::Copy` is not satisfied
+    assert_copy::<Box<Dummy+Copy>>(); //~ ERROR : std::marker::Copy` is not satisfied
 
     // mutable object types are not ok
-    assert_copy::<&'a mut (Dummy+Copy)>();  //~ ERROR `std::marker::Copy` is not implemented
+    assert_copy::<&'a mut (Dummy+Copy)>();  //~ ERROR : std::marker::Copy` is not satisfied
 
     // unsafe ptrs are ok
     assert_copy::<*const isize>();
@@ -71,10 +71,10 @@ fn test<'a,T,U:Copy>(_: &'a isize) {
     assert_copy::<MyStruct>();
 
     // structs containing non-POD are not ok
-    assert_copy::<MyNoncopyStruct>(); //~ ERROR `std::marker::Copy` is not implemented
+    assert_copy::<MyNoncopyStruct>(); //~ ERROR : std::marker::Copy` is not satisfied
 
     // ref counted types are not ok
-    assert_copy::<Rc<isize>>();   //~ ERROR `std::marker::Copy` is not implemented
+    assert_copy::<Rc<isize>>();   //~ ERROR : std::marker::Copy` is not satisfied
 }
 
 pub fn main() {
index c5c50789e4005300660dcef5c26c97f6de7beeaa..cf51e9bd60817b7c7bf1e28d396d512810e5807f 100644 (file)
@@ -21,5 +21,5 @@ fn take_param<T:Foo>(foo: &T) { }
 fn main() {
     let x: Box<_> = box 3;
     take_param(&x);
-    //~^ ERROR the trait `std::marker::Copy` is not implemented
+    //~^ ERROR `Box<_> : std::marker::Copy` is not satisfied
 }
index a59c243f12a54eba477370d914324d57fdc4f5d6..53ad4d1163bfad59b0da9ec0c786c252617f6407 100644 (file)
@@ -26,13 +26,13 @@ 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 the trait `std::marker::Send` is not implemented
+    //~^ ERROR : std::marker::Send` is not satisfied
 }
 
 fn g<T>(val: T) {
     let t: S<T> = S(marker::PhantomData);
     let a: &Gettable<T> = &t;
-    //~^ ERROR the trait `std::marker::Send` is not implemented
+    //~^ ERROR : std::marker::Send` is not satisfied
 }
 
 fn foo<'a>() {
@@ -44,7 +44,7 @@ fn foo<'a>() {
 fn foo2<'a>() {
     let t: Box<S<String>> = box S(marker::PhantomData);
     let a = t as Box<Gettable<String>>;
-    //~^ ERROR the trait `std::marker::Copy` is not implemented
+    //~^ ERROR : std::marker::Copy` is not satisfied
 }
 
 fn foo3<'a>() {
@@ -52,7 +52,7 @@ fn foo3<'a>() {
 
     let t: Box<S<Foo>> = box S(marker::PhantomData);
     let a: Box<Gettable<Foo>> = t;
-    //~^ ERROR the trait `std::marker::Copy` is not implemented
+    //~^ ERROR : std::marker::Copy` is not satisfied
 }
 
 fn main() { }
index a207b8721224b30564d66d24a25700a951d6cb8f..dd77c2c138f4622df9b7a129959b05fb95e37d46 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 implemented
+    //~^ ERROR : std::marker::Send` is not satisfied
 }
index 7525ff932bbd985d9712b321cab62944472c4315..bd0e5642b9ccddd5813b91f7607260240daefae2 100644 (file)
@@ -20,11 +20,11 @@ trait Message : Send { }
 
 fn object_ref_with_static_bound_not_ok() {
     assert_send::<&'static (Dummy+'static)>();
-    //~^ ERROR the trait `std::marker::Sync` is not implemented
+    //~^ ERROR : std::marker::Sync` is not satisfied
 }
 
 fn box_object_with_no_bound_not_ok<'a>() {
-    assert_send::<Box<Dummy>>(); //~ ERROR the trait `std::marker::Send` is not implemented
+    assert_send::<Box<Dummy>>(); //~ ERROR : std::marker::Send` is not satisfied
 }
 
 fn object_with_send_bound_ok() {
index 0e737e1b1627917b2a00d194442a61af4db33411..da56fccde2d4ab93f252a185beb66a4253e6b45e 100644 (file)
@@ -18,7 +18,7 @@ trait Dummy { }
 // careful with object types, who knows what they close over...
 fn test51<'a>() {
     assert_send::<&'a Dummy>();
-    //~^ ERROR the trait `std::marker::Sync` is not implemented
+    //~^ ERROR : std::marker::Sync` is not satisfied
 }
 fn test52<'a>() {
     assert_send::<&'a (Dummy+Sync)>();
@@ -37,7 +37,7 @@ fn test61() {
 // them not ok
 fn test_71<'a>() {
     assert_send::<Box<Dummy+'a>>();
-    //~^ ERROR the trait `std::marker::Send` is not implemented
+    //~^ ERROR : std::marker::Send` is not satisfied
 }
 
 fn main() { }
index 7bc86df57394ea430ff64e460728610600dc1f5c..e52a6e12efc96bf66b80e956705d3dc5275821d0 100644 (file)
@@ -14,11 +14,11 @@ fn assert_send<T:Send>() { }
 trait Dummy { }
 
 fn test50() {
-    assert_send::<&'static Dummy>(); //~ ERROR the trait `std::marker::Sync` is not implemented
+    assert_send::<&'static Dummy>(); //~ ERROR : std::marker::Sync` is not satisfied
 }
 
 fn test53() {
-    assert_send::<Box<Dummy>>(); //~ ERROR the trait `std::marker::Send` is not implemented
+    assert_send::<Box<Dummy>>(); //~ ERROR : std::marker::Send` is not satisfied
 }
 
 // ...unless they are properly bounded
index d7116930fb479517257d9b67bde9a04d1e992c04..583381a1c28f5b23fc9753f8e2ef25f9b1dde529 100644 (file)
@@ -19,7 +19,7 @@ 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 implemented
+    assert_send::<Box<*mut u8>>(); //~ ERROR : std::marker::Send` is not satisfied
 }
 
 fn main() { }
index bce765a986a22fccc6fc206abe1c1e0e04b6c292..c7eca74f7800c24a4843527bc07c11cc972213cd 100644 (file)
@@ -14,7 +14,7 @@ fn assert_send<T:Send>() { }
 
 fn test71<'a>() {
     assert_send::<*mut &'a isize>();
-    //~^ ERROR the trait `core::marker::Send` is not implemented for the type
+    //~^ ERROR `*mut &'a isize : core::marker::Send` is not satisfied
 }
 
 fn main() {
index e298a0f62cd81882ab9e47920f4ac74347b58e82..b2957a71a56c795d117731315af47b6d3651bec3 100644 (file)
@@ -28,5 +28,5 @@ fn main() {
     let x: Box<Map<isize, isize>> = x;
     // FIXME (#22405): Replace `Box::new` with `box` here when/if possible.
     let y: Box<Map<usize, isize>> = Box::new(x);
-    //~^ ERROR the trait `Map<usize, isize>` is not implemented
+    //~^ ERROR `Box<Map<isize, isize>> : Map<usize, isize>` is not satisfied
 }
index a12a3615bc91ad7acc71d8855ef8f665eacc5753..a24a91a4d540a9d7d0aec56acb288fc2b932432e 100644 (file)
@@ -15,5 +15,5 @@ fn f<T: Sync>(_: T) {}
 fn main() {
     let x = RefCell::new(0);
     f(x);
-    //~^ ERROR `std::marker::Sync` is not implemented
+    //~^ ERROR `std::cell::RefCell<_> : std::marker::Sync` is not satisfied
 }
index a7e751e7ea95baf38914500b280190d6e3fd9f76..bb2fdbc555b7dfd47bc2276bd7950541bd8db189 100644 (file)
@@ -24,5 +24,5 @@ fn bar<T: Sync>(_: T) {}
 
 fn main() {
     let x = Foo::A(NoSync);
-    bar(&x); //~ ERROR the trait `std::marker::Sync` is not implemented
+    bar(&x); //~ ERROR `NoSync : std::marker::Sync` is not satisfied
 }
index 2bb0343400c27d911a787fa534deebb1de3d6faf..81d174256ee2a0d24d9a48ab8086da4047690371 100644 (file)
@@ -33,7 +33,7 @@ fn foo(x: Port<()>) -> foo {
     let x = foo(Port(Rc::new(())));
 
     thread::spawn(move|| {
-        //~^ ERROR `std::marker::Send` is not implemented
+        //~^ ERROR `std::rc::Rc<()> : std::marker::Send` is not satisfied
         let y = x;
         println!("{:?}", y);
     });
index 7505bf69c83108c74d9045af443d64e5a12b9bf9..966d932f2a41a4048ab26ffee511214ac3ff9291 100644 (file)
@@ -24,5 +24,5 @@ fn bar<T: Send>(_: T) {}
 fn main() {
     let x = Foo::A(NoSend);
     bar(x);
-    //~^ ERROR `std::marker::Send` is not implemented
+    //~^ ERROR `NoSend : std::marker::Send` is not satisfied
 }
index 23926394a2358f174110812680795e4da276c82f..b6c7e1ad05af4559572f093e9ea8bee106fead09 100644 (file)
@@ -15,5 +15,5 @@ fn bar<T: Send>(_: T) {}
 fn main() {
     let x = Rc::new(5);
     bar(x);
-    //~^ ERROR `std::marker::Send` is not implemented
+    //~^ ERROR `std::rc::Rc<_> : std::marker::Send` is not satisfied
 }
index 14e18558a717c5877a797cb84a67d5174dc05b98..037753e6c5fa6965913f2ac96a5a556b839e057f 100644 (file)
@@ -23,5 +23,5 @@ fn bar<T: Send>(_: T) {}
 fn main() {
     let x = Foo { a: 5 };
     bar(x);
-    //~^ ERROR the trait `std::marker::Send` is not implemented
+    //~^ ERROR `Foo : std::marker::Send` is not satisfied
 }
index c9a3084a73e620cdf4f9c275a8be000e1700691c..be52dd41826416c9f0013c8edffc2c66b84015fd 100644 (file)
@@ -22,5 +22,5 @@ fn bar<T: Sync>(_: T) {}
 fn main() {
     let x = Foo::A(NoSync);
     bar(x);
-    //~^ ERROR the trait `std::marker::Sync` is not implemented
+    //~^ ERROR `NoSync : std::marker::Sync` is not satisfied
 }
index 74549286f7b57db170a3b44fd46e5511b444b5be..944bcb48ab05ff2ce1fa0f16a8099071b48bfa63 100644 (file)
@@ -20,5 +20,5 @@ fn bar<T: Sync>(_: T) {}
 fn main() {
     let x = Foo { a: 5 };
     bar(x);
-    //~^ ERROR the trait `std::marker::Sync` is not implemented
+    //~^ ERROR `Foo : std::marker::Sync` is not satisfied
 }
index 50a69543f7d04fbfaa77a0d4cea3ef2d46f6457e..e5de03a08486c5854685bcb95449c1db11e7071e 100644 (file)
@@ -18,5 +18,5 @@
 fn assert<T: RecoverSafe + ?Sized>() {}
 
 fn main() {
-    assert::<Arc<RefCell<i32>>>(); //~ ERROR: is not implemented
+    assert::<Arc<RefCell<i32>>>(); //~ ERROR E0277
 }
index 1fa76c21f853d1923b7fad1067cfe1a0d6c0748b..0301c8dd935c7fe71876b226c9d18041028c5959 100644 (file)
@@ -17,5 +17,5 @@
 fn assert<T: RecoverSafe + ?Sized>() {}
 
 fn main() {
-    assert::<*const UnsafeCell<i32>>(); //~ ERROR: is not implemented
+    assert::<*const UnsafeCell<i32>>(); //~ ERROR E0277
 }
index f06464c5b1ab8067ea5664d7553d661a9302a5fa..fd0f830a17d877ec79beb9383dd85de6a50e9de2 100644 (file)
@@ -16,5 +16,5 @@
 fn assert<T: RecoverSafe + ?Sized>() {}
 
 fn main() {
-    assert::<&mut i32>(); //~ ERROR: RecoverSafe` is not implemented
+    assert::<&mut i32>(); //~ ERROR: RecoverSafe` is not satisfied
 }
index c9648a18be5f21ef6f9b653e440a0e906af89862..3955e3a040c5f3159289a748d16060b969c12b9b 100644 (file)
@@ -16,19 +16,19 @@ fn test<T: Sync>() {}
 
 fn main() {
     test::<Cell<i32>>();
-    //~^ ERROR marker::Sync` is not implemented for the type `std::cell::Cell<i32>`
+    //~^ ERROR `std::cell::Cell<i32> : std::marker::Sync` is not satisfied
     test::<RefCell<i32>>();
-    //~^ ERROR marker::Sync` is not implemented for the type `std::cell::RefCell<i32>`
+    //~^ ERROR `std::cell::RefCell<i32> : std::marker::Sync` is not satisfied
 
     test::<Rc<i32>>();
-    //~^ ERROR marker::Sync` is not implemented for the type `std::rc::Rc<i32>`
+    //~^ ERROR `std::rc::Rc<i32> : std::marker::Sync` is not satisfied
     test::<Weak<i32>>();
-    //~^ ERROR marker::Sync` is not implemented for the type `std::rc::Weak<i32>`
+    //~^ ERROR `std::rc::Weak<i32> : std::marker::Sync` is not satisfied
 
     test::<Receiver<i32>>();
-    //~^ ERROR marker::Sync` is not implemented for the type `std::sync::mpsc::Receiver<i32>`
+    //~^ ERROR `std::sync::mpsc::Receiver<i32> : std::marker::Sync` is not satisfied
     test::<Sender<i32>>();
-    //~^ ERROR marker::Sync` is not implemented for the type `std::sync::mpsc::Sender<i32>`
+    //~^ ERROR `std::sync::mpsc::Sender<i32> : std::marker::Sync` is not satisfied
     test::<SyncSender<i32>>();
-    //~^ ERROR marker::Sync` is not implemented for the type `std::sync::mpsc::SyncSender<i32>`
+    //~^ ERROR `std::sync::mpsc::SyncSender<i32> : std::marker::Sync` is not satisfied
 }
index efbf3782f9796a4b34ed979e293f60837032e67e..6673a87e9e4e47362bfa77db2768e6320352a1d6 100644 (file)
@@ -14,5 +14,5 @@
 trait Foo {}
 fn take_foo<F:Foo>(f: F) {}
 fn take_object(f: Box<Foo>) { take_foo(f); }
-//~^ ERROR the trait `Foo` is not implemented
+//~^ ERROR `Box<Foo> : Foo` is not satisfied
 fn main() {}
index 92def18f824147cf0d76e59bf347a766adc24cdb..0006b29979cad31ba7d47090bacbd7e6b2f77391 100644 (file)
@@ -31,11 +31,11 @@ struct Guard<'a, T: 'a> {
 fn is_zen<T: Zen>(_: T) {}
 
 fn not_sync<T>(x: Guard<T>) {
-    is_zen(x)  //~ error: the trait `std::marker::Sync` is not implemented for the type `T`
+    is_zen(x)  //~ error: `T : std::marker::Sync` is not satisfied
 }
 
 fn nested_not_sync<T>(x: Nested<Guard<T>>) {
-    is_zen(x)  //~ error: the trait `std::marker::Sync` is not implemented for the type `T`
+    is_zen(x)  //~ error: `T : std::marker::Sync` is not satisfied
 }
 
 fn main() {}
index 46d7666dabc565e62c2bb904383492fa2d44d842..25b7465a1641f004079c3793bce4c3bf7b4d4ccd 100644 (file)
@@ -22,6 +22,6 @@ pub fn main() {
     // Unsized type.
     let arr: &[_] = &[1, 2, 3];
     let range = *arr..;
-    //~^ ERROR the trait `std::marker::Sized` is not implemented
-    //~| ERROR the trait `std::marker::Sized` is not implemented
+    //~^ ERROR `[_] : std::marker::Sized` is not satisfied
+    //~| ERROR `[_] : std::marker::Sized` is not satisfied
 }
index 9cf0d252c2d55ce2d7af9471ef6d0b3f1c09b8e2..7cac3f41d546d712b490f3e090e41dd3adef2134 100644 (file)
@@ -24,7 +24,7 @@ trait Get {
 fn is_reflect<T:Reflect>() { }
 
 fn a<T>() {
-    is_reflect::<Box<Get<Output=T>>>(); //~ ERROR not implemented
+    is_reflect::<Box<Get<Output=T>>>(); //~ ERROR E0277
 }
 
 fn ok_a<T: Reflect>() {
index 9f074667feb3dc67a80d60340c6556728fb06ec0..476b498ae6492157b8b270ffe9158613e9317413 100644 (file)
@@ -23,7 +23,7 @@ trait Get<T> {
 fn is_reflect<T:Reflect>() { }
 
 fn a<T>() {
-    is_reflect::<T>(); //~ ERROR not implemented
+    is_reflect::<T>(); //~ ERROR E0277
 }
 
 fn ok_a<T: Reflect>() {
@@ -31,7 +31,7 @@ fn ok_a<T: Reflect>() {
 }
 
 fn b<T>() {
-    is_reflect::<Box<Get<T>>>(); //~ ERROR not implemented
+    is_reflect::<Box<Get<T>>>(); //~ ERROR E0277
 }
 
 fn ok_b<T: Reflect>() {
@@ -39,7 +39,7 @@ fn ok_b<T: Reflect>() {
 }
 
 fn c<T>() {
-    is_reflect::<Box<Get<Struct<T>>>>(); //~ ERROR not implemented
+    is_reflect::<Box<Get<Struct<T>>>>(); //~ ERROR E0277
 }
 
 fn main() {
index 701aa5b40bc0a6314b50e04b28a6975c9a95280a..fdd569e2c1b3fe9bac4540d766b8e7f196b0c554 100644 (file)
@@ -22,7 +22,7 @@
 fn is_reflect<T:Reflect>() { }
 
 fn c<T>() {
-    is_reflect::<Struct<T>>(); //~ ERROR not implemented
+    is_reflect::<Struct<T>>(); //~ ERROR E0277
 }
 
 fn ok_c<T: Reflect>() {
@@ -30,7 +30,7 @@ fn ok_c<T: Reflect>() {
 }
 
 fn d<T>() {
-    is_reflect::<(i32, T)>(); //~ ERROR not implemented
+    is_reflect::<(i32, T)>(); //~ ERROR E0277
 }
 
 fn main() {
index 0a55fe9f942792cd0fdc68c6b6c2d134d4e10c1a..3553d0dab312694e932e8a6c10a0c11bb0184884 100644 (file)
@@ -25,5 +25,5 @@ fn drop(&mut self) {
 fn main() {
     let a = Foo { x: 3 };
     let _ = [ a; 5 ];
-    //~^ ERROR the trait `std::marker::Copy` is not implemented for the type `Foo`
+    //~^ ERROR `Foo : std::marker::Copy` is not satisfied
 }
index 6af731caaba409c37971dd9811f6a31c359ce20a..61fa3cbfe69e00998ebdeeb28be8fad263df8547 100644 (file)
@@ -10,5 +10,5 @@
 
 pub fn main() {
     let s: &str = "hello";
-    let c: u8 = s[4]; //~ ERROR the trait `std::ops::Index<_>` is not implemented
+    let c: u8 = s[4]; //~ ERROR `str : std::ops::Index<_>` is not satisfied
 }
index 1fbdb3fddce6df67c3e0312a8b52944380bf6454..f372a17e045c02f3d4caa7ca9deffc7d90a8b266 100644 (file)
@@ -12,11 +12,11 @@ fn bot<T>() -> T { loop {} }
 
 fn mutate(s: &mut str) {
     s[1..2] = bot();
-    //~^ ERROR `std::marker::Sized` is not implemented for the type `str`
-    //~| ERROR `std::marker::Sized` is not implemented for the type `str`
+    //~^ ERROR `str : std::marker::Sized` is not satisfied
+    //~| ERROR `str : std::marker::Sized` is not satisfied
     s[1usize] = bot();
-    //~^ ERROR `std::ops::Index<usize>` is not implemented for the type `str`
-    //~| ERROR `std::ops::IndexMut<usize>` is not implemented for the type `str`
+    //~^ ERROR `str : std::ops::Index<usize>` is not satisfied
+    //~| ERROR `str : std::ops::IndexMut<usize>` is not satisfied
 }
 
 pub fn main() {}
index 6d1a3ee79401986ec553d3fe0638a7e330de4d29..a11df776e06d3ba1e2dc6f0add3390d80a92da6b 100644 (file)
@@ -16,5 +16,5 @@ fn test_send<S: Send>() {}
 
 pub fn main() {
     test_send::<rand::ThreadRng>();
-    //~^ ERROR `std::marker::Send` is not implemented
+    //~^ ERROR : std::marker::Send` is not satisfied
 }
index f70b2a90474256ae1e404ed6a6e1f4bb209e73dd..0a771ecf63f18a0b079d9bd2cdf962f99755b5be 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 `std::marker::Sized` is not implemented
+    //~^ ERROR `Foo + Send + 'static : std::marker::Sized` is not satisfied
 }
 
 fn main() { }
index dbfda61f5525a41a46283f78709a80006f54bac4..6a271a7b7497ffd84493874bf966c2c6b19b4c05 100644 (file)
@@ -21,10 +21,10 @@ enum Bar<T:Trait> {
 }
 
 fn explode(x: Foo<u32>) {}
-//~^ ERROR not implemented
+//~^ ERROR E0277
 
 fn kaboom(y: Bar<f32>) {}
-//~^ ERROR not implemented
+//~^ ERROR E0277
 
 fn main() {
 }
index c647dd38ee38a5aba56257c845e68aa53045cd26..77abe6f7f7473c084a0886d80ac66d9df2af839c 100644 (file)
@@ -28,7 +28,7 @@ fn whatever(&self, t: T) {}
 struct Struct;
 
 impl PolyTrait<Foo<u16>> for Struct {
-//~^ ERROR not implemented
+//~^ ERROR E0277
 }
 
 fn main() {
index 520691fbecc481b34985c4bb65c40cd6074609a1..9e680d17fb9ef5a8c865b8e1834d655f3f712109 100644 (file)
@@ -18,10 +18,10 @@ struct Foo<T:Trait> {
 
 fn main() {
     let foo = Foo {
-    //~^ ERROR not implemented
+    //~^ ERROR E0277
         x: 3
     };
 
     let baz: Foo<usize> = loop { };
-    //~^ ERROR not implemented
+    //~^ ERROR E0277
 }
index d93c9bafaef27c36c205a5e933f106810aac50f1..2b59fdcae3534a8658466f457bcca0cb277d1a79 100644 (file)
@@ -17,7 +17,7 @@ struct Foo<T:Trait> {
 }
 
 static X: Foo<usize> = Foo {
-//~^ ERROR not implemented
+//~^ ERROR E0277
     x: 1,
 };
 
index 5f95a7ca6e20455ba2959975c8228334fbee5ebd..975de00d02a33aa729057533a21374b0aaf72ef0 100644 (file)
 use trait_bounds_on_structs_and_enums_xc::{Bar, Foo, Trait};
 
 fn explode(x: Foo<usize>) {}
-//~^ ERROR not implemented
+//~^ ERROR E0277
 
 fn kaboom(y: Bar<f32>) {}
-//~^ ERROR not implemented
+//~^ ERROR E0277
 
 fn main() {
 }
index 840787022e65cc736d40a70d35087032bdc81e7e..515684bcf42d275e585186be160a0edd4ea2805f 100644 (file)
 
 fn main() {
     let foo = Foo {
-    //~^ ERROR not implemented
+    //~^ ERROR E0277
         x: 3
     };
     let bar: Bar<f64> = return;
-    //~^ ERROR not implemented
+    //~^ ERROR E0277
     let _ = bar;
 }
index e1b005b0c8533b3baf78494245c7744769ebea46..8dd38544d3c9e86baa8a94c285b702947ec01c07 100644 (file)
@@ -21,32 +21,32 @@ enum Bar<T:Trait> {
 }
 
 impl<T> Foo<T> {
-//~^ ERROR the trait `Trait` is not implemented
+//~^ ERROR `T : Trait` is not satisfied
     fn uhoh() {}
 }
 
 struct Baz {
-    a: Foo<isize>, //~ ERROR not implemented
+    a: Foo<isize>, //~ ERROR E0277
 }
 
 enum Boo {
-    Quux(Bar<usize>), //~ ERROR not implemented
+    Quux(Bar<usize>), //~ ERROR E0277
 }
 
 struct Badness<U> {
-    b: Foo<U>, //~ ERROR not implemented
+    b: Foo<U>, //~ ERROR E0277
 }
 
 enum MoreBadness<V> {
-    EvenMoreBadness(Bar<V>), //~ ERROR not implemented
+    EvenMoreBadness(Bar<V>), //~ ERROR E0277
 }
 
 struct TupleLike(
-    Foo<i32>, //~ ERROR not implemented
+    Foo<i32>, //~ ERROR E0277
 );
 
 enum Enum {
-    DictionaryLike { field: Bar<u8> }, //~ ERROR not implemented
+    DictionaryLike { field: Bar<u8> }, //~ ERROR E0277
 }
 
 fn main() {
index b25af522b2476e35759af8a255ade6225020a8c0..85c26368f9f2c24daa41a44755fe7bab5dadde47 100644 (file)
@@ -25,6 +25,6 @@ fn f(&self, x: &'static str) {
 fn main() {
     // FIXME (#22405): Replace `Box::new` with `box` here when/if possible.
     let s: Box<Trait<isize>> = Box::new(Struct { person: "Fred" });
-    //~^ ERROR the trait `Trait<isize>` is not implemented for the type `Struct`
+    //~^ ERROR `Struct : Trait<isize>` is not satisfied
     s.f(1);
 }
diff --git a/src/test/compile-fail/trait-suggest-where-clause.rs b/src/test/compile-fail/trait-suggest-where-clause.rs
new file mode 100644 (file)
index 0000000..8827ccc
--- /dev/null
@@ -0,0 +1,67 @@
+// Copyright 2016 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.
+
+use std::mem;
+
+struct Misc<T:?Sized>(T);
+
+fn check<T: Iterator, U: ?Sized>() {
+    // suggest a where-clause, if needed
+    mem::size_of::<U>();
+    //~^ ERROR `U : std::marker::Sized` is not satisfied
+    //~| HELP E0277
+    //~| HELP consider adding a `where U : std::marker::Sized` bound
+    //~| NOTE required by `std::mem::size_of`
+
+    mem::size_of::<Misc<U>>();
+    //~^ ERROR `U : std::marker::Sized` is not satisfied
+    //~| HELP E0277
+    //~| 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`
+
+    // ... even if T occurs as a type parameter
+
+    <u64 as From<T>>::from;
+    //~^ ERROR `u64 : std::convert::From<T>` is not satisfied
+    //~| HELP E0277
+    //~| HELP consider adding a `where u64 : std::convert::From<T>` bound
+    //~| NOTE required by `std::convert::From::from`
+
+    <u64 as From<<T as Iterator>::Item>>::from;
+    //~^ ERROR `u64 : std::convert::From<<T as std::iter::Iterator>::Item>` is not satisfied
+    //~| HELP E0277
+    //~| HELP consider adding a `where u64 :
+    //~| NOTE required by `std::convert::From::from`
+
+    // ... but not if there are inference variables
+
+    <Misc<_> as From<T>>::from;
+    //~^ ERROR `Misc<_> : std::convert::From<T>` is not satisfied
+    //~| HELP E0277
+    //~| NOTE required by `std::convert::From::from`
+
+    // ... and also not if the error is not related to the type
+
+    mem::size_of::<[T]>();
+    //~^ ERROR `[T] : std::marker::Sized` is not satisfied
+    //~| HELP E0277
+    //~| NOTE `[T]` does not have a constant size
+    //~| NOTE required by `std::mem::size_of`
+
+    mem::size_of::<[&U]>();
+    //~^ ERROR `[&U] : std::marker::Sized` is not satisfied
+    //~| HELP E0277
+    //~| NOTE `[&U]` does not have a constant size
+    //~| NOTE required by `std::mem::size_of`
+}
+
+fn main() {
+}
index 0eb4e230e14946cefc42adf9f93b6da7ebcd28e1..4a266dd07e6b95d03b59f0d1da392ff459a4ff1d 100644 (file)
@@ -31,8 +31,8 @@ fn dummy() {
     impl !Send for TestType {}
 
     Outer(TestType);
-    //~^ ERROR the trait `std::marker::Send` is not implemented for the type `dummy::TestType`
-    //~| ERROR the trait `std::marker::Send` is not implemented for the type `dummy::TestType`
+    //~^ ERROR `dummy::TestType : std::marker::Send` is not satisfied
+    //~| ERROR `dummy::TestType : std::marker::Send` is not satisfied
 }
 
 fn dummy1b() {
@@ -40,7 +40,7 @@ fn dummy1b() {
     impl !Send for TestType {}
 
     is_send(TestType);
-    //~^ ERROR the trait `std::marker::Send` is not implemented for the type `dummy1b::TestType`
+    //~^ ERROR `dummy1b::TestType : std::marker::Send` is not satisfied
 }
 
 fn dummy1c() {
@@ -48,7 +48,7 @@ fn dummy1c() {
     impl !Send for TestType {}
 
     is_send((8, TestType));
-    //~^ ERROR the trait `std::marker::Send` is not implemented for the type `dummy1c::TestType`
+    //~^ ERROR `dummy1c::TestType : std::marker::Send` is not satisfied
 }
 
 fn dummy2() {
@@ -56,7 +56,7 @@ fn dummy2() {
     impl !Send for TestType {}
 
     is_send(Box::new(TestType));
-    //~^ ERROR the trait `std::marker::Send` is not implemented for the type `dummy2::TestType`
+    //~^ ERROR `dummy2::TestType : std::marker::Send` is not satisfied
 }
 
 fn dummy3() {
@@ -64,7 +64,7 @@ fn dummy3() {
     impl !Send for TestType {}
 
     is_send(Box::new(Outer2(TestType)));
-    //~^ ERROR the trait `std::marker::Send` is not implemented for the type `dummy3::TestType`
+    //~^ ERROR `dummy3::TestType : std::marker::Send` is not satisfied
 }
 
 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 the trait `std::marker::Send` is not implemented for the type `main::TestType`
+    //~^ ERROR `main::TestType : std::marker::Send` is not satisfied
 }
index d61ac6f08d99d603a0136e10e5a0c545dee0e75b..244f75a35926252e44c3bdd8da5311d4b6f36af3 100644 (file)
@@ -33,21 +33,21 @@ fn same_as(&self, t: u64) -> bool { *self == (t as i64) }
 impl CompareToInts for i64 { }
 
 fn with_obj(c: &CompareToInts) -> bool {
-    c.same_as(22) //~ ERROR `CompareTo<i32>` is not implemented
+    c.same_as(22) //~ ERROR `CompareToInts : CompareTo<i32>` is not satisfied
 }
 
 fn with_trait<C:CompareToInts>(c: &C) -> bool {
-    c.same_as(22) //~ ERROR `CompareTo<i32>` is not implemented
+    c.same_as(22) //~ ERROR `C : CompareTo<i32>` is not satisfied
 }
 
 fn with_ufcs1<C:CompareToInts>(c: &C) -> bool {
-    CompareToInts::same_as(c, 22) //~ ERROR `CompareTo<i32>` is not implemented
+    CompareToInts::same_as(c, 22) //~ ERROR `CompareToInts : CompareTo<i32>` is not satisfied
 }
 
 fn with_ufcs2<C:CompareToInts>(c: &C) -> bool {
-    CompareTo::same_as(c, 22) //~ ERROR `CompareTo<i32>` is not implemented
+    CompareTo::same_as(c, 22) //~ ERROR `C : CompareTo<i32>` is not satisfied
 }
 
 fn main() {
-    assert_eq!(22_i64.same_as(22), true); //~ ERROR `CompareTo<i32>` is not implemented
+    assert_eq!(22_i64.same_as(22), true); //~ ERROR `i64 : CompareTo<i32>` is not satisfied
 }
index 71e9113603a6061a50e20fa57dd62ae06cc7022f..d07282763d85b398f44893fed97f11e6cc11640f 100644 (file)
@@ -17,13 +17,13 @@ trait Tr<T> : Sized {
 
 trait A:    Tr<Self> {
     fn test<U>(u: U) -> Self {
-        Tr::op(u)   //~ ERROR not implemented
+        Tr::op(u)   //~ ERROR E0277
     }
 }
 
 trait B<T>: Tr<T> {
     fn test<U>(u: U) -> Self {
-        Tr::op(u)   //~ ERROR not implemented
+        Tr::op(u)   //~ ERROR E0277
     }
 }
 
index 8a9d53731c545ca3788012d12d5cdc0d3a56f59a..f8342c333a3638cc7bc42e9ecb3f5d1db3e84b49 100644 (file)
@@ -16,7 +16,7 @@ trait Trait {
     fn dummy(&self) { }
 }
 fn bar<T:Trait+Send>() {
-    is_send::<T::AssocType>(); //~ ERROR not implemented
+    is_send::<T::AssocType>(); //~ ERROR E0277
 }
 
 fn is_send<T:Send>() {
index a27f7f7ebbe0f4b405d5d701bbb8309bd9de464f..93800d3907a6796a3c9f758e642ef7d33d4b0668 100644 (file)
@@ -26,5 +26,5 @@ fn main() {
     is_mytrait::<MyS>();
 
     is_mytrait::<(MyS2, MyS)>();
-    //~^ ERROR the trait `MyTrait` is not implemented for the type `MyS2`
+    //~^ ERROR `MyS2 : MyTrait` is not satisfied
 }
index 24819bb4f08d63a51f7db7752df8bfbdf14766f3..a49047524e665631a2b830e686c9db25f3b0b5a8 100644 (file)
@@ -29,5 +29,5 @@ fn main() {
     is_mytrait::<MyS>();
 
     is_mytrait::<MyS2>();
-    //~^ ERROR the trait `MyTrait` is not implemented for the type `MyS2`
+    //~^ ERROR `MyS2 : MyTrait` is not satisfied
 }
index 58519e4df7550909a39beb6d442eb0a9d95dc20b..0158cbcfcda8f9383c0a5d0a36b76c8cb98e97e1 100644 (file)
@@ -27,5 +27,5 @@ fn is_send<T: Send>() {}
 fn main() {
     is_send::<MySendable>();
     is_send::<MyNotSendable>();
-    //~^ ERROR the trait `std::marker::Send` is not implemented for the type `MyNotSendable`
+    //~^ ERROR `MyNotSendable : std::marker::Send` is not satisfied
 }
index 8d174271a369fa5776c28b7dfcad033442aaed73..6cfc9bc5f5eceb990f076350b2ef6f6e61590525 100644 (file)
@@ -43,11 +43,11 @@ fn is_sync<T: Sync>() {}
 fn main() {
     is_sync::<MySync>();
     is_sync::<MyNotSync>();
-    //~^ ERROR the trait `std::marker::Sync` is not implemented for the type `MyNotSync`
+    //~^ ERROR `MyNotSync : std::marker::Sync` is not satisfied
 
     is_sync::<MyTypeWUnsafe>();
-    //~^ ERROR the trait `std::marker::Sync` is not implemented for the type `std::cell::UnsafeCell<u8>`
+    //~^ ERROR `std::cell::UnsafeCell<u8> : std::marker::Sync` is not satisfied
 
     is_sync::<MyTypeManaged>();
-    //~^ ERROR the trait `std::marker::Sync` is not implemented for the type `Managed`
+    //~^ ERROR `Managed : std::marker::Sync` is not satisfied
 }
index 4b91d0b7a736c6f1c1f5d4b692c23fa854333894..98e617ee6659eaeb108ff6aeeab50a81059de352 100644 (file)
@@ -33,10 +33,10 @@ fn is_my_unsafe_trait<T: MyUnsafeTrait>() {}
 fn main() {
     is_my_trait::<ThisImplsTrait>();
     is_my_trait::<ThisImplsUnsafeTrait>();
-    //~^ ERROR the trait `MyTrait` is not implemented for the type `ThisImplsUnsafeTrait`
+    //~^ ERROR `ThisImplsUnsafeTrait : MyTrait` is not satisfied
 
     is_my_unsafe_trait::<ThisImplsTrait>();
-    //~^ ERROR the trait `MyUnsafeTrait` is not implemented for the type `ThisImplsTrait`
+    //~^ ERROR `ThisImplsTrait : MyUnsafeTrait` is not satisfied
 
     is_my_unsafe_trait::<ThisImplsUnsafeTrait>();
 }
index c67fc92313c3a58d29e714db80e0b8003cb55419..109b2ed24ea13dc499f6657ed3a531ce89f3e294 100644 (file)
@@ -27,5 +27,5 @@ impl Signed for i32 { }
 fn main() {
     is_defaulted::<&'static i32>();
     is_defaulted::<&'static u32>();
-    //~^ ERROR the trait `Signed` is not implemented for the type `u32`
+    //~^ ERROR `u32 : Signed` is not satisfied
 }
index 185e9dcb3bd91d32217f85f18da308216471694c..0c548b3bd990961465eab24ea223550b31f5b943 100644 (file)
@@ -12,7 +12,7 @@
 // an explicit trait bound.
 
 fn foo<T>() {
-    is_send::<T>() //~ ERROR not implemented
+    is_send::<T>() //~ ERROR E0277
 }
 
 fn is_send<T:Send>() {
index c9bfdff6c0e495cd78a089e0d4b2d96fcc2fe421..81c4a3c5a5190a225e8c64c2ea31a54d52736ec8 100644 (file)
@@ -24,6 +24,6 @@ fn foo<T:MyTrait>() { bar::<T>() }
 fn bar<T:NotImplemented>() { }
 
 fn main() {
-    foo::<i32>(); //~ ERROR the trait `NotImplemented` is not implemented for the type `i32`
-    bar::<i64>(); //~ ERROR the trait `NotImplemented` is not implemented for the type `i64`
+    foo::<i32>(); //~ ERROR `i32 : NotImplemented` is not satisfied
+    bar::<i64>(); //~ ERROR `i64 : NotImplemented` is not satisfied
 }
index c624ba425e47f67ed4695cc5cf6a834438b03bf8..29379d549611dc94c099fc4768a9b87f3e138fd5 100644 (file)
@@ -29,7 +29,7 @@ fn bar<T:NotImplemented>() { }
 
 fn test() {
     bar::<Option<i32>>();
-    //~^ ERROR the trait `NotImplemented` is not implemented for the type `std::option::Option<i32>`
+    //~^ ERROR `std::option::Option<i32> : NotImplemented` is not satisfied
 }
 
 fn main() {
index c1757d124da5516412f0a9e2c5932af7c0636e92..a3a80e17e403bab1e082a345d03484436e6b02ff 100644 (file)
@@ -26,7 +26,7 @@ impl NotImplemented for i32 {}
 impl MyTrait for .. {}
 
 fn foo<T:MyTrait>() {
-    //~^ ERROR the trait `NotImplemented` is not implemented for the type `std::option::Option<T>`
+    //~^ ERROR `std::option::Option<T> : NotImplemented` is not satisfied
     // This should probably typecheck. This is #20671.
 }
 
index a0d236a1c5183edee5b4cadacc3561da130a1a95..f34bae3be3ca0b486e9019f4287ffee3805a8529 100644 (file)
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-// Verify that UnsafeCell is *always* sync regardless if `T` is sync.
+// Verify that UnsafeCell is *always* !Sync regardless if `T` is sync.
 
 #![feature(optin_builtin_traits)]
 
@@ -27,16 +27,16 @@ fn test<T: Sync>(s: T) {}
 fn main() {
     let us = UnsafeCell::new(MySync{u: UnsafeCell::new(0)});
     test(us);
-    //~^ ERROR `std::marker::Sync` is not implemented
+    //~^ ERROR `std::cell::UnsafeCell<MySync<_>> : std::marker::Sync` is not satisfied
 
     let uns = UnsafeCell::new(NoSync);
     test(uns);
-    //~^ ERROR `std::marker::Sync` is not implemented
+    //~^ ERROR `std::cell::UnsafeCell<NoSync> : std::marker::Sync` is not satisfied
 
     let ms = MySync{u: uns};
     test(ms);
-    //~^ ERROR `std::marker::Sync` is not implemented
+    //~^ ERROR `std::cell::UnsafeCell<NoSync> : std::marker::Sync` is not satisfied
 
     test(NoSync);
-    //~^ ERROR `std::marker::Sync` is not implemented
+    //~^ ERROR `NoSync : std::marker::Sync` is not satisfied
 }
index c07374ceaf2fb525d6f5b5c0a1ca50013cad7db7..792c4a8ca3c7c5707b803888ed5253e3047ebfc8 100644 (file)
@@ -12,7 +12,7 @@
 
 fn main() {
     <i32 as Add<u32>>::add(1, 2);
-    //~^ ERROR the trait `std::ops::Add<u32>` is not implemented for the type `i32`
+    //~^ ERROR `i32 : std::ops::Add<u32>` is not satisfied
     <i32 as Add<i32>>::add(1u32, 2);
     //~^ ERROR mismatched types
     <i32 as Add<i32>>::add(1, 2u32);
index 831db98941c6dc2ac9165eab6e987b3168dfdcd1..849f7e0573cffdca02ebc120a4db5969a7c6c9bd 100644 (file)
@@ -29,7 +29,7 @@ fn test<'a,'b>() {
 
     // In angle version, we supply something other than the default
     eq::< Foo<(isize,),isize,Output=()>,      Foo(isize)                      >();
-    //~^ ERROR not implemented
+    //~^ ERROR E0277
 
     // Supply default explicitly.
     eq::< Foo<(isize,),(isize,),Output=()>,   Foo(isize)                      >();
index dc5576aee650a56ed814b9bbcd9abc09d5f24723..0cf44a2ca61c27cf94ae31bf0e00fe371db2823a 100644 (file)
@@ -52,7 +52,7 @@ fn test<'a,'b>() {
     // Errors expected:
     eq::< Foo<(),Output=()>,
           Foo(char)                                               >();
-    //~^^ ERROR not implemented
+    //~^^ ERROR E0277
 }
 
 fn main() { }
index 93498ac7f83514c1768d1babc95dcd640c3435e2..b25b331880679fc2a638859dadca0f8275b5b392 100644 (file)
@@ -36,5 +36,5 @@ fn call_it<F:Fn(isize)->isize>(f: &F, x: isize) -> isize {
 
 fn main() {
     let x = call_it(&S, 22);
-    //~^ ERROR not implemented
+    //~^ ERROR E0277
 }
index 361df93a71669ed3ccdb7a22e27415efb587a9dd..cba7ad82ee16343ee3a5b8fa97d6a75ceee734e0 100644 (file)
@@ -22,19 +22,19 @@ fn call_it_once<F:FnOnce(&isize)->isize>(_: F, _: isize) -> isize { 0 }
 
 fn a() {
     let x = call_it(&square, 22);
-    //~^ ERROR not implemented
-    //~| ERROR not implemented
+    //~^ ERROR E0277
+    //~| ERROR E0277
 }
 
 fn b() {
     let y = call_it_mut(&mut square, 22);
-    //~^ ERROR not implemented
-    //~| ERROR not implemented
+    //~^ ERROR E0277
+    //~| ERROR E0277
 }
 
 fn c() {
     let z = call_it_once(square, 22);
-    //~^ ERROR not implemented
+    //~^ ERROR E0277
 }
 
 fn main() { }
index ca15d1bb5eefc83f11278776d3d9ba9bbab47784..dd891bc473cef97a9216b307694fe45a8cd12f75 100644 (file)
@@ -22,19 +22,19 @@ fn call_it_once<F:FnOnce(&isize)->isize>(_: F, _: isize) -> isize { 0 }
 
 fn a() {
     let x = call_it(&square, 22);
-    //~^ ERROR not implemented
-    //~| ERROR not implemented
+    //~^ ERROR E0277
+    //~| ERROR E0277
 }
 
 fn b() {
     let y = call_it_mut(&mut square, 22);
-    //~^ ERROR not implemented
-    //~| ERROR not implemented
+    //~^ ERROR E0277
+    //~| ERROR E0277
 }
 
 fn c() {
     let z = call_it_once(square, 22);
-    //~^ ERROR not implemented
+    //~^ ERROR E0277
 }
 
 fn main() { }
index b960362aad7cd36c3f0d97bafa4507b9087ad2cd..f9edd5df6739f22c88cae7b45fd719bd23038c35 100644 (file)
@@ -23,19 +23,19 @@ fn call_it_once<F:FnOnce(&isize)->isize>(_: F, _: isize) -> isize { 0 }
 
 fn a() {
     let x = call_it(&square, 22);
-    //~^ ERROR not implemented
-    //~| ERROR not implemented
+    //~^ ERROR E0277
+    //~| ERROR E0277
 }
 
 fn b() {
     let y = call_it_mut(&mut square, 22);
-    //~^ ERROR not implemented
-    //~| ERROR not implemented
+    //~^ ERROR E0277
+    //~| ERROR E0277
 }
 
 fn c() {
     let z = call_it_once(square, 22);
-    //~^ ERROR not implemented
+    //~^ ERROR E0277
 }
 
 fn main() { }
index 82aa49aa7061d2cfa5790129ec0515ac304c5444..c0a27e98faffa30d40d0deb830849e5bbedb9899 100644 (file)
@@ -17,5 +17,5 @@ fn main() {
     // FIXME (#22405): Replace `Box::new` with `box` here when/if possible.
     let i = Box::new(Rc::new(100));
     f(i);
-    //~^ ERROR `std::marker::Send` is not implemented
+    //~^ ERROR `std::rc::Rc<_> : std::marker::Send` is not satisfied
 }
index ed606dae55f21d2f3a85aee6e5d0ed1680d2a558..ae767464060410297b73342747e623bdf1b7d7b3 100644 (file)
@@ -35,8 +35,8 @@ fn main() {
     let r1 = vec!(Box::new(r { i: i1 }));
     let r2 = vec!(Box::new(r { i: i2 }));
     f(clone(&r1), clone(&r2));
-    //~^ ERROR the trait `std::clone::Clone` is not implemented for the type
-    //~^^ ERROR the trait `std::clone::Clone` is not implemented for the type
+    //~^ ERROR `r<'_> : std::clone::Clone` is not satisfied
+    //~^^ ERROR `r<'_> : std::clone::Clone` is not satisfied
     println!("{:?}", (r2, i1.get()));
     println!("{:?}", (r1, i2.get()));
 }
index 1885049f1693786f05e545e0ce4d5a0fca620087..49642ac1490c82f597e42649b49b2a160b068876 100644 (file)
@@ -9,5 +9,5 @@
 // except according to those terms.
 
 fn bar<T: Sized>() { }
-fn foo<T: ?Sized>() { bar::<T>() } //~ ERROR the trait `std::marker::Sized` is not implemented
+fn foo<T: ?Sized>() { bar::<T>() } //~ ERROR `T : std::marker::Sized` is not satisfied
 fn main() { }
index dad492eb243540ad47559a15dc6a7f7efbbbfd12..bd5b705511d4fd5165840402557a5c026eca02cd 100644 (file)
@@ -15,14 +15,14 @@ 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 the trait `std::marker::Sized` is not implemented
+//~^ ERROR `T : std::marker::Sized` is not satisfied
 //
 // Not OK: `T` is not sized.
 
 enum Bar<U: ?Sized> { BarSome(U), BarNone }
 fn bar1<T: ?Sized>() { not_sized::<Bar<T>>() }
 fn bar2<T: ?Sized>() { is_sized::<Bar<T>>() }
-//~^ ERROR the trait `std::marker::Sized` is not implemented
+//~^ ERROR `T : std::marker::Sized` is not satisfied
 //
 // Not OK: `Bar<T>` is not sized, but it should be.
 
index a03c76b12dd8ea141dce5ddd1171b815590c3157..4d0774f2ce44157743fbdc6135a37874b7808eb7 100644 (file)
@@ -14,7 +14,7 @@
 
 struct S5<Y>(Y);
 
-impl<X: ?Sized> S5<X> { //~ ERROR not implemented
+impl<X: ?Sized> S5<X> { //~ ERROR E0277
 }
 
 fn main() { }
index c317850be1a6a31b5801906c6566be76645fae4e..94f15033cb705f9caf6b881aacc34c2be1065e0a 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 the trait `std::marker::Sized` is not implemented
+//~^ ERROR `T : std::marker::Sized` is not satisfied
 //
 // 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 the trait `std::marker::Sized` is not implemented
+//~^ ERROR `T : std::marker::Sized` is not satisfied
 //
 // Not OK: `Bar<T>` is not sized, but it should be.
 
index 08df1d9b7b8fb8a384912f0258e7bcbdfadb2b53..c919bdf924f6566bb8b707451d7b860e3e397e31 100644 (file)
@@ -17,7 +17,7 @@ trait T3<Z: ?Sized> {
 
 struct S5<Y>(Y);
 
-impl<X: ?Sized> T3<X> for S5<X> { //~ ERROR not implemented
+impl<X: ?Sized> T3<X> for S5<X> { //~ ERROR E0277
 }
 
 fn main() { }
index 9cae2b56799297222a3e611e1df33bfb9b6a7c01..bd420d940d51dd88d0961981ee08981983824e4c 100644 (file)
@@ -16,7 +16,7 @@ trait T2<Z> {
 }
 struct S4<Y: ?Sized>(Box<Y>);
 impl<X: ?Sized> T2<X> for S4<X> {
-    //~^ ERROR `std::marker::Sized` is not implemented for the type `X`
+    //~^ ERROR `X : std::marker::Sized` is not satisfied
 }
 
 fn main() { }
index acce00bd87ef5a893eb27dc6261fc5ef4b8a5605..061f0695df7df3f7d0210292f7a1774a8ef26ab0 100644 (file)
@@ -15,7 +15,7 @@
 // Unbounded.
 fn f1<X: ?Sized>(x: &X) {
     f2::<X>(x);
-    //~^ ERROR the trait `std::marker::Sized` is not implemented
+    //~^ ERROR `X : std::marker::Sized` is not satisfied
 }
 fn f2<X>(x: &X) {
 }
@@ -26,7 +26,7 @@ fn foo(&self) { }
 }
 fn f3<X: ?Sized + T>(x: &X) {
     f4::<X>(x);
-    //~^ ERROR the trait `std::marker::Sized` is not implemented
+    //~^ ERROR `X : std::marker::Sized` is not satisfied
 }
 fn f4<X: T>(x: &X) {
 }
@@ -40,7 +40,7 @@ fn f5<Y>(x: &Y) {}
 fn f6<X: ?Sized>(x: &X) {}
 fn f7<X: ?Sized>(x1: &E<X>, x2: &E<X>) {
     f5(x1);
-    //~^ ERROR the trait `std::marker::Sized` is not implemented
+    //~^ ERROR `X : std::marker::Sized` is not satisfied
     f6(x2); // ok
 }
 
@@ -52,19 +52,19 @@ struct S<X: ?Sized> {
 
 fn f8<X: ?Sized>(x1: &S<X>, x2: &S<X>) {
     f5(x1);
-    //~^ ERROR the trait `std::marker::Sized` is not implemented
+    //~^ ERROR `X : std::marker::Sized` is not satisfied
     f6(x2); // ok
 }
 
 // Test some tuples.
 fn f9<X: ?Sized>(x1: Box<S<X>>, x2: Box<E<X>>) {
     f5(&(*x1, 34));
-    //~^ ERROR the trait `std::marker::Sized` is not implemented
+    //~^ ERROR `X : std::marker::Sized` is not satisfied
 }
 
 fn f10<X: ?Sized>(x1: Box<S<X>>, x2: Box<E<X>>) {
     f5(&(32, *x2));
-    //~^ ERROR the trait `std::marker::Sized` is not implemented
+    //~^ ERROR `X : std::marker::Sized` is not satisfied
 }
 
 pub fn main() {
index 463ce2515ff80f137ba9e3a7aa407107df92e417..1abc45d5df81d7805f94d95993310cd3a3eda5ab 100644 (file)
 // Test `?Sized` types not allowed in fields (except the last one).
 
 struct S1<X: ?Sized> {
-    f1: X, //~ ERROR `std::marker::Sized` is not implemented
+    f1: X, //~ ERROR `X : std::marker::Sized` is not satisfied
     f2: isize,
 }
 struct S2<X: ?Sized> {
     f: isize,
-    g: X, //~ ERROR `std::marker::Sized` is not implemented
+    g: X, //~ ERROR `X : std::marker::Sized` is not satisfied
     h: isize,
 }
 struct S3 {
-    f: str, //~ ERROR `std::marker::Sized` is not implemented
+    f: str, //~ ERROR `str : std::marker::Sized` is not satisfied
     g: [usize]
 }
 struct S4 {
-    f: [u8], //~ ERROR `std::marker::Sized` is not implemented
+    f: [u8], //~ ERROR `[u8] : std::marker::Sized` is not satisfied
     g: usize
 }
 enum E<X: ?Sized> {
-    V1(X, isize), //~ERROR `std::marker::Sized` is not implemented
+    V1(X, isize), //~ERROR `X : std::marker::Sized` is not satisfied
 }
 enum F<X: ?Sized> {
-    V2{f1: X, f: isize}, //~ERROR `std::marker::Sized` is not implemented
+    V2{f1: X, f: isize}, //~ERROR `X : std::marker::Sized` is not satisfied
 }
 
 pub fn main() {
index 4b55cdf25e58e65bf1e5d804eeb4a9655791d116..7545794bd23e3ec5d52b456fa3a42ddb7a64051e 100644 (file)
@@ -15,27 +15,27 @@ trait T {}
 fn f1<X: ?Sized>(x: &X) {
     let _: X; // <-- this is OK, no bindings created, no initializer.
     let _: (isize, (X, isize)); // same
-    let y: X; //~ERROR the trait `std::marker::Sized` is not implemented
-    let y: (isize, (X, isize)); //~ERROR the trait `std::marker::Sized` is not implemented
+    let y: X; //~ERROR `X : std::marker::Sized` is not satisfied
+    let y: (isize, (X, isize)); //~ERROR `X : std::marker::Sized` is not satisfied
 }
 fn f2<X: ?Sized + T>(x: &X) {
-    let y: X; //~ERROR the trait `std::marker::Sized` is not implemented
-    let y: (isize, (X, isize)); //~ERROR the trait `std::marker::Sized` is not implemented
+    let y: X; //~ERROR `X : std::marker::Sized` is not satisfied
+    let y: (isize, (X, isize)); //~ERROR `X : std::marker::Sized` is not satisfied
 }
 
 fn f3<X: ?Sized>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
-    let y: X = *x1; //~ERROR the trait `std::marker::Sized` is not implemented
-    let y = *x2; //~ERROR the trait `std::marker::Sized` is not implemented
-    let (y, z) = (*x3, 4); //~ERROR the trait `std::marker::Sized` is not implemented
+    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
 }
 fn f4<X: ?Sized + T>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
-    let y: X = *x1;         //~ERROR the trait `std::marker::Sized` is not implemented
-    let y = *x2;            //~ERROR the trait `std::marker::Sized` is not implemented
-    let (y, z) = (*x3, 4); //~ERROR the trait `std::marker::Sized` is not implemented
+    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
 }
 
-fn g1<X: ?Sized>(x: X) {} //~ERROR the trait `std::marker::Sized` is not implemented
-fn g2<X: ?Sized + T>(x: X) {} //~ERROR the trait `std::marker::Sized` is not implemented
+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
 
 pub fn main() {
 }
index defa57414f4092b173338bfb887541870e1500a5..5aa1f1336796b684ab59088d61ad72959ebc2b69 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 `std::marker::Sized` is not implemented for the type `X`
+    //~^ ERROR `X : std::marker::Sized` is not satisfied
 }
 
 fn main() { }
index 654272f5bc6eba34b09220e9eff6adbd080ebcad..e32cb32a74d6bac62074fe84801a17fabb8b3190 100644 (file)
@@ -24,7 +24,7 @@ fn gimme_an_a<A:TraitA>(&self, a: A) -> isize {
 
 fn call_it<B:TraitB>(b: B)  -> isize {
     let y = 4;
-    b.gimme_an_a(y) //~ ERROR the trait `TraitA` is not implemented
+    b.gimme_an_a(y) //~ ERROR `_ : TraitA` is not satisfied
 }
 
 fn main() {
index ba31de98e7f95186f7bb54d11fa222ce70f1d945..b797c9780acba5181523cd88e5b1d5d069b0ec7b 100644 (file)
@@ -25,9 +25,8 @@ pub trait Foo {
 
 impl<T> Foo for T {
     type Bar = MySet<T>;
-    //~^ ERROR the trait `MyHash` is not implemented for the type `T`
+    //~^ ERROR the predicate `T : MyHash` is not satisfied
 }
 
 #[rustc_error]
 fn main() { }
-
index 354407bc0020364ee75d0949e5ba650cc6558765..42e9fa2614ccc1deac672a07faf5f5f17b9949b8 100644 (file)
@@ -21,7 +21,7 @@ fn needs_copy(self) where T: Copy {
 
     fn fails_copy(self) {
         require_copy(self.x);
-        //~^ ERROR the trait `std::marker::Copy` is not implemented for the type `T`
+        //~^ ERROR the predicate `T : std::marker::Copy` is not satisfied
     }
 }
 
index b747a555b5e7e451c9674b6d91bb24420dfd84f0..889cf85221b73c721a9bd7a3f38c9abd085d3ac5 100644 (file)
@@ -26,7 +26,7 @@ fn needs_copy(self) where T: Copy {
 
     fn fails_copy(self) {
         require_copy(self.x);
-        //~^ ERROR the trait `std::marker::Copy` is not implemented for the type `T`
+        //~^ ERROR the predicate `T : std::marker::Copy` is not satisfied
     }
 }
 
index bf614e6eb512bab429c2c5530e833fdc1f464c35..0f682582c3ebeeddf1a7f5c0aa70a5a047a24693 100644 (file)
@@ -28,5 +28,5 @@ fn method<U>(&self) where X: Foo<U> {
 
 fn main() {
     1.method::<X>();
-    //~^ ERROR the trait `Foo<X>` is not implemented for the type `X`
+    //~^ ERROR the predicate `X : Foo<X>` is not satisfied
 }
index c4d7d8207e74d4bce05b2e2222ac4cb3f574c3e7..34ff872ac15fa3fb7e5024a48f6757b7bb55b204 100644 (file)
@@ -26,5 +26,5 @@ fn equals(&self, u: &Foo<T>) -> bool where T : Eq {
 fn main() {
     let x = Foo { value: Bar };
     x.equals(&x);
-    //~^ ERROR the trait `std::cmp::Eq` is not implemented for the type `Bar`
+    //~^ ERROR `Bar : std::cmp::Eq` is not satisfied
 }
index d1d0eb13d68df2f3720fe4e65050039430256f18..0410d7c05839b85d9314e07337cffa5b4c7b18d4 100644 (file)
@@ -15,5 +15,5 @@ fn equal<T>(_: &T, _: &T) -> bool where T : Eq {
 
 fn main() {
     drop(equal(&Struct, &Struct))
-    //~^ ERROR the trait `std::cmp::Eq` is not implemented
+    //~^ ERROR the predicate `Struct : std::cmp::Eq` is not satisfied
 }
index cd5240198b385b6ec7af3e9fb98c0c3be5b6b801..1baaed3dd37835781ec91fe42d2edec001e5339d 100644 (file)
@@ -29,5 +29,5 @@ fn foo<T>(x: &T)
 
 fn main() {
     foo(&X);
-    //~^ error: `for<'a> Bar` is not implemented
+    //~^ error: `for<'a> &'a _ : Bar` is not satisfied
 }