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
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
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
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
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`
```
```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);
^~~
```
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
}
```
FulfillmentErrorCode,
MismatchedProjectionTypes,
Obligation,
+ ObligationCause,
ObligationCauseCode,
OutputTypeParameterMismatch,
TraitNotObjectSafe,
PredicateObligation,
+ SelectionContext,
SelectionError,
ObjectSafetyViolation,
MethodViolationCode,
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;
}
}
-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() {
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,
}
}
+/// 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>)
fn ice<A>(a: A) {
let r = loop {};
r = r + a;
- //~^ ERROR not implemented
+ //~^ ERROR E0277
}
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
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() {
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() { }
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() {
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() { }
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() { }
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() {
}
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() {
// 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 {
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
}
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)
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() { }
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() { }
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() { }
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`
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`
}
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 };
}
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() {}
// 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
#[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
}
#[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() {}
// 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;
// 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
}
//~| 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
}
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
}
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
}
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() { }
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() { }
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
}
// 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
}
//~| 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,)>`
}
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);
}
}
}
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() { }
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() {}
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)
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)
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() { }
// 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)
fn main() {
format!("{:X}", "3");
- //~^ ERROR: the trait `std::fmt::UpperHex` is not implemented
+ //~^ ERROR: `str : std::fmt::UpperHex` is not satisfied
}
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 }
}
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
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
}
fn main() {
() <- 0;
- //~^ ERROR: the trait `std::ops::Placer<_>` is not implemented
+ //~^ ERROR: `() : std::ops::Placer<_>` is not satisfied
}
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
}
{
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
{
}
}
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
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
}
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() {}
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!()
// 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 {
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() {}
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
}
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
}
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
}
}
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)
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
}
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() {}
#[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() {}
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>>
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>>
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
}
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
};
}
fn main() {
let b = Bob + 3.5;
- b + 3 //~ ERROR: is not implemented
+ b + 3 //~ ERROR E0277
//~^ ERROR: mismatched types
}
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
}
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()
}
// 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
}
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() {}
}
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 }
}
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
}
// 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() { }
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>();
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>();
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() {
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
}
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>() {
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>() {
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() { }
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
}
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() {
// 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)>();
// 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() { }
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
// 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() { }
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() {
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
}
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
}
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
}
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);
});
fn main() {
let x = Foo::A(NoSend);
bar(x);
- //~^ ERROR `std::marker::Send` is not implemented
+ //~^ ERROR `NoSend : std::marker::Send` is not satisfied
}
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
}
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
}
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
}
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
}
fn assert<T: RecoverSafe + ?Sized>() {}
fn main() {
- assert::<Arc<RefCell<i32>>>(); //~ ERROR: is not implemented
+ assert::<Arc<RefCell<i32>>>(); //~ ERROR E0277
}
fn assert<T: RecoverSafe + ?Sized>() {}
fn main() {
- assert::<*const UnsafeCell<i32>>(); //~ ERROR: is not implemented
+ assert::<*const UnsafeCell<i32>>(); //~ ERROR E0277
}
fn assert<T: RecoverSafe + ?Sized>() {}
fn main() {
- assert::<&mut i32>(); //~ ERROR: RecoverSafe` is not implemented
+ assert::<&mut i32>(); //~ ERROR: RecoverSafe` is not satisfied
}
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
}
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() {}
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() {}
// 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
}
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>() {
fn is_reflect<T:Reflect>() { }
fn a<T>() {
- is_reflect::<T>(); //~ ERROR not implemented
+ is_reflect::<T>(); //~ ERROR E0277
}
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>() {
}
fn c<T>() {
- is_reflect::<Box<Get<Struct<T>>>>(); //~ ERROR not implemented
+ is_reflect::<Box<Get<Struct<T>>>>(); //~ ERROR E0277
}
fn main() {
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>() {
}
fn d<T>() {
- is_reflect::<(i32, T)>(); //~ ERROR not implemented
+ is_reflect::<(i32, T)>(); //~ ERROR E0277
}
fn main() {
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
}
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
}
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() {}
pub fn main() {
test_send::<rand::ThreadRng>();
- //~^ ERROR `std::marker::Send` is not implemented
+ //~^ ERROR : std::marker::Send` is not satisfied
}
// 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() { }
}
fn explode(x: Foo<u32>) {}
-//~^ ERROR not implemented
+//~^ ERROR E0277
fn kaboom(y: Bar<f32>) {}
-//~^ ERROR not implemented
+//~^ ERROR E0277
fn main() {
}
struct Struct;
impl PolyTrait<Foo<u16>> for Struct {
-//~^ ERROR not implemented
+//~^ ERROR E0277
}
fn main() {
fn main() {
let foo = Foo {
- //~^ ERROR not implemented
+ //~^ ERROR E0277
x: 3
};
let baz: Foo<usize> = loop { };
- //~^ ERROR not implemented
+ //~^ ERROR E0277
}
}
static X: Foo<usize> = Foo {
-//~^ ERROR not implemented
+//~^ ERROR E0277
x: 1,
};
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() {
}
fn main() {
let foo = Foo {
- //~^ ERROR not implemented
+ //~^ ERROR E0277
x: 3
};
let bar: Bar<f64> = return;
- //~^ ERROR not implemented
+ //~^ ERROR E0277
let _ = bar;
}
}
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() {
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);
}
--- /dev/null
+// 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() {
+}
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() {
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() {
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() {
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() {
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() {
// 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
}
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
}
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
}
}
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>() {
is_mytrait::<MyS>();
is_mytrait::<(MyS2, MyS)>();
- //~^ ERROR the trait `MyTrait` is not implemented for the type `MyS2`
+ //~^ ERROR `MyS2 : MyTrait` is not satisfied
}
is_mytrait::<MyS>();
is_mytrait::<MyS2>();
- //~^ ERROR the trait `MyTrait` is not implemented for the type `MyS2`
+ //~^ ERROR `MyS2 : MyTrait` is not satisfied
}
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
}
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
}
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>();
}
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
}
// an explicit trait bound.
fn foo<T>() {
- is_send::<T>() //~ ERROR not implemented
+ is_send::<T>() //~ ERROR E0277
}
fn is_send<T:Send>() {
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
}
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() {
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.
}
// 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)]
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
}
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);
// 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) >();
// Errors expected:
eq::< Foo<(),Output=()>,
Foo(char) >();
- //~^^ ERROR not implemented
+ //~^^ ERROR E0277
}
fn main() { }
fn main() {
let x = call_it(&S, 22);
- //~^ ERROR not implemented
+ //~^ ERROR E0277
}
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() { }
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() { }
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() { }
// 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
}
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()));
}
// 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() { }
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.
struct S5<Y>(Y);
-impl<X: ?Sized> S5<X> { //~ ERROR not implemented
+impl<X: ?Sized> S5<X> { //~ ERROR E0277
}
fn main() { }
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.
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() { }
}
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() { }
// 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) {
}
}
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) {
}
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
}
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() {
// 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() {
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() {
}
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() { }
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() {
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() { }
-
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
}
}
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
}
}
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
}
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
}
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
}
fn main() {
foo(&X);
- //~^ error: `for<'a> Bar` is not implemented
+ //~^ error: `for<'a> &'a _ : Bar` is not satisfied
}