On obligation errors point at the unfulfilled binding when possible

This commit is contained in:
Esteban Küber 2019-09-04 10:17:59 -07:00
parent 4ff32c07da
commit b370c111fd
141 changed files with 588 additions and 512 deletions

View File

@ -2750,3 +2750,16 @@ pub enum Node<'hir> {
Crate,
}
impl<'hir> Node<'hir> {
pub fn ident(&self) -> Option<Ident> {
match self {
Node::TraitItem(TraitItem { ident, .. }) |
Node::ImplItem(ImplItem { ident, .. }) |
Node::ForeignItem(ForeignItem { ident, .. }) |
Node::Item(Item { ident, .. }) => Some(*ident),
_ => None,
}
}
}

View File

@ -40,10 +40,12 @@ use syntax::symbol::{sym, kw};
use syntax_pos::{DUMMY_SP, Span, ExpnKind};
impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
pub fn report_fulfillment_errors(&self,
errors: &[FulfillmentError<'tcx>],
body_id: Option<hir::BodyId>,
fallback_has_occurred: bool) {
pub fn report_fulfillment_errors(
&self,
errors: &[FulfillmentError<'tcx>],
body_id: Option<hir::BodyId>,
fallback_has_occurred: bool,
) {
#[derive(Debug)]
struct ErrorDescriptor<'tcx> {
predicate: ty::Predicate<'tcx>,
@ -1651,6 +1653,18 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
err.note(&msg);
}
}
ObligationCauseCode::BindingObligation(item_def_id, span) => {
let item_name = tcx.def_path_str(item_def_id);
let msg = format!("required by this bound in `{}`", item_name);
if let Some(ident) = tcx.opt_item_name(item_def_id) {
err.span_label(ident.span, "");
}
if span != DUMMY_SP {
err.span_label(span, &msg);
} else {
err.note(&msg);
}
}
ObligationCauseCode::ObjectCastObligation(object_ty) => {
err.note(&format!("required for the cast to the object type `{}`",
self.ty_to_string(object_ty)));

View File

@ -176,6 +176,9 @@ pub enum ObligationCauseCode<'tcx> {
/// also implement all supertraits of `X`.
ItemObligation(DefId),
/// Like `ItemObligation`, but with extra detail on the source of the obligation.
BindingObligation(DefId, Span),
/// A type like `&'a T` is WF only if `T: 'a`.
ReferenceOutlivesReferent(Ty<'tcx>),

View File

@ -472,6 +472,7 @@ impl<'a, 'tcx> Lift<'tcx> for traits::ObligationCauseCode<'a> {
super::TupleElem => Some(super::TupleElem),
super::ProjectionWf(proj) => tcx.lift(&proj).map(super::ProjectionWf),
super::ItemObligation(def_id) => Some(super::ItemObligation(def_id)),
super::BindingObligation(def_id, span) => Some(super::BindingObligation(def_id, span)),
super::ReferenceOutlivesReferent(ty) => {
tcx.lift(&ty).map(super::ReferenceOutlivesReferent)
}

View File

@ -2797,6 +2797,10 @@ impl<'tcx> TyCtxt<'tcx> {
})
}
pub fn opt_item_name(self, def_id: DefId) -> Option<Ident> {
self.hir().as_local_hir_id(def_id).and_then(|hir_id| self.hir().get(hir_id).ident())
}
pub fn opt_associated_item(self, def_id: DefId) -> Option<AssocItem> {
let is_associated_item = if let Some(hir_id) = self.hir().as_local_hir_id(def_id) {
match self.hir().get(hir_id) {

View File

@ -2617,16 +2617,24 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
/// As `instantiate_type_scheme`, but for the bounds found in a
/// generic type scheme.
fn instantiate_bounds(&self, span: Span, def_id: DefId, substs: SubstsRef<'tcx>)
-> ty::InstantiatedPredicates<'tcx> {
fn instantiate_bounds(
&self,
span: Span,
def_id: DefId,
substs: SubstsRef<'tcx>,
) -> (ty::InstantiatedPredicates<'tcx>, Vec<Span>) {
let bounds = self.tcx.predicates_of(def_id);
let spans: Vec<Span> = bounds.predicates.iter().map(|(_, span)| *span).collect();
let result = bounds.instantiate(self.tcx, substs);
let result = self.normalize_associated_types_in(span, &result);
debug!("instantiate_bounds(bounds={:?}, substs={:?}) = {:?}",
debug!(
"instantiate_bounds(bounds={:?}, substs={:?}) = {:?}, {:?}",
bounds,
substs,
result);
result
result,
spans,
);
(result, spans)
}
/// Replaces the opaque types from the given value with type variables,
@ -3194,8 +3202,8 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
// All the input types from the fn signature must outlive the call
// so as to validate implied bounds.
for &fn_input_ty in fn_inputs {
self.register_wf_obligation(fn_input_ty, sp, traits::MiscObligation);
for (fn_input_ty, arg_expr) in fn_inputs.iter().zip(args.iter()) {
self.register_wf_obligation(fn_input_ty, arg_expr.span, traits::MiscObligation);
}
let expected_arg_count = fn_inputs.len();
@ -3604,7 +3612,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
self.write_user_type_annotation_from_substs(hir_id, did, substs, None);
// Check bounds on type arguments used in the path.
let bounds = self.instantiate_bounds(path_span, did, substs);
let (bounds, _) = self.instantiate_bounds(path_span, did, substs);
let cause = traits::ObligationCause::new(
path_span,
self.body_id,
@ -4730,11 +4738,23 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
// Add all the obligations that are required, substituting and
// normalized appropriately.
let bounds = self.instantiate_bounds(span, def_id, &substs);
self.add_obligations_for_parameters(
traits::ObligationCause::new(span, self.body_id, traits::ItemObligation(def_id)),
let (bounds, spans) = self.instantiate_bounds(span, def_id, &substs);
for (i, mut obligation) in traits::predicates_for_generics(
traits::ObligationCause::new(
span,
self.body_id,
traits::ItemObligation(def_id),
),
self.param_env,
&bounds,
);
).into_iter().enumerate() {
// This makes the error point at the bound, but we want to point at the argument
if let Some(span) = spans.get(i) {
obligation.cause.code = traits::BindingObligation(def_id, *span);
}
self.register_predicate(obligation);
}
// Substitute the values for the type parameters into the type of
// the referenced item.

View File

@ -7,7 +7,7 @@ LL | f1(|_: (), _: ()| {});
| expected signature of `for<'r, 's> fn(&'r (), &'s ()) -> _`
...
LL | fn f1<F>(_: F) where F: Fn(&(), &()) {}
| ------------------------------------ required by `f1`
| -- ------------ required by this bound in `f1`
error[E0631]: type mismatch in closure arguments
--> $DIR/anonymous-higher-ranked-lifetime.rs:2:5
@ -18,7 +18,7 @@ LL | f1(|_: (), _: ()| {});
| expected signature of `fn(&(), &()) -> _`
...
LL | fn f1<F>(_: F) where F: Fn(&(), &()) {}
| ------------------------------------ required by `f1`
| -- ---------- required by this bound in `f1`
error[E0631]: type mismatch in closure arguments
--> $DIR/anonymous-higher-ranked-lifetime.rs:4:5
@ -29,7 +29,7 @@ LL | f2(|_: (), _: ()| {});
| expected signature of `for<'a, 'r> fn(&'a (), &'r ()) -> _`
...
LL | fn f2<F>(_: F) where F: for<'a> Fn(&'a (), &()) {}
| ----------------------------------------------- required by `f2`
| -- ----------------------- required by this bound in `f2`
error[E0631]: type mismatch in closure arguments
--> $DIR/anonymous-higher-ranked-lifetime.rs:4:5
@ -40,7 +40,7 @@ LL | f2(|_: (), _: ()| {});
| expected signature of `fn(&'a (), &()) -> _`
...
LL | fn f2<F>(_: F) where F: for<'a> Fn(&'a (), &()) {}
| ----------------------------------------------- required by `f2`
| -- ------------- required by this bound in `f2`
error[E0631]: type mismatch in closure arguments
--> $DIR/anonymous-higher-ranked-lifetime.rs:6:5
@ -51,7 +51,7 @@ LL | f3(|_: (), _: ()| {});
| expected signature of `for<'r> fn(&(), &'r ()) -> _`
...
LL | fn f3<'a, F>(_: F) where F: Fn(&'a (), &()) {}
| ------------------------------------------- required by `f3`
| -- --------------- required by this bound in `f3`
error[E0631]: type mismatch in closure arguments
--> $DIR/anonymous-higher-ranked-lifetime.rs:6:5
@ -62,7 +62,7 @@ LL | f3(|_: (), _: ()| {});
| expected signature of `fn(&(), &()) -> _`
...
LL | fn f3<'a, F>(_: F) where F: Fn(&'a (), &()) {}
| ------------------------------------------- required by `f3`
| -- ------------- required by this bound in `f3`
error[E0631]: type mismatch in closure arguments
--> $DIR/anonymous-higher-ranked-lifetime.rs:8:5
@ -73,7 +73,7 @@ LL | f4(|_: (), _: ()| {});
| expected signature of `for<'s, 'r> fn(&'s (), &'r ()) -> _`
...
LL | fn f4<F>(_: F) where F: for<'r> Fn(&(), &'r ()) {}
| ----------------------------------------------- required by `f4`
| -- ----------------------- required by this bound in `f4`
error[E0631]: type mismatch in closure arguments
--> $DIR/anonymous-higher-ranked-lifetime.rs:8:5
@ -84,7 +84,7 @@ LL | f4(|_: (), _: ()| {});
| expected signature of `fn(&(), &'r ()) -> _`
...
LL | fn f4<F>(_: F) where F: for<'r> Fn(&(), &'r ()) {}
| ----------------------------------------------- required by `f4`
| -- ------------- required by this bound in `f4`
error[E0631]: type mismatch in closure arguments
--> $DIR/anonymous-higher-ranked-lifetime.rs:10:5
@ -95,7 +95,7 @@ LL | f5(|_: (), _: ()| {});
| expected signature of `for<'r> fn(&'r (), &'r ()) -> _`
...
LL | fn f5<F>(_: F) where F: for<'r> Fn(&'r (), &'r ()) {}
| -------------------------------------------------- required by `f5`
| -- -------------------------- required by this bound in `f5`
error[E0631]: type mismatch in closure arguments
--> $DIR/anonymous-higher-ranked-lifetime.rs:10:5
@ -106,7 +106,7 @@ LL | f5(|_: (), _: ()| {});
| expected signature of `fn(&'r (), &'r ()) -> _`
...
LL | fn f5<F>(_: F) where F: for<'r> Fn(&'r (), &'r ()) {}
| -------------------------------------------------- required by `f5`
| -- ---------------- required by this bound in `f5`
error[E0631]: type mismatch in closure arguments
--> $DIR/anonymous-higher-ranked-lifetime.rs:12:5
@ -117,7 +117,7 @@ LL | g1(|_: (), _: ()| {});
| expected signature of `for<'r> fn(&'r (), std::boxed::Box<(dyn for<'s> std::ops::Fn(&'s ()) + 'static)>) -> _`
...
LL | fn g1<F>(_: F) where F: Fn(&(), Box<dyn Fn(&())>) {}
| ------------------------------------------------- required by `g1`
| -- ------------------------- required by this bound in `g1`
error[E0631]: type mismatch in closure arguments
--> $DIR/anonymous-higher-ranked-lifetime.rs:12:5
@ -128,7 +128,7 @@ LL | g1(|_: (), _: ()| {});
| expected signature of `fn(&(), std::boxed::Box<(dyn for<'r> std::ops::Fn(&'r ()) + 'static)>) -> _`
...
LL | fn g1<F>(_: F) where F: Fn(&(), Box<dyn Fn(&())>) {}
| ------------------------------------------------- required by `g1`
| -- ----------------------- required by this bound in `g1`
error[E0631]: type mismatch in closure arguments
--> $DIR/anonymous-higher-ranked-lifetime.rs:14:5
@ -139,7 +139,7 @@ LL | g2(|_: (), _: ()| {});
| expected signature of `for<'r> fn(&'r (), for<'s> fn(&'s ())) -> _`
...
LL | fn g2<F>(_: F) where F: Fn(&(), fn(&())) {}
| ---------------------------------------- required by `g2`
| -- ---------------- required by this bound in `g2`
error[E0631]: type mismatch in closure arguments
--> $DIR/anonymous-higher-ranked-lifetime.rs:14:5
@ -150,7 +150,7 @@ LL | g2(|_: (), _: ()| {});
| expected signature of `fn(&(), for<'r> fn(&'r ())) -> _`
...
LL | fn g2<F>(_: F) where F: Fn(&(), fn(&())) {}
| ---------------------------------------- required by `g2`
| -- -------------- required by this bound in `g2`
error[E0631]: type mismatch in closure arguments
--> $DIR/anonymous-higher-ranked-lifetime.rs:16:5
@ -161,7 +161,7 @@ LL | g3(|_: (), _: ()| {});
| expected signature of `for<'s> fn(&'s (), std::boxed::Box<(dyn for<'r> std::ops::Fn(&'r ()) + 'static)>) -> _`
...
LL | fn g3<F>(_: F) where F: for<'s> Fn(&'s (), Box<dyn Fn(&())>) {}
| ------------------------------------------------------------ required by `g3`
| -- ------------------------------------ required by this bound in `g3`
error[E0631]: type mismatch in closure arguments
--> $DIR/anonymous-higher-ranked-lifetime.rs:16:5
@ -172,7 +172,7 @@ LL | g3(|_: (), _: ()| {});
| expected signature of `fn(&'s (), std::boxed::Box<(dyn for<'r> std::ops::Fn(&'r ()) + 'static)>) -> _`
...
LL | fn g3<F>(_: F) where F: for<'s> Fn(&'s (), Box<dyn Fn(&())>) {}
| ------------------------------------------------------------ required by `g3`
| -- -------------------------- required by this bound in `g3`
error[E0631]: type mismatch in closure arguments
--> $DIR/anonymous-higher-ranked-lifetime.rs:18:5
@ -183,7 +183,7 @@ LL | g4(|_: (), _: ()| {});
| expected signature of `for<'s> fn(&'s (), for<'r> fn(&'r ())) -> _`
...
LL | fn g4<F>(_: F) where F: Fn(&(), for<'r> fn(&'r ())) {}
| --------------------------------------------------- required by `g4`
| -- --------------------------- required by this bound in `g4`
error[E0631]: type mismatch in closure arguments
--> $DIR/anonymous-higher-ranked-lifetime.rs:18:5
@ -194,7 +194,7 @@ LL | g4(|_: (), _: ()| {});
| expected signature of `fn(&(), for<'r> fn(&'r ())) -> _`
...
LL | fn g4<F>(_: F) where F: Fn(&(), for<'r> fn(&'r ())) {}
| --------------------------------------------------- required by `g4`
| -- ------------------------- required by this bound in `g4`
error[E0631]: type mismatch in closure arguments
--> $DIR/anonymous-higher-ranked-lifetime.rs:20:5
@ -205,7 +205,7 @@ LL | h1(|_: (), _: (), _: (), _: ()| {});
| expected signature of `for<'r, 's> fn(&'r (), std::boxed::Box<(dyn for<'t0> std::ops::Fn(&'t0 ()) + 'static)>, &'s (), for<'t0, 't1> fn(&'t0 (), &'t1 ())) -> _`
...
LL | fn h1<F>(_: F) where F: Fn(&(), Box<dyn Fn(&())>, &(), fn(&(), &())) {}
| -------------------------------------------------------------------- required by `h1`
| -- -------------------------------------------- required by this bound in `h1`
error[E0631]: type mismatch in closure arguments
--> $DIR/anonymous-higher-ranked-lifetime.rs:20:5
@ -216,7 +216,7 @@ LL | h1(|_: (), _: (), _: (), _: ()| {});
| expected signature of `fn(&(), std::boxed::Box<(dyn for<'r> std::ops::Fn(&'r ()) + 'static)>, &(), for<'r, 's> fn(&'r (), &'s ())) -> _`
...
LL | fn h1<F>(_: F) where F: Fn(&(), Box<dyn Fn(&())>, &(), fn(&(), &())) {}
| -------------------------------------------------------------------- required by `h1`
| -- ------------------------------------------ required by this bound in `h1`
error[E0631]: type mismatch in closure arguments
--> $DIR/anonymous-higher-ranked-lifetime.rs:22:5
@ -227,7 +227,7 @@ LL | h2(|_: (), _: (), _: (), _: ()| {});
| expected signature of `for<'r, 't0> fn(&'r (), std::boxed::Box<(dyn for<'s> std::ops::Fn(&'s ()) + 'static)>, &'t0 (), for<'s, 't1> fn(&'s (), &'t1 ())) -> _`
...
LL | fn h2<F>(_: F) where F: for<'t0> Fn(&(), Box<dyn Fn(&())>, &'t0 (), fn(&(), &())) {}
| --------------------------------------------------------------------------------- required by `h2`
| -- --------------------------------------------------------- required by this bound in `h2`
error[E0631]: type mismatch in closure arguments
--> $DIR/anonymous-higher-ranked-lifetime.rs:22:5
@ -238,7 +238,7 @@ LL | h2(|_: (), _: (), _: (), _: ()| {});
| expected signature of `fn(&(), std::boxed::Box<(dyn for<'r> std::ops::Fn(&'r ()) + 'static)>, &'t0 (), for<'r, 's> fn(&'r (), &'s ())) -> _`
...
LL | fn h2<F>(_: F) where F: for<'t0> Fn(&(), Box<dyn Fn(&())>, &'t0 (), fn(&(), &())) {}
| --------------------------------------------------------------------------------- required by `h2`
| -- ---------------------------------------------- required by this bound in `h2`
error: aborting due to 22 previous errors

View File

@ -2,7 +2,7 @@ error[E0271]: type mismatch resolving `<ModelT as Vehicle>::Color == Blue`
--> $DIR/associated-types-binding-to-type-defined-in-supertrait.rs:31:10
|
LL | fn blue_car<C:Car<Color=Blue>>(c: C) {
| ------------------------------------ required by `blue_car`
| -------- ---------- required by this bound in `blue_car`
...
LL | fn b() { blue_car(ModelT); }
| ^^^^^^^^ expected struct `Black`, found struct `Blue`
@ -14,7 +14,7 @@ error[E0271]: type mismatch resolving `<ModelU as Vehicle>::Color == Black`
--> $DIR/associated-types-binding-to-type-defined-in-supertrait.rs:32:10
|
LL | fn black_car<C:Car<Color=Black>>(c: C) {
| -------------------------------------- required by `black_car`
| --------- ----------- required by this bound in `black_car`
...
LL | fn c() { black_car(ModelU); }
| ^^^^^^^^^ expected struct `Blue`, found struct `Black`

View File

@ -13,7 +13,7 @@ error[E0271]: type mismatch resolving `<isize as Foo>::A == Bar`
--> $DIR/associated-types-eq-3.rs:38:5
|
LL | fn foo1<I: Foo<A=Bar>>(x: I) {
| ---------------------------- required by `foo1`
| ---- ----- required by this bound in `foo1`
...
LL | foo1(a);
| ^^^^ expected usize, found struct `Bar`

View File

@ -1,15 +1,13 @@
error[E0271]: type mismatch resolving `for<'x> <UintStruct as TheTrait<&'x isize>>::A == &'x isize`
--> $DIR/associated-types-eq-hr.rs:82:5
|
LL | / fn foo<T>()
LL | | where T : for<'x> TheTrait<&'x isize, A = &'x isize>
LL | | {
LL | | // ok for IntStruct, but not UintStruct
LL | | }
| |_- required by `foo`
LL | fn foo<T>()
| ---
LL | where T : for<'x> TheTrait<&'x isize, A = &'x isize>
| ------------- required by this bound in `foo`
...
LL | foo::<UintStruct>();
| ^^^^^^^^^^^^^^^^^ expected usize, found isize
LL | foo::<UintStruct>();
| ^^^^^^^^^^^^^^^^^ expected usize, found isize
|
= note: expected type `&usize`
found type `&isize`
@ -17,15 +15,13 @@ LL | foo::<UintStruct>();
error[E0271]: type mismatch resolving `for<'x> <IntStruct as TheTrait<&'x isize>>::A == &'x usize`
--> $DIR/associated-types-eq-hr.rs:86:5
|
LL | / fn bar<T>()
LL | | where T : for<'x> TheTrait<&'x isize, A = &'x usize>
LL | | {
LL | | // ok for UintStruct, but not IntStruct
LL | | }
| |_- required by `bar`
LL | fn bar<T>()
| ---
LL | where T : for<'x> TheTrait<&'x isize, A = &'x usize>
| ------------- required by this bound in `bar`
...
LL | bar::<IntStruct>();
| ^^^^^^^^^^^^^^^^ expected isize, found usize
LL | bar::<IntStruct>();
| ^^^^^^^^^^^^^^^^ expected isize, found usize
|
= note: expected type `&isize`
found type `&usize`
@ -33,15 +29,13 @@ LL | bar::<IntStruct>();
error[E0277]: the trait bound `for<'x, 'y> Tuple: TheTrait<(&'x isize, &'y isize)>` is not satisfied
--> $DIR/associated-types-eq-hr.rs:91:5
|
LL | / fn tuple_one<T>()
LL | | where T : for<'x,'y> TheTrait<(&'x isize, &'y isize), A = &'x isize>
LL | | {
LL | | // not ok for tuple, two lifetimes and we pick first
LL | | }
| |_- required by `tuple_one`
LL | fn tuple_one<T>()
| ---------
LL | where T : for<'x,'y> TheTrait<(&'x isize, &'y isize), A = &'x isize>
| ---------------------------------------------------------- required by this bound in `tuple_one`
...
LL | tuple_one::<Tuple>();
| ^^^^^^^^^^^^^^^^^^ the trait `for<'x, 'y> TheTrait<(&'x isize, &'y isize)>` is not implemented for `Tuple`
LL | tuple_one::<Tuple>();
| ^^^^^^^^^^^^^^^^^^ the trait `for<'x, 'y> TheTrait<(&'x isize, &'y isize)>` is not implemented for `Tuple`
|
= help: the following implementations were found:
<Tuple as TheTrait<(&'a isize, &'a isize)>>
@ -49,28 +43,24 @@ LL | tuple_one::<Tuple>();
error[E0271]: type mismatch resolving `for<'x, 'y> <Tuple as TheTrait<(&'x isize, &'y isize)>>::A == &'x isize`
--> $DIR/associated-types-eq-hr.rs:91:5
|
LL | / fn tuple_one<T>()
LL | | where T : for<'x,'y> TheTrait<(&'x isize, &'y isize), A = &'x isize>
LL | | {
LL | | // not ok for tuple, two lifetimes and we pick first
LL | | }
| |_- required by `tuple_one`
LL | fn tuple_one<T>()
| ---------
LL | where T : for<'x,'y> TheTrait<(&'x isize, &'y isize), A = &'x isize>
| ------------- required by this bound in `tuple_one`
...
LL | tuple_one::<Tuple>();
| ^^^^^^^^^^^^^^^^^^ expected bound lifetime parameter 'x, found concrete lifetime
LL | tuple_one::<Tuple>();
| ^^^^^^^^^^^^^^^^^^ expected bound lifetime parameter 'x, found concrete lifetime
error[E0277]: the trait bound `for<'x, 'y> Tuple: TheTrait<(&'x isize, &'y isize)>` is not satisfied
--> $DIR/associated-types-eq-hr.rs:97:5
|
LL | / fn tuple_two<T>()
LL | | where T : for<'x,'y> TheTrait<(&'x isize, &'y isize), A = &'y isize>
LL | | {
LL | | // not ok for tuple, two lifetimes and we pick second
LL | | }
| |_- required by `tuple_two`
LL | fn tuple_two<T>()
| ---------
LL | where T : for<'x,'y> TheTrait<(&'x isize, &'y isize), A = &'y isize>
| ---------------------------------------------------------- required by this bound in `tuple_two`
...
LL | tuple_two::<Tuple>();
| ^^^^^^^^^^^^^^^^^^ the trait `for<'x, 'y> TheTrait<(&'x isize, &'y isize)>` is not implemented for `Tuple`
LL | tuple_two::<Tuple>();
| ^^^^^^^^^^^^^^^^^^ the trait `for<'x, 'y> TheTrait<(&'x isize, &'y isize)>` is not implemented for `Tuple`
|
= help: the following implementations were found:
<Tuple as TheTrait<(&'a isize, &'a isize)>>
@ -78,28 +68,24 @@ LL | tuple_two::<Tuple>();
error[E0271]: type mismatch resolving `for<'x, 'y> <Tuple as TheTrait<(&'x isize, &'y isize)>>::A == &'y isize`
--> $DIR/associated-types-eq-hr.rs:97:5
|
LL | / fn tuple_two<T>()
LL | | where T : for<'x,'y> TheTrait<(&'x isize, &'y isize), A = &'y isize>
LL | | {
LL | | // not ok for tuple, two lifetimes and we pick second
LL | | }
| |_- required by `tuple_two`
LL | fn tuple_two<T>()
| ---------
LL | where T : for<'x,'y> TheTrait<(&'x isize, &'y isize), A = &'y isize>
| ------------- required by this bound in `tuple_two`
...
LL | tuple_two::<Tuple>();
| ^^^^^^^^^^^^^^^^^^ expected bound lifetime parameter 'x, found concrete lifetime
LL | tuple_two::<Tuple>();
| ^^^^^^^^^^^^^^^^^^ expected bound lifetime parameter 'x, found concrete lifetime
error[E0277]: the trait bound `for<'x, 'y> Tuple: TheTrait<(&'x isize, &'y isize)>` is not satisfied
--> $DIR/associated-types-eq-hr.rs:107:5
|
LL | / fn tuple_four<T>()
LL | | where T : for<'x,'y> TheTrait<(&'x isize, &'y isize)>
LL | | {
LL | | // not ok for tuple, two lifetimes, and lifetime matching is invariant
LL | | }
| |_- required by `tuple_four`
LL | fn tuple_four<T>()
| ----------
LL | where T : for<'x,'y> TheTrait<(&'x isize, &'y isize)>
| ------------------------------------------- required by this bound in `tuple_four`
...
LL | tuple_four::<Tuple>();
| ^^^^^^^^^^^^^^^^^^^ the trait `for<'x, 'y> TheTrait<(&'x isize, &'y isize)>` is not implemented for `Tuple`
LL | tuple_four::<Tuple>();
| ^^^^^^^^^^^^^^^^^^^ the trait `for<'x, 'y> TheTrait<(&'x isize, &'y isize)>` is not implemented for `Tuple`
|
= help: the following implementations were found:
<Tuple as TheTrait<(&'a isize, &'a isize)>>

View File

@ -2,7 +2,7 @@ error[E0271]: type mismatch resolving `<Adapter<I> as Iterator>::Item == std::op
--> $DIR/associated-types-issue-20346.rs:34:5
|
LL | fn is_iterator_of<A, I: Iterator<Item=A>>(_: &I) {}
| ------------------------------------------------ required by `is_iterator_of`
| -------------- ------ required by this bound in `is_iterator_of`
...
LL | is_iterator_of::<Option<T>, _>(&adapter);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected type parameter, found enum `std::option::Option`

View File

@ -5,7 +5,7 @@ LL | want_y(t);
| ^^^^^^ expected associated type, found i32
...
LL | fn want_y<T:Foo<Y=i32>>(t: &T) { }
| ------------------------------ required by `want_y`
| ------ ----- required by this bound in `want_y`
|
= note: expected type `<T as Foo>::Y`
found type `i32`
@ -19,7 +19,7 @@ LL | want_x(t);
| ^^^^^^ expected associated type, found u32
...
LL | fn want_x<T:Foo<X=u32>>(t: &T) { }
| ------------------------------ required by `want_x`
| ------ ----- required by this bound in `want_x`
|
= note: expected type `<T as Foo>::X`
found type `u32`

View File

@ -12,7 +12,7 @@ error[E0277]: the trait bound `u32: Foo` is not satisfied
--> $DIR/associated-types-path-2.rs:29:5
|
LL | pub fn f1<T: Foo>(a: T, x: T::A) {}
| -------------------------------- required by `f1`
| -- --- required by this bound in `f1`
...
LL | f1(2u32, 4u32);
| ^^ the trait `Foo` is not implemented for `u32`
@ -27,7 +27,7 @@ error[E0277]: the trait bound `u32: Foo` is not satisfied
--> $DIR/associated-types-path-2.rs:35:5
|
LL | pub fn f1<T: Foo>(a: T, x: T::A) {}
| -------------------------------- required by `f1`
| -- --- required by this bound in `f1`
...
LL | f1(2u32, 4i32);
| ^^ the trait `Foo` is not implemented for `u32`

View File

@ -1,13 +1,13 @@
error[E0271]: type mismatch resolving `for<'a> <&'a _ as Mirror>::Image == _`
--> $DIR/higher-ranked-projection.rs:25:5
|
LL | / fn foo<U, T>(_t: T)
LL | | where for<'a> &'a T: Mirror<Image=U>
LL | | {}
| |__- required by `foo`
LL | fn foo<U, T>(_t: T)
| ---
LL | where for<'a> &'a T: Mirror<Image=U>
| ------- required by this bound in `foo`
...
LL | foo(());
| ^^^ expected bound lifetime parameter 'a, found concrete lifetime
LL | foo(());
| ^^^ expected bound lifetime parameter 'a, found concrete lifetime
error: aborting due to previous error

View File

@ -2,7 +2,7 @@ error[E0277]: `std::rc::Rc<()>` cannot be sent between threads safely
--> $DIR/async-fn-nonsend.rs:50:5
|
LL | fn assert_send(_: impl Send) {}
| ---------------------------- required by `assert_send`
| ----------- ---- required by this bound in `assert_send`
...
LL | assert_send(local_dropped_before_await());
| ^^^^^^^^^^^ `std::rc::Rc<()>` cannot be sent between threads safely
@ -19,7 +19,7 @@ error[E0277]: `std::rc::Rc<()>` cannot be sent between threads safely
--> $DIR/async-fn-nonsend.rs:52:5
|
LL | fn assert_send(_: impl Send) {}
| ---------------------------- required by `assert_send`
| ----------- ---- required by this bound in `assert_send`
...
LL | assert_send(non_send_temporary_in_match());
| ^^^^^^^^^^^ `std::rc::Rc<()>` cannot be sent between threads safely
@ -36,7 +36,7 @@ error[E0277]: `dyn std::fmt::Write` cannot be sent between threads safely
--> $DIR/async-fn-nonsend.rs:54:5
|
LL | fn assert_send(_: impl Send) {}
| ---------------------------- required by `assert_send`
| ----------- ---- required by this bound in `assert_send`
...
LL | assert_send(non_sync_with_method_call());
| ^^^^^^^^^^^ `dyn std::fmt::Write` cannot be sent between threads safely
@ -55,7 +55,7 @@ error[E0277]: `*mut (dyn std::ops::Fn() + 'static)` cannot be shared between thr
--> $DIR/async-fn-nonsend.rs:54:5
|
LL | fn assert_send(_: impl Send) {}
| ---------------------------- required by `assert_send`
| ----------- ---- required by this bound in `assert_send`
...
LL | assert_send(non_sync_with_method_call());
| ^^^^^^^^^^^ `*mut (dyn std::ops::Fn() + 'static)` cannot be shared between threads safely

View File

@ -32,8 +32,11 @@ error[E0277]: the trait bound `[closure@$DIR/issue-62009-1.rs:12:5: 12:15]: std:
|
LL | (|_| 2333).await;
| ^^^^^^^^^^^^^^^^ the trait `std::future::Future` is not implemented for `[closure@$DIR/issue-62009-1.rs:12:5: 12:15]`
|
::: $SRC_DIR/libstd/future.rs:LL:COL
|
= note: required by `std::future::poll_with_tls_context`
LL | F: Future
| ------ required by this bound in `std::future::poll_with_tls_context`
error: aborting due to 4 previous errors

View File

@ -11,7 +11,7 @@ error[E0277]: the trait bound `{float}: Bar` is not satisfied
--> $DIR/type_inference.rs:25:5
|
LL | fn only_bar<T: Bar>(_x: T) { }
| -------------------------- required by `only_bar`
| -------- --- required by this bound in `only_bar`
...
LL | only_bar(x);
| ^^^^^^^^ the trait `Bar` is not implemented for `{float}`

View File

@ -39,44 +39,41 @@ LL | with_closure_expecting_fn_with_free_region(|x: fn(&'x u32), y| {});
error[E0631]: type mismatch in closure arguments
--> $DIR/expect-fn-supply-fn.rs:30:5
|
LL | / fn with_closure_expecting_fn_with_free_region<F>(_: F)
LL | | where F: for<'a> FnOnce(fn(&'a u32), &i32)
LL | | {
LL | | }
| |_- required by `with_closure_expecting_fn_with_free_region`
LL | fn with_closure_expecting_fn_with_free_region<F>(_: F)
| ------------------------------------------
LL | where F: for<'a> FnOnce(fn(&'a u32), &i32)
| ------------------- required by this bound in `with_closure_expecting_fn_with_free_region`
...
LL | with_closure_expecting_fn_with_free_region(|x: fn(&u32), y| {});
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ---------------- found signature of `fn(for<'r> fn(&'r u32), _) -> _`
| |
| expected signature of `fn(fn(&'a u32), &i32) -> _`
LL | with_closure_expecting_fn_with_free_region(|x: fn(&u32), y| {});
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ---------------- found signature of `fn(for<'r> fn(&'r u32), _) -> _`
| |
| expected signature of `fn(fn(&'a u32), &i32) -> _`
error[E0631]: type mismatch in closure arguments
--> $DIR/expect-fn-supply-fn.rs:37:5
|
LL | / fn with_closure_expecting_fn_with_bound_region<F>(_: F)
LL | | where F: FnOnce(fn(&u32), &i32)
LL | | {
LL | | }
| |_- required by `with_closure_expecting_fn_with_bound_region`
LL | fn with_closure_expecting_fn_with_bound_region<F>(_: F)
| -------------------------------------------
LL | where F: FnOnce(fn(&u32), &i32)
| ---------------- required by this bound in `with_closure_expecting_fn_with_bound_region`
...
LL | with_closure_expecting_fn_with_bound_region(|x: fn(&'x u32), y| {});
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ------------------- found signature of `fn(fn(&'x u32), _) -> _`
| |
| expected signature of `fn(for<'r> fn(&'r u32), &i32) -> _`
LL | with_closure_expecting_fn_with_bound_region(|x: fn(&'x u32), y| {});
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ------------------- found signature of `fn(fn(&'x u32), _) -> _`
| |
| expected signature of `fn(for<'r> fn(&'r u32), &i32) -> _`
error[E0631]: type mismatch in closure arguments
--> $DIR/expect-fn-supply-fn.rs:46:5
|
LL | / fn with_closure_expecting_fn_with_bound_region<F>(_: F)
LL | | where F: FnOnce(fn(&u32), &i32)
LL | | {
LL | | }
| |_- required by `with_closure_expecting_fn_with_bound_region`
LL | fn with_closure_expecting_fn_with_bound_region<F>(_: F)
| -------------------------------------------
LL | where F: FnOnce(fn(&u32), &i32)
| ---------------- required by this bound in `with_closure_expecting_fn_with_bound_region`
...
LL | with_closure_expecting_fn_with_bound_region(|x: Foo<'_>, y| {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ --------------- found signature of `for<'r> fn(fn(&'r u32), _) -> _`
| |
| expected signature of `fn(for<'r> fn(&'r u32), &i32) -> _`
LL | with_closure_expecting_fn_with_bound_region(|x: Foo<'_>, y| {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ --------------- found signature of `for<'r> fn(fn(&'r u32), _) -> _`
| |
| expected signature of `fn(for<'r> fn(&'r u32), &i32) -> _`
error: aborting due to 5 previous errors

View File

@ -1,16 +1,15 @@
error[E0631]: type mismatch in closure arguments
--> $DIR/expect-infer-var-appearing-twice.rs:14:5
|
LL | / fn with_closure<F, A>(_: F)
LL | | where F: FnOnce(A, A)
LL | | {
LL | | }
| |_- required by `with_closure`
LL | fn with_closure<F, A>(_: F)
| ------------
LL | where F: FnOnce(A, A)
| ------------ required by this bound in `with_closure`
...
LL | with_closure(|x: u32, y: i32| {
| ^^^^^^^^^^^^ ---------------- found signature of `fn(u32, i32) -> _`
| |
| expected signature of `fn(_, _) -> _`
LL | with_closure(|x: u32, y: i32| {
| ^^^^^^^^^^^^ ---------------- found signature of `fn(u32, i32) -> _`
| |
| expected signature of `fn(_, _) -> _`
error: aborting due to previous error

View File

@ -2,7 +2,7 @@ error[E0277]: `F` cannot be shared between threads safely
--> $DIR/closure-bounds-subtype.rs:13:22
|
LL | fn take_const_owned<F>(_: F) where F: FnOnce() + Sync + Send {
| ------------------------------------------------------------ required by `take_const_owned`
| ---------------- ---- required by this bound in `take_const_owned`
...
LL | take_const_owned(f);
| ^ `F` cannot be shared between threads safely

View File

@ -3,22 +3,30 @@ error[E0277]: `std::sync::mpsc::Receiver<()>` cannot be shared between threads s
|
LL | let t = thread::spawn(|| {
| ^^^^^^^^^^^^^ `std::sync::mpsc::Receiver<()>` cannot be shared between threads safely
|
::: $SRC_DIR/libstd/thread/mod.rs:LL:COL
|
LL | F: FnOnce() -> T, F: Send + 'static, T: Send + 'static
| ---- required by this bound in `std::thread::spawn`
|
= help: the trait `std::marker::Sync` is not implemented for `std::sync::mpsc::Receiver<()>`
= note: required because of the requirements on the impl of `std::marker::Send` for `&std::sync::mpsc::Receiver<()>`
= note: required because it appears within the type `[closure@$DIR/closure-move-sync.rs:6:27: 9:6 recv:&std::sync::mpsc::Receiver<()>]`
= note: required by `std::thread::spawn`
error[E0277]: `std::sync::mpsc::Sender<()>` cannot be shared between threads safely
--> $DIR/closure-move-sync.rs:18:5
|
LL | thread::spawn(|| tx.send(()).unwrap());
| ^^^^^^^^^^^^^ `std::sync::mpsc::Sender<()>` cannot be shared between threads safely
|
::: $SRC_DIR/libstd/thread/mod.rs:LL:COL
|
LL | F: FnOnce() -> T, F: Send + 'static, T: Send + 'static
| ---- required by this bound in `std::thread::spawn`
|
= help: the trait `std::marker::Sync` is not implemented for `std::sync::mpsc::Sender<()>`
= note: required because of the requirements on the impl of `std::marker::Send` for `&std::sync::mpsc::Sender<()>`
= note: required because it appears within the type `[closure@$DIR/closure-move-sync.rs:18:19: 18:42 tx:&std::sync::mpsc::Sender<()>]`
= note: required by `std::thread::spawn`
error: aborting due to 2 previous errors

View File

@ -19,7 +19,8 @@ trait ImplementedForUnitButNotNever {}
impl ImplementedForUnitButNotNever for () {}
fn foo<T: ImplementedForUnitButNotNever>(_t: T) {}
//~^ NOTE required by `foo`
//~^ NOTE required by this bound in `foo`
//~| NOTE
fn smeg() {
let _x = return;

View File

@ -1,8 +1,8 @@
error[E0277]: the trait bound `!: ImplementedForUnitButNotNever` is not satisfied
--> $DIR/defaulted-never-note.rs:26:5
--> $DIR/defaulted-never-note.rs:27:5
|
LL | fn foo<T: ImplementedForUnitButNotNever>(_t: T) {}
| ----------------------------------------------- required by `foo`
| --- ----------------------------- required by this bound in `foo`
...
LL | foo(_x);
| ^^^ the trait `ImplementedForUnitButNotNever` is not implemented for `!`

View File

@ -3,8 +3,11 @@ error[E0277]: the trait bound `Error: std::hash::Hash` is not satisfied
|
LL | x: Error
| ^^^^^^^^ the trait `std::hash::Hash` is not implemented for `Error`
|
::: $SRC_DIR/libcore/hash/mod.rs:LL:COL
|
= note: required by `std::hash::Hash::hash`
LL | fn hash<H: Hasher>(&self, state: &mut H);
| - required by this bound in `std::hash::Hash::hash`
error: aborting due to previous error

View File

@ -3,8 +3,11 @@ error[E0277]: the trait bound `Error: std::hash::Hash` is not satisfied
|
LL | Error
| ^^^^^ the trait `std::hash::Hash` is not implemented for `Error`
|
::: $SRC_DIR/libcore/hash/mod.rs:LL:COL
|
= note: required by `std::hash::Hash::hash`
LL | fn hash<H: Hasher>(&self, state: &mut H);
| - required by this bound in `std::hash::Hash::hash`
error: aborting due to previous error

View File

@ -3,8 +3,11 @@ error[E0277]: the trait bound `Error: std::hash::Hash` is not satisfied
|
LL | x: Error
| ^^^^^^^^ the trait `std::hash::Hash` is not implemented for `Error`
|
::: $SRC_DIR/libcore/hash/mod.rs:LL:COL
|
= note: required by `std::hash::Hash::hash`
LL | fn hash<H: Hasher>(&self, state: &mut H);
| - required by this bound in `std::hash::Hash::hash`
error: aborting due to previous error

View File

@ -3,8 +3,11 @@ error[E0277]: the trait bound `Error: std::hash::Hash` is not satisfied
|
LL | Error
| ^^^^^ the trait `std::hash::Hash` is not implemented for `Error`
|
::: $SRC_DIR/libcore/hash/mod.rs:LL:COL
|
= note: required by `std::hash::Hash::hash`
LL | fn hash<H: Hasher>(&self, state: &mut H);
| - required by this bound in `std::hash::Hash::hash`
error: aborting due to previous error

View File

@ -2,7 +2,7 @@ error[E0277]: the trait bound `C: std::marker::Copy` is not satisfied
--> $DIR/deriving-copyclone.rs:31:13
|
LL | fn is_copy<T: Copy>(_: T) {}
| ------------------------- required by `is_copy`
| ------- ---- required by this bound in `is_copy`
...
LL | is_copy(B { a: 1, b: C });
| ^^^^^^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `C`
@ -13,7 +13,7 @@ error[E0277]: the trait bound `C: std::clone::Clone` is not satisfied
--> $DIR/deriving-copyclone.rs:32:14
|
LL | fn is_clone<T: Clone>(_: T) {}
| --------------------------- required by `is_clone`
| -------- ----- required by this bound in `is_clone`
...
LL | is_clone(B { a: 1, b: C });
| ^^^^^^^^^^^^^^^^ the trait `std::clone::Clone` is not implemented for `C`
@ -24,7 +24,7 @@ error[E0277]: the trait bound `D: std::marker::Copy` is not satisfied
--> $DIR/deriving-copyclone.rs:35:13
|
LL | fn is_copy<T: Copy>(_: T) {}
| ------------------------- required by `is_copy`
| ------- ---- required by this bound in `is_copy`
...
LL | is_copy(B { a: 1, b: D });
| ^^^^^^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `D`

View File

@ -2,7 +2,7 @@ error[E0275]: overflow evaluating the requirement `J: std::marker::Send`
--> $DIR/recursion_limit.rs:34:5
|
LL | fn is_send<T:Send>() { }
| -------------------- required by `is_send`
| ------- ---- required by this bound in `is_send`
...
LL | is_send::<A>();
| ^^^^^^^^^^^^

View File

@ -2,7 +2,7 @@ error[E0271]: type mismatch resolving `<i8 as Trait>::AssociatedType == u32`
--> $DIR/E0271.rs:10:5
|
LL | fn foo<T>(t: T) where T: Trait<AssociatedType=u32> {
| -------------------------------------------------- required by `foo`
| --- ------------------ required by this bound in `foo`
...
LL | foo(3_i8);
| ^^^ expected reference, found u32

View File

@ -2,7 +2,7 @@ error[E0277]: `*const u8` cannot be sent between threads safely
--> $DIR/E0277-2.rs:16:5
|
LL | fn is_send<T: Send>() { }
| --------------------- required by `is_send`
| ------- ---- required by this bound in `is_send`
...
LL | is_send::<Foo>();
| ^^^^^^^^^^^^^^ `*const u8` cannot be sent between threads safely

View File

@ -14,7 +14,7 @@ error[E0277]: the trait bound `i32: Foo` is not satisfied
--> $DIR/E0277.rs:17:15
|
LL | fn some_func<T: Foo>(foo: T) {
| ---------------------------- required by `some_func`
| --------- --- required by this bound in `some_func`
...
LL | some_func(5i32);
| ^^^^ the trait `Foo` is not implemented for `i32`

View File

@ -2,7 +2,7 @@ error[E0277]: the trait bound `std::string::String: std::marker::Copy` is not sa
--> $DIR/error-should-say-copy-not-pod.rs:6:17
|
LL | fn check_bound<T:Copy>(_: T) {}
| ---------------------------- required by `check_bound`
| ----------- ---- required by this bound in `check_bound`
...
LL | check_bound("nocopy".to_string());
| ^^^^^^^^^^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `std::string::String`

View File

@ -2,7 +2,7 @@ error[E0277]: `A` cannot be shared between threads safely
--> $DIR/extern-types-not-sync-send.rs:13:5
|
LL | fn assert_sync<T: ?Sized + Sync>() { }
| ---------------------------------- required by `assert_sync`
| ----------- ---- required by this bound in `assert_sync`
...
LL | assert_sync::<A>();
| ^^^^^^^^^^^^^^^^ `A` cannot be shared between threads safely
@ -13,7 +13,7 @@ error[E0277]: `A` cannot be sent between threads safely
--> $DIR/extern-types-not-sync-send.rs:16:5
|
LL | fn assert_send<T: ?Sized + Send>() { }
| ---------------------------------- required by `assert_send`
| ----------- ---- required by this bound in `assert_send`
...
LL | assert_send::<A>();
| ^^^^^^^^^^^^^^^^ `A` cannot be sent between threads safely

View File

@ -2,7 +2,7 @@ error[E0277]: the size for values of type `A` cannot be known at compilation tim
--> $DIR/extern-types-unsized.rs:22:5
|
LL | fn assert_sized<T>() { }
| -------------------- required by `assert_sized`
| ------------ - required by this bound in `assert_sized`
...
LL | assert_sized::<A>();
| ^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
@ -14,7 +14,7 @@ error[E0277]: the size for values of type `A` cannot be known at compilation tim
--> $DIR/extern-types-unsized.rs:25:5
|
LL | fn assert_sized<T>() { }
| -------------------- required by `assert_sized`
| ------------ - required by this bound in `assert_sized`
...
LL | assert_sized::<Foo>();
| ^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
@ -27,7 +27,7 @@ error[E0277]: the size for values of type `A` cannot be known at compilation tim
--> $DIR/extern-types-unsized.rs:28:5
|
LL | fn assert_sized<T>() { }
| -------------------- required by `assert_sized`
| ------------ - required by this bound in `assert_sized`
...
LL | assert_sized::<Bar<A>>();
| ^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
@ -40,7 +40,7 @@ error[E0277]: the size for values of type `A` cannot be known at compilation tim
--> $DIR/extern-types-unsized.rs:31:5
|
LL | fn assert_sized<T>() { }
| -------------------- required by `assert_sized`
| ------------ - required by this bound in `assert_sized`
...
LL | assert_sized::<Bar<Bar<A>>>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time

View File

@ -2,7 +2,7 @@ error[E0277]: expected a `std::ops::Fn<()>` closure, found `extern "C" fn() {f}`
--> $DIR/extern-wrong-value-type.rs:9:11
|
LL | fn is_fn<F>(_: F) where F: Fn() {}
| ------------------------------- required by `is_fn`
| ----- ---- required by this bound in `is_fn`
...
LL | is_fn(f);
| ^ expected an `Fn<()>` closure, found `extern "C" fn() {f}`

View File

@ -2,7 +2,7 @@ error[E0277]: `*mut (dyn std::ops::Fn() + 'static)` cannot be shared between thr
--> $DIR/send-sync.rs:8:5
|
LL | fn send<T: Send>(_: T) {}
| ---------------------- required by `send`
| ---- ---- required by this bound in `send`
...
LL | send(format_args!("{:?}", c));
| ^^^^ `*mut (dyn std::ops::Fn() + 'static)` cannot be shared between threads safely
@ -20,7 +20,7 @@ error[E0277]: `*mut (dyn std::ops::Fn() + 'static)` cannot be shared between thr
--> $DIR/send-sync.rs:9:5
|
LL | fn sync<T: Sync>(_: T) {}
| ---------------------- required by `sync`
| ---- ---- required by this bound in `sync`
...
LL | sync(format_args!("{:?}", c));
| ^^^^ `*mut (dyn std::ops::Fn() + 'static)` cannot be shared between threads safely

View File

@ -29,7 +29,7 @@ error[E0277]: expected a `std::ops::Fn<(isize,)>` closure, found `{integer}`
--> $DIR/fn-trait-formatting.rs:19:14
|
LL | fn needs_fn<F>(x: F) where F: Fn(isize) -> isize {}
| ------------------------------------------------ required by `needs_fn`
| -------- ------------------ required by this bound in `needs_fn`
...
LL | needs_fn(1);
| ^ expected an `Fn<(isize,)>` closure, found `{integer}`

View File

@ -16,14 +16,13 @@ LL | | })
error[E0271]: type mismatch resolving `<[generator@$DIR/generator-yielding-or-returning-itself.rs:28:33: 32:6 _] as std::ops::Generator>::Yield == [generator@$DIR/generator-yielding-or-returning-itself.rs:28:33: 32:6 _]`
--> $DIR/generator-yielding-or-returning-itself.rs:28:5
|
LL | / pub fn want_cyclic_generator_yield<T>(_: T)
LL | | where T: Generator<Yield = T, Return = ()>
LL | | {
LL | | }
| |_- required by `want_cyclic_generator_yield`
LL | pub fn want_cyclic_generator_yield<T>(_: T)
| ---------------------------
LL | where T: Generator<Yield = T, Return = ()>
| --------- required by this bound in `want_cyclic_generator_yield`
...
LL | want_cyclic_generator_yield(|| {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ cyclic type of infinite size
LL | want_cyclic_generator_yield(|| {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ cyclic type of infinite size
|
= note: closures cannot capture themselves or take themselves as argument;
this error may be the result of a recent compiler bug-fix,

View File

@ -2,7 +2,7 @@ error[E0277]: `std::cell::Cell<i32>` cannot be shared between threads safely
--> $DIR/not-send-sync.rs:16:5
|
LL | fn assert_send<T: Send>(_: T) {}
| ----------------------------- required by `main::assert_send`
| ----------- ---- required by this bound in `main::assert_send`
...
LL | assert_send(|| {
| ^^^^^^^^^^^ `std::cell::Cell<i32>` cannot be shared between threads safely
@ -15,7 +15,7 @@ error[E0277]: `std::cell::Cell<i32>` cannot be shared between threads safely
--> $DIR/not-send-sync.rs:9:5
|
LL | fn assert_sync<T: Sync>(_: T) {}
| ----------------------------- required by `main::assert_sync`
| ----------- ---- required by this bound in `main::assert_sync`
...
LL | assert_sync(|| {
| ^^^^^^^^^^^ `std::cell::Cell<i32>` cannot be shared between threads safely

View File

@ -2,7 +2,7 @@ error[E0277]: the trait bound `[static generator@$DIR/static-not-unpin.rs:11:25:
--> $DIR/static-not-unpin.rs:14:18
|
LL | fn assert_unpin<T: Unpin>(_: T) {
| ------------------------------- required by `assert_unpin`
| ------------ ----- required by this bound in `assert_unpin`
...
LL | assert_unpin(generator);
| ^^^^^^^^^ the trait `std::marker::Unpin` is not implemented for `[static generator@$DIR/static-not-unpin.rs:11:25: 13:6 _]`

View File

@ -1,14 +1,13 @@
error[E0277]: the trait bound `for<'a, 'b> SomeStruct: Foo<(&'a isize, &'b isize)>` is not satisfied
--> $DIR/hrtb-conflate-regions.rs:27:10
|
LL | / fn want_foo2<T>()
LL | | where T : for<'a,'b> Foo<(&'a isize, &'b isize)>
LL | | {
LL | | }
| |_- required by `want_foo2`
LL | fn want_foo2<T>()
| ---------
LL | where T : for<'a,'b> Foo<(&'a isize, &'b isize)>
| -------------------------------------- required by this bound in `want_foo2`
...
LL | fn b() { want_foo2::<SomeStruct>(); }
| ^^^^^^^^^^^^^^^^^^^^^^^ the trait `for<'a, 'b> Foo<(&'a isize, &'b isize)>` is not implemented for `SomeStruct`
LL | fn b() { want_foo2::<SomeStruct>(); }
| ^^^^^^^^^^^^^^^^^^^^^^^ the trait `for<'a, 'b> Foo<(&'a isize, &'b isize)>` is not implemented for `SomeStruct`
|
= help: the following implementations were found:
<SomeStruct as Foo<(&'a isize, &'a isize)>>

View File

@ -1,15 +1,14 @@
error[E0277]: the trait bound `(): Trait<for<'b> fn(&'b u32)>` is not satisfied
--> $DIR/hrtb-exists-forall-trait-contravariant.rs:34:5
|
LL | / fn foo<T>()
LL | | where
LL | | T: Trait<for<'b> fn(&'b u32)>,
LL | | {
LL | | }
| |_- required by `foo`
LL | fn foo<T>()
| ---
LL | where
LL | T: Trait<for<'b> fn(&'b u32)>,
| -------------------------- required by this bound in `foo`
...
LL | foo::<()>();
| ^^^^^^^^^ the trait `Trait<for<'b> fn(&'b u32)>` is not implemented for `()`
LL | foo::<()>();
| ^^^^^^^^^ the trait `Trait<for<'b> fn(&'b u32)>` is not implemented for `()`
|
= help: the following implementations were found:
<() as Trait<fn(&'a u32)>>

View File

@ -1,15 +1,14 @@
error[E0277]: the trait bound `(): Trait<for<'b> fn(fn(&'b u32))>` is not satisfied
--> $DIR/hrtb-exists-forall-trait-covariant.rs:36:5
|
LL | / fn foo<T>()
LL | | where
LL | | T: Trait<for<'b> fn(fn(&'b u32))>,
LL | | {
LL | | }
| |_- required by `foo`
LL | fn foo<T>()
| ---
LL | where
LL | T: Trait<for<'b> fn(fn(&'b u32))>,
| ------------------------------ required by this bound in `foo`
...
LL | foo::<()>();
| ^^^^^^^^^ the trait `Trait<for<'b> fn(fn(&'b u32))>` is not implemented for `()`
LL | foo::<()>();
| ^^^^^^^^^ the trait `Trait<for<'b> fn(fn(&'b u32))>` is not implemented for `()`
|
= help: the following implementations were found:
<() as Trait<fn(fn(&'a u32))>>

View File

@ -1,15 +1,14 @@
error[E0277]: the trait bound `(): Trait<for<'b> fn(std::cell::Cell<&'b u32>)>` is not satisfied
--> $DIR/hrtb-exists-forall-trait-invariant.rs:28:5
|
LL | / fn foo<T>()
LL | | where
LL | | T: Trait<for<'b> fn(Cell<&'b u32>)>,
LL | | {
LL | | }
| |_- required by `foo`
LL | fn foo<T>()
| ---
LL | where
LL | T: Trait<for<'b> fn(Cell<&'b u32>)>,
| -------------------------------- required by this bound in `foo`
...
LL | foo::<()>();
| ^^^^^^^^^ the trait `Trait<for<'b> fn(std::cell::Cell<&'b u32>)>` is not implemented for `()`
LL | foo::<()>();
| ^^^^^^^^^ the trait `Trait<for<'b> fn(std::cell::Cell<&'b u32>)>` is not implemented for `()`
|
= help: the following implementations were found:
<() as Trait<fn(std::cell::Cell<&'a u32>)>>

View File

@ -1,14 +1,13 @@
error[E0277]: the trait bound `for<'ccx> B: Bar<'ccx>` is not satisfied
--> $DIR/hrtb-higher-ranker-supertraits-transitive.rs:47:26
|
LL | / fn want_bar_for_any_ccx<B>(b: &B)
LL | | where B : for<'ccx> Bar<'ccx>
LL | | {
LL | | }
| |_- required by `want_bar_for_any_ccx`
LL | fn want_bar_for_any_ccx<B>(b: &B)
| --------------------
LL | where B : for<'ccx> Bar<'ccx>
| ------------------- required by this bound in `want_bar_for_any_ccx`
...
LL | want_bar_for_any_ccx(b);
| ^ the trait `for<'ccx> Bar<'ccx>` is not implemented for `B`
LL | want_bar_for_any_ccx(b);
| ^ the trait `for<'ccx> Bar<'ccx>` is not implemented for `B`
|
= help: consider adding a `where for<'ccx> B: Bar<'ccx>` bound

View File

@ -1,33 +1,26 @@
error[E0277]: the trait bound `for<'tcx> F: Foo<'tcx>` is not satisfied
--> $DIR/hrtb-higher-ranker-supertraits.rs:18:26
|
LL | want_foo_for_any_tcx(f);
| ^ the trait `for<'tcx> Foo<'tcx>` is not implemented for `F`
LL | want_foo_for_any_tcx(f);
| ^ the trait `for<'tcx> Foo<'tcx>` is not implemented for `F`
...
LL | / fn want_foo_for_any_tcx<F>(f: &F)
LL | | where F : for<'tcx> Foo<'tcx>
LL | | {
LL | | want_foo_for_some_tcx(f);
LL | | want_foo_for_any_tcx(f);
LL | | }
| |_- required by `want_foo_for_any_tcx`
LL | fn want_foo_for_any_tcx<F>(f: &F)
| --------------------
LL | where F : for<'tcx> Foo<'tcx>
| ------------------- required by this bound in `want_foo_for_any_tcx`
|
= help: consider adding a `where for<'tcx> F: Foo<'tcx>` bound
error[E0277]: the trait bound `for<'ccx> B: Bar<'ccx>` is not satisfied
--> $DIR/hrtb-higher-ranker-supertraits.rs:35:26
|
LL | want_bar_for_any_ccx(b);
| ^ the trait `for<'ccx> Bar<'ccx>` is not implemented for `B`
LL | want_bar_for_any_ccx(b);
| ^ the trait `for<'ccx> Bar<'ccx>` is not implemented for `B`
...
LL | / fn want_bar_for_any_ccx<B>(b: &B)
LL | | where B : for<'ccx> Bar<'ccx>
LL | | {
LL | | want_foo_for_some_tcx(b);
... |
LL | | want_bar_for_any_ccx(b);
LL | | }
| |_- required by `want_bar_for_any_ccx`
LL | fn want_bar_for_any_ccx<B>(b: &B)
| --------------------
LL | where B : for<'ccx> Bar<'ccx>
| ------------------- required by this bound in `want_bar_for_any_ccx`
|
= help: consider adding a `where for<'ccx> B: Bar<'ccx>` bound

View File

@ -1,14 +1,13 @@
error[E0277]: the trait bound `for<'a> StaticInt: Foo<&'a isize>` is not satisfied
--> $DIR/hrtb-just-for-static.rs:24:5
|
LL | / fn want_hrtb<T>()
LL | | where T : for<'a> Foo<&'a isize>
LL | | {
LL | | }
| |_- required by `want_hrtb`
LL | fn want_hrtb<T>()
| ---------
LL | where T : for<'a> Foo<&'a isize>
| ---------------------- required by this bound in `want_hrtb`
...
LL | want_hrtb::<StaticInt>()
| ^^^^^^^^^^^^^^^^^^^^^^ the trait `for<'a> Foo<&'a isize>` is not implemented for `StaticInt`
LL | want_hrtb::<StaticInt>()
| ^^^^^^^^^^^^^^^^^^^^^^ the trait `for<'a> Foo<&'a isize>` is not implemented for `StaticInt`
|
= help: the following implementations were found:
<StaticInt as Foo<&'static isize>>
@ -16,14 +15,13 @@ LL | want_hrtb::<StaticInt>()
error[E0277]: the trait bound `for<'a> &'a u32: Foo<&'a isize>` is not satisfied
--> $DIR/hrtb-just-for-static.rs:30:5
|
LL | / fn want_hrtb<T>()
LL | | where T : for<'a> Foo<&'a isize>
LL | | {
LL | | }
| |_- required by `want_hrtb`
LL | fn want_hrtb<T>()
| ---------
LL | where T : for<'a> Foo<&'a isize>
| ---------------------- required by this bound in `want_hrtb`
...
LL | want_hrtb::<&'a u32>()
| ^^^^^^^^^^^^^^^^^^^^ the trait `for<'a> Foo<&'a isize>` is not implemented for `&'a u32`
LL | want_hrtb::<&'a u32>()
| ^^^^^^^^^^^^^^^^^^^^ the trait `for<'a> Foo<&'a isize>` is not implemented for `&'a u32`
|
= help: the following implementations were found:
<&'a u32 as Foo<&'a isize>>

View File

@ -2,7 +2,7 @@ error[E0277]: the trait bound `for<'r> fn(&'r i32): Foo` is not satisfied
--> $DIR/issue-46989.rs:40:5
|
LL | fn assert_foo<T: Foo>() {}
| ----------------------- required by `assert_foo`
| ---------- --- required by this bound in `assert_foo`
...
LL | assert_foo::<fn(&i32)>();
| ^^^^^^^^^^^^^^^^^^^^^^ the trait `Foo` is not implemented for `for<'r> fn(&'r i32)`

View File

@ -73,7 +73,7 @@ error[E0277]: `std::rc::Rc<std::string::String>` cannot be sent between threads
--> $DIR/auto-trait-leak.rs:15:5
|
LL | fn send<T: Send>(_: T) {}
| ---------------------- required by `send`
| ---- ---- required by this bound in `send`
...
LL | send(cycle2().clone());
| ^^^^ `std::rc::Rc<std::string::String>` cannot be sent between threads safely

View File

@ -2,7 +2,7 @@ error[E0277]: `std::rc::Rc<std::cell::Cell<i32>>` cannot be sent between threads
--> $DIR/auto-trait-leak2.rs:13:5
|
LL | fn send<T: Send>(_: T) {}
| ---------------------- required by `send`
| ---- ---- required by this bound in `send`
...
LL | send(before());
| ^^^^ `std::rc::Rc<std::cell::Cell<i32>>` cannot be sent between threads safely
@ -15,7 +15,7 @@ error[E0277]: `std::rc::Rc<std::cell::Cell<i32>>` cannot be sent between threads
--> $DIR/auto-trait-leak2.rs:16:5
|
LL | fn send<T: Send>(_: T) {}
| ---------------------- required by `send`
| ---- ---- required by this bound in `send`
...
LL | send(after());
| ^^^^ `std::rc::Rc<std::cell::Cell<i32>>` cannot be sent between threads safely

View File

@ -3,12 +3,16 @@ error[E0277]: the type `std::cell::UnsafeCell<i32>` may contain interior mutabil
|
LL | catch_unwind(|| { x.set(23); });
| ^^^^^^^^^^^^ `std::cell::UnsafeCell<i32>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
|
::: $SRC_DIR/libstd/panic.rs:LL:COL
|
LL | pub fn catch_unwind<F: FnOnce() -> R + UnwindSafe, R>(f: F) -> Result<R> {
| ---------- required by this bound in `std::panic::catch_unwind`
|
= help: within `std::cell::Cell<i32>`, the trait `std::panic::RefUnwindSafe` is not implemented for `std::cell::UnsafeCell<i32>`
= note: required because it appears within the type `std::cell::Cell<i32>`
= note: required because of the requirements on the impl of `std::panic::UnwindSafe` for `&std::cell::Cell<i32>`
= note: required because it appears within the type `[closure@$DIR/interior-mutability.rs:5:18: 5:35 x:&std::cell::Cell<i32>]`
= note: required by `std::panic::catch_unwind`
error: aborting due to previous error

View File

@ -2,7 +2,7 @@ error[E0277]: the trait bound `foo::issue_1920::S: std::clone::Clone` is not sat
--> $DIR/issue-1920-1.rs:12:5
|
LL | fn assert_clone<T>() where T : Clone { }
| ------------------------------------ required by `assert_clone`
| ------------ ----- required by this bound in `assert_clone`
...
LL | assert_clone::<foo::issue_1920::S>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::clone::Clone` is not implemented for `foo::issue_1920::S`

View File

@ -2,7 +2,7 @@ error[E0277]: the trait bound `bar::S: std::clone::Clone` is not satisfied
--> $DIR/issue-1920-2.rs:10:5
|
LL | fn assert_clone<T>() where T : Clone { }
| ------------------------------------ required by `assert_clone`
| ------------ ----- required by this bound in `assert_clone`
...
LL | assert_clone::<bar::S>();
| ^^^^^^^^^^^^^^^^^^^^^^ the trait `std::clone::Clone` is not implemented for `bar::S`

View File

@ -2,7 +2,7 @@ error[E0277]: the trait bound `issue_1920::S: std::clone::Clone` is not satisfie
--> $DIR/issue-1920-3.rs:14:5
|
LL | fn assert_clone<T>() where T : Clone { }
| ------------------------------------ required by `assert_clone`
| ------------ ----- required by this bound in `assert_clone`
...
LL | assert_clone::<foo::issue_1920::S>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::clone::Clone` is not implemented for `issue_1920::S`

View File

@ -3,8 +3,11 @@ error[E0277]: the trait bound `Bar: std::hash::Hash` is not satisfied
|
LL | struct Foo(Bar);
| ^^^ the trait `std::hash::Hash` is not implemented for `Bar`
|
::: $SRC_DIR/libcore/hash/mod.rs:LL:COL
|
= note: required by `std::hash::Hash::hash`
LL | fn hash<H: Hasher>(&self, state: &mut H);
| - required by this bound in `std::hash::Hash::hash`
error: aborting due to previous error

View File

@ -2,7 +2,7 @@ error[E0277]: `std::rc::Rc<()>` cannot be sent between threads safely
--> $DIR/issue-21763.rs:9:5
|
LL | fn foo<T: Send>() {}
| ----------------- required by `foo`
| --- ---- required by this bound in `foo`
...
LL | foo::<HashMap<Rc<()>, Rc<()>>>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `std::rc::Rc<()>` cannot be sent between threads safely

View File

@ -2,7 +2,7 @@ error[E0277]: the trait bound `(): InOut<_>` is not satisfied
--> $DIR/issue-25076.rs:10:20
|
LL | fn do_fold<B, F: InOut<B, Out=B>>(init: B, f: F) {}
| ------------------------------------------------ required by `do_fold`
| ------- --------------- required by this bound in `do_fold`
...
LL | do_fold(bot(), ());
| ^^ the trait `InOut<_>` is not implemented for `()`

View File

@ -13,7 +13,7 @@ error[E0277]: the trait bound `dyn Misc: std::marker::Copy` is not satisfied
--> $DIR/issue-32963.rs:8:5
|
LL | fn size_of_copy<T: Copy+?Sized>() -> usize { mem::size_of::<T>() }
| ------------------------------------------ required by `size_of_copy`
| ------------ ---- required by this bound in `size_of_copy`
...
LL | size_of_copy::<dyn Misc + Copy>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `dyn Misc`

View File

@ -2,7 +2,7 @@ error[E0277]: `std::rc::Rc<Foo>` cannot be sent between threads safely
--> $DIR/issue-40827.rs:14:5
|
LL | fn f<T: Send>(_: T) {}
| ------------------- required by `f`
| - ---- required by this bound in `f`
...
LL | f(Foo(Arc::new(Bar::B(None))));
| ^ `std::rc::Rc<Foo>` cannot be sent between threads safely
@ -16,7 +16,7 @@ error[E0277]: `std::rc::Rc<Foo>` cannot be shared between threads safely
--> $DIR/issue-40827.rs:14:5
|
LL | fn f<T: Send>(_: T) {}
| ------------------- required by `f`
| - ---- required by this bound in `f`
...
LL | f(Foo(Arc::new(Bar::B(None))));
| ^ `std::rc::Rc<Foo>` cannot be shared between threads safely

View File

@ -1,31 +1,27 @@
error[E0631]: type mismatch in function arguments
--> $DIR/issue-43623.rs:14:5
|
LL | / pub fn break_me<T, F>(f: F)
LL | | where T: for<'b> Trait<'b>,
LL | | F: for<'b> FnMut(<T as Trait<'b>>::Assoc) {
LL | | break_me::<Type, fn(_)>;
| | ^^^^^^^^^^^^^^^^^^^^^^^
| | |
| | expected signature of `for<'b> fn(<Type as Trait<'b>>::Assoc) -> _`
| | found signature of `fn(_) -> _`
LL | |
LL | |
LL | | }
| |_- required by `break_me`
LL | pub fn break_me<T, F>(f: F)
| --------
LL | where T: for<'b> Trait<'b>,
LL | F: for<'b> FnMut(<T as Trait<'b>>::Assoc) {
| -------------------------------------- required by this bound in `break_me`
LL | break_me::<Type, fn(_)>;
| ^^^^^^^^^^^^^^^^^^^^^^^
| |
| expected signature of `for<'b> fn(<Type as Trait<'b>>::Assoc) -> _`
| found signature of `fn(_) -> _`
error[E0271]: type mismatch resolving `for<'b> <fn(_) as std::ops::FnOnce<(<Type as Trait<'b>>::Assoc,)>>::Output == ()`
--> $DIR/issue-43623.rs:14:5
|
LL | / pub fn break_me<T, F>(f: F)
LL | | where T: for<'b> Trait<'b>,
LL | | F: for<'b> FnMut(<T as Trait<'b>>::Assoc) {
LL | | break_me::<Type, fn(_)>;
| | ^^^^^^^^^^^^^^^^^^^^^^^ expected bound lifetime parameter 'b, found concrete lifetime
LL | |
LL | |
LL | | }
| |_- required by `break_me`
LL | pub fn break_me<T, F>(f: F)
| --------
LL | where T: for<'b> Trait<'b>,
LL | F: for<'b> FnMut(<T as Trait<'b>>::Assoc) {
| ------------------------- required by this bound in `break_me`
LL | break_me::<Type, fn(_)>;
| ^^^^^^^^^^^^^^^^^^^^^^^ expected bound lifetime parameter 'b, found concrete lifetime
error: aborting due to 2 previous errors

View File

@ -10,18 +10,17 @@ LL | self.foo.map(Foo::new)
error[E0593]: function is expected to take 0 arguments, but it takes 1 argument
--> $DIR/issue-47706.rs:27:9
|
LL | Bar(i32),
| -------- takes 1 argument
LL | Bar(i32),
| -------- takes 1 argument
...
LL | / fn foo<F>(f: F)
LL | | where
LL | | F: Fn(),
LL | | {
LL | | }
| |_- required by `foo`
LL | fn foo<F>(f: F)
| ---
LL | where
LL | F: Fn(),
| ---- required by this bound in `foo`
...
LL | foo(Qux::Bar);
| ^^^^^^^^ expected function that takes 0 arguments
LL | foo(Qux::Bar);
| ^^^^^^^^ expected function that takes 0 arguments
error: aborting due to 2 previous errors

View File

@ -1,27 +1,29 @@
error[E0631]: type mismatch in function arguments
--> $DIR/issue-60283.rs:14:13
|
LL | / pub fn foo<T, F>(_: T, _: F)
LL | | where T: for<'a> Trait<'a>,
LL | | F: for<'a> FnMut(<T as Trait<'a>>::Item) {}
| |_________________________________________________- required by `foo`
LL | pub fn foo<T, F>(_: T, _: F)
| ---
LL | where T: for<'a> Trait<'a>,
LL | F: for<'a> FnMut(<T as Trait<'a>>::Item) {}
| ------------------------------------- required by this bound in `foo`
...
LL | foo((), drop)
| ^^^^
| |
| expected signature of `for<'a> fn(<() as Trait<'a>>::Item) -> _`
| found signature of `fn(_) -> _`
LL | foo((), drop)
| ^^^^
| |
| expected signature of `for<'a> fn(<() as Trait<'a>>::Item) -> _`
| found signature of `fn(_) -> _`
error[E0271]: type mismatch resolving `for<'a> <fn(_) {std::mem::drop::<_>} as std::ops::FnOnce<(<() as Trait<'a>>::Item,)>>::Output == ()`
--> $DIR/issue-60283.rs:14:5
|
LL | / pub fn foo<T, F>(_: T, _: F)
LL | | where T: for<'a> Trait<'a>,
LL | | F: for<'a> FnMut(<T as Trait<'a>>::Item) {}
| |_________________________________________________- required by `foo`
LL | pub fn foo<T, F>(_: T, _: F)
| ---
LL | where T: for<'a> Trait<'a>,
LL | F: for<'a> FnMut(<T as Trait<'a>>::Item) {}
| ------------------------ required by this bound in `foo`
...
LL | foo((), drop)
| ^^^ expected bound lifetime parameter 'a, found concrete lifetime
LL | foo((), drop)
| ^^^ expected bound lifetime parameter 'a, found concrete lifetime
error: aborting due to 2 previous errors

View File

@ -2,7 +2,7 @@ error[E0277]: the trait bound `&'static mut isize: std::marker::Copy` is not sat
--> $DIR/kindck-copy.rs:27:5
|
LL | fn assert_copy<T:Copy>() { }
| ------------------------ required by `assert_copy`
| ----------- ---- required by this bound in `assert_copy`
...
LL | assert_copy::<&'static mut isize>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `&'static mut isize`
@ -14,7 +14,7 @@ error[E0277]: the trait bound `&'a mut isize: std::marker::Copy` is not satisfie
--> $DIR/kindck-copy.rs:28:5
|
LL | fn assert_copy<T:Copy>() { }
| ------------------------ required by `assert_copy`
| ----------- ---- required by this bound in `assert_copy`
...
LL | assert_copy::<&'a mut isize>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `&'a mut isize`
@ -26,7 +26,7 @@ error[E0277]: the trait bound `std::boxed::Box<isize>: std::marker::Copy` is not
--> $DIR/kindck-copy.rs:31:5
|
LL | fn assert_copy<T:Copy>() { }
| ------------------------ required by `assert_copy`
| ----------- ---- required by this bound in `assert_copy`
...
LL | assert_copy::<Box<isize>>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `std::boxed::Box<isize>`
@ -35,7 +35,7 @@ error[E0277]: the trait bound `std::string::String: std::marker::Copy` is not sa
--> $DIR/kindck-copy.rs:32:5
|
LL | fn assert_copy<T:Copy>() { }
| ------------------------ required by `assert_copy`
| ----------- ---- required by this bound in `assert_copy`
...
LL | assert_copy::<String>();
| ^^^^^^^^^^^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `std::string::String`
@ -44,7 +44,7 @@ error[E0277]: the trait bound `std::vec::Vec<isize>: std::marker::Copy` is not s
--> $DIR/kindck-copy.rs:33:5
|
LL | fn assert_copy<T:Copy>() { }
| ------------------------ required by `assert_copy`
| ----------- ---- required by this bound in `assert_copy`
...
LL | assert_copy::<Vec<isize> >();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `std::vec::Vec<isize>`
@ -53,7 +53,7 @@ error[E0277]: the trait bound `std::boxed::Box<&'a mut isize>: std::marker::Copy
--> $DIR/kindck-copy.rs:34:5
|
LL | fn assert_copy<T:Copy>() { }
| ------------------------ required by `assert_copy`
| ----------- ---- required by this bound in `assert_copy`
...
LL | assert_copy::<Box<&'a mut isize>>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `std::boxed::Box<&'a mut isize>`
@ -62,7 +62,7 @@ error[E0277]: the trait bound `std::boxed::Box<dyn Dummy>: std::marker::Copy` is
--> $DIR/kindck-copy.rs:42:5
|
LL | fn assert_copy<T:Copy>() { }
| ------------------------ required by `assert_copy`
| ----------- ---- required by this bound in `assert_copy`
...
LL | assert_copy::<Box<dyn Dummy>>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `std::boxed::Box<dyn Dummy>`
@ -71,7 +71,7 @@ error[E0277]: the trait bound `std::boxed::Box<dyn Dummy + std::marker::Send>: s
--> $DIR/kindck-copy.rs:43:5
|
LL | fn assert_copy<T:Copy>() { }
| ------------------------ required by `assert_copy`
| ----------- ---- required by this bound in `assert_copy`
...
LL | assert_copy::<Box<dyn Dummy + Send>>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `std::boxed::Box<dyn Dummy + std::marker::Send>`
@ -80,7 +80,7 @@ error[E0277]: the trait bound `&'a mut (dyn Dummy + std::marker::Send + 'a): std
--> $DIR/kindck-copy.rs:46:5
|
LL | fn assert_copy<T:Copy>() { }
| ------------------------ required by `assert_copy`
| ----------- ---- required by this bound in `assert_copy`
...
LL | assert_copy::<&'a mut (dyn Dummy + Send)>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `&'a mut (dyn Dummy + std::marker::Send + 'a)`
@ -89,7 +89,7 @@ error[E0277]: the trait bound `MyNoncopyStruct: std::marker::Copy` is not satisf
--> $DIR/kindck-copy.rs:64:5
|
LL | fn assert_copy<T:Copy>() { }
| ------------------------ required by `assert_copy`
| ----------- ---- required by this bound in `assert_copy`
...
LL | assert_copy::<MyNoncopyStruct>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `MyNoncopyStruct`
@ -98,7 +98,7 @@ error[E0277]: the trait bound `std::rc::Rc<isize>: std::marker::Copy` is not sat
--> $DIR/kindck-copy.rs:67:5
|
LL | fn assert_copy<T:Copy>() { }
| ------------------------ required by `assert_copy`
| ----------- ---- required by this bound in `assert_copy`
...
LL | assert_copy::<Rc<isize>>();
| ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `std::rc::Rc<isize>`

View File

@ -2,7 +2,7 @@ error[E0277]: the trait bound `std::boxed::Box<{integer}>: std::marker::Copy` is
--> $DIR/kindck-impl-type-params-2.rs:13:16
|
LL | fn take_param<T:Foo>(foo: &T) { }
| ----------------------------- required by `take_param`
| ---------- --- required by this bound in `take_param`
...
LL | take_param(&x);
| ^^ the trait `std::marker::Copy` is not implemented for `std::boxed::Box<{integer}>`

View File

@ -2,7 +2,7 @@ error[E0277]: the trait bound `std::boxed::Box<{integer}>: std::marker::Copy` is
--> $DIR/kindck-inherited-copy-bound.rs:18:16
|
LL | fn take_param<T:Foo>(foo: &T) { }
| ----------------------------- required by `take_param`
| ---------- --- required by this bound in `take_param`
...
LL | take_param(&x);
| ^^ the trait `std::marker::Copy` is not implemented for `std::boxed::Box<{integer}>`

View File

@ -2,7 +2,7 @@ error[E0277]: `std::rc::Rc<usize>` cannot be sent between threads safely
--> $DIR/kindck-nonsendable-1.rs:9:5
|
LL | fn bar<F:FnOnce() + Send>(_: F) { }
| ------------------------------- required by `bar`
| --- ---- required by this bound in `bar`
...
LL | bar(move|| foo(x));
| ^^^ `std::rc::Rc<usize>` cannot be sent between threads safely

View File

@ -2,7 +2,7 @@ error[E0277]: `(dyn Dummy + 'static)` cannot be shared between threads safely
--> $DIR/kindck-send-object.rs:12:5
|
LL | fn assert_send<T:Send>() { }
| ------------------------ required by `assert_send`
| ----------- ---- required by this bound in `assert_send`
...
LL | assert_send::<&'static (dyn Dummy + 'static)>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `(dyn Dummy + 'static)` cannot be shared between threads safely
@ -14,7 +14,7 @@ error[E0277]: `dyn Dummy` cannot be sent between threads safely
--> $DIR/kindck-send-object.rs:17:5
|
LL | fn assert_send<T:Send>() { }
| ------------------------ required by `assert_send`
| ----------- ---- required by this bound in `assert_send`
...
LL | assert_send::<Box<dyn Dummy>>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `dyn Dummy` cannot be sent between threads safely

View File

@ -2,7 +2,7 @@ error[E0277]: `(dyn Dummy + 'a)` cannot be shared between threads safely
--> $DIR/kindck-send-object1.rs:10:5
|
LL | fn assert_send<T:Send+'static>() { }
| -------------------------------- required by `assert_send`
| ----------- ---- required by this bound in `assert_send`
...
LL | assert_send::<&'a dyn Dummy>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `(dyn Dummy + 'a)` cannot be shared between threads safely
@ -22,7 +22,7 @@ error[E0277]: `(dyn Dummy + 'a)` cannot be sent between threads safely
--> $DIR/kindck-send-object1.rs:29:5
|
LL | fn assert_send<T:Send+'static>() { }
| -------------------------------- required by `assert_send`
| ----------- ---- required by this bound in `assert_send`
...
LL | assert_send::<Box<dyn Dummy + 'a>>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `(dyn Dummy + 'a)` cannot be sent between threads safely

View File

@ -2,7 +2,7 @@ error[E0277]: `(dyn Dummy + 'static)` cannot be shared between threads safely
--> $DIR/kindck-send-object2.rs:7:5
|
LL | fn assert_send<T:Send>() { }
| ------------------------ required by `assert_send`
| ----------- ---- required by this bound in `assert_send`
...
LL | assert_send::<&'static dyn Dummy>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `(dyn Dummy + 'static)` cannot be shared between threads safely
@ -14,7 +14,7 @@ error[E0277]: `dyn Dummy` cannot be sent between threads safely
--> $DIR/kindck-send-object2.rs:12:5
|
LL | fn assert_send<T:Send>() { }
| ------------------------ required by `assert_send`
| ----------- ---- required by this bound in `assert_send`
...
LL | assert_send::<Box<dyn Dummy>>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `dyn Dummy` cannot be sent between threads safely

View File

@ -2,7 +2,7 @@ error[E0277]: `*mut u8` cannot be sent between threads safely
--> $DIR/kindck-send-owned.rs:12:5
|
LL | fn assert_send<T:Send>() { }
| ------------------------ required by `assert_send`
| ----------- ---- required by this bound in `assert_send`
...
LL | assert_send::<Box<*mut u8>>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ `*mut u8` cannot be sent between threads safely

View File

@ -2,7 +2,7 @@ error[E0277]: `*mut &'a isize` cannot be sent between threads safely
--> $DIR/kindck-send-unsafe.rs:6:5
|
LL | fn assert_send<T:Send>() { }
| ------------------------ required by `assert_send`
| ----------- ---- required by this bound in `assert_send`
...
LL | assert_send::<*mut &'a isize>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `*mut &'a isize` cannot be sent between threads safely

View File

@ -2,7 +2,7 @@ error[E0277]: the trait bound `NotDebugOrDisplay: Marker` is not satisfied
--> $DIR/overlap-marker-trait.rs:27:5
|
LL | fn is_marker<T: Marker>() { }
| ------------------------- required by `is_marker`
| --------- ------ required by this bound in `is_marker`
...
LL | is_marker::<NotDebugOrDisplay>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Marker` is not implemented for `NotDebugOrDisplay`

View File

@ -2,7 +2,7 @@ error[E0631]: type mismatch in closure arguments
--> $DIR/E0631.rs:7:5
|
LL | fn foo<F: Fn(usize)>(_: F) {}
| -------------------------- required by `foo`
| --- --------- required by this bound in `foo`
...
LL | foo(|_: isize| {});
| ^^^ ---------- found signature of `fn(isize) -> _`
@ -13,7 +13,7 @@ error[E0631]: type mismatch in closure arguments
--> $DIR/E0631.rs:8:5
|
LL | fn bar<F: Fn<usize>>(_: F) {}
| -------------------------- required by `bar`
| --- --------- required by this bound in `bar`
...
LL | bar(|_: isize| {});
| ^^^ ---------- found signature of `fn(isize) -> _`
@ -24,7 +24,7 @@ error[E0631]: type mismatch in function arguments
--> $DIR/E0631.rs:9:9
|
LL | fn foo<F: Fn(usize)>(_: F) {}
| -------------------------- required by `foo`
| --- --------- required by this bound in `foo`
...
LL | fn f(_: u64) {}
| ------------ found signature of `fn(u64) -> _`
@ -36,7 +36,7 @@ error[E0631]: type mismatch in function arguments
--> $DIR/E0631.rs:10:9
|
LL | fn bar<F: Fn<usize>>(_: F) {}
| -------------------------- required by `bar`
| --- --------- required by this bound in `bar`
LL | fn main() {
LL | fn f(_: u64) {}
| ------------ found signature of `fn(u64) -> _`

View File

@ -46,7 +46,7 @@ error[E0593]: closure is expected to take 1 argument, but it takes 0 arguments
--> $DIR/closure-arg-count.rs:13:5
|
LL | fn f<F: Fn<usize>>(_: F) {}
| ------------------------ required by `f`
| - --------- required by this bound in `f`
...
LL | f(|| panic!());
| ^ -- takes 0 arguments
@ -61,7 +61,7 @@ error[E0593]: closure is expected to take 1 argument, but it takes 0 arguments
--> $DIR/closure-arg-count.rs:15:5
|
LL | fn f<F: Fn<usize>>(_: F) {}
| ------------------------ required by `f`
| - --------- required by this bound in `f`
...
LL | f( move || panic!());
| ^ ---------- takes 0 arguments
@ -143,7 +143,7 @@ LL | call(Foo);
| ^^^ expected function that takes 0 arguments
...
LL | fn call<F, R>(_: F) where F: FnOnce() -> R {}
| ------------------------------------------ required by `call`
| ---- ------------- required by this bound in `call`
LL | struct Foo(u8);
| --------------- takes 1 argument

View File

@ -26,7 +26,7 @@ error[E0631]: type mismatch in function arguments
--> $DIR/closure-arg-type-mismatch.rs:10:9
|
LL | fn baz<F: Fn(*mut &u32)>(_: F) {}
| ------------------------------ required by `baz`
| --- ------------- required by this bound in `baz`
LL | fn _test<'a>(f: fn(*mut &'a u32)) {
LL | baz(f);
| ^
@ -38,7 +38,7 @@ error[E0271]: type mismatch resolving `for<'r> <fn(*mut &'a u32) as std::ops::Fn
--> $DIR/closure-arg-type-mismatch.rs:10:5
|
LL | fn baz<F: Fn(*mut &u32)>(_: F) {}
| ------------------------------ required by `baz`
| --- ----------- required by this bound in `baz`
LL | fn _test<'a>(f: fn(*mut &'a u32)) {
LL | baz(f);
| ^^^ expected bound lifetime parameter, found concrete lifetime

View File

@ -2,7 +2,7 @@ error[E0271]: type mismatch resolving `for<'r> <[closure@$DIR/closure-mismatch.r
--> $DIR/closure-mismatch.rs:8:5
|
LL | fn baz<T: Foo>(_: T) {}
| -------------------- required by `baz`
| --- --- required by this bound in `baz`
...
LL | baz(|_| ());
| ^^^ expected bound lifetime parameter, found concrete lifetime
@ -13,7 +13,7 @@ error[E0631]: type mismatch in closure arguments
--> $DIR/closure-mismatch.rs:8:5
|
LL | fn baz<T: Foo>(_: T) {}
| -------------------- required by `baz`
| --- --- required by this bound in `baz`
...
LL | baz(|_| ());
| ^^^ ------ found signature of `fn(_) -> _`

View File

@ -5,7 +5,7 @@ LL | fn takes_mut(x: &mut isize) { }
| --------------------------- found signature of `for<'r> fn(&'r mut isize) -> _`
LL |
LL | fn apply<T, F>(t: T, f: F) where F: FnOnce(T) {
| --------------------------------------------- required by `apply`
| ----- --------- required by this bound in `apply`
...
LL | apply(&3, takes_mut);
| ^^^^^^^^^ expected signature of `fn(&{integer}) -> _`
@ -17,7 +17,7 @@ LL | fn takes_imm(x: &isize) { }
| ----------------------- found signature of `for<'r> fn(&'r isize) -> _`
...
LL | fn apply<T, F>(t: T, f: F) where F: FnOnce(T) {
| --------------------------------------------- required by `apply`
| ----- --------- required by this bound in `apply`
...
LL | apply(&mut 3, takes_imm);
| ^^^^^^^^^ expected signature of `fn(&mut {integer}) -> _`

View File

@ -5,7 +5,8 @@ use std::ops::FnMut;
fn to_fn_mut<A,F:FnMut<A>>(f: F) -> F { f }
fn call_it<F:FnMut(isize,isize)->isize>(y: isize, mut f: F) -> isize {
//~^ NOTE required by `call_it`
//~^ NOTE required by this bound in `call_it`
//~| NOTE
f(2, y)
}

View File

@ -1,8 +1,8 @@
error[E0631]: type mismatch in closure arguments
--> $DIR/unboxed-closures-vtable-mismatch.rs:15:24
--> $DIR/unboxed-closures-vtable-mismatch.rs:16:13
|
LL | fn call_it<F:FnMut(isize,isize)->isize>(y: isize, mut f: F) -> isize {
| -------------------------------------------------------------------- required by `call_it`
| ------- ------------------------- required by this bound in `call_it`
...
LL | let f = to_fn_mut(|x: usize, y: isize| -> isize { (x as isize) + y });
| ----------------------------- found signature of `fn(usize, isize) -> _`

View File

@ -2,7 +2,7 @@ error[E0277]: `NoSync` cannot be shared between threads safely
--> $DIR/mutable-enum-indirect.rs:17:5
|
LL | fn bar<T: Sync>(_: T) {}
| --------------------- required by `bar`
| --- ---- required by this bound in `bar`
...
LL | bar(&x);
| ^^^ `NoSync` cannot be shared between threads safely

View File

@ -2,7 +2,7 @@ error[E0277]: `std::cell::Cell<i32>` cannot be shared between threads safely
--> $DIR/mutexguard-sync.rs:11:15
|
LL | fn test_sync<T: Sync>(_t: T) {}
| ---------------------------- required by `test_sync`
| --------- ---- required by this bound in `test_sync`
...
LL | test_sync(guard);
| ^^^^^ `std::cell::Cell<i32>` cannot be shared between threads safely

View File

@ -70,7 +70,7 @@ error[E0277]: the trait bound `c::Item: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:33:11
|
LL | fn check<T: Impossible>(_: T) {}
| ----------------------------- required by `check`
| ----- ---------- required by this bound in `check`
...
LL | check(m1::S{});
| ^^^^^^^ the trait `Impossible` is not implemented for `c::Item`
@ -79,7 +79,7 @@ error[E0277]: the trait bound `c::S: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:35:11
|
LL | fn check<T: Impossible>(_: T) {}
| ----------------------------- required by `check`
| ----- ---------- required by this bound in `check`
...
LL | check(m2::S{});
| ^^^^^^^ the trait `Impossible` is not implemented for `c::S`
@ -88,7 +88,7 @@ error[E0277]: the trait bound `c::Item: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:36:11
|
LL | fn check<T: Impossible>(_: T) {}
| ----------------------------- required by `check`
| ----- ---------- required by this bound in `check`
...
LL | check(m2::S);
| ^^^^^ the trait `Impossible` is not implemented for `c::Item`
@ -97,7 +97,7 @@ error[E0277]: the trait bound `namespace_mix::c::Item: Impossible` is not satisf
--> $DIR/namespace-mix.rs:39:11
|
LL | fn check<T: Impossible>(_: T) {}
| ----------------------------- required by `check`
| ----- ---------- required by this bound in `check`
...
LL | check(xm1::S{});
| ^^^^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::Item`
@ -106,7 +106,7 @@ error[E0277]: the trait bound `namespace_mix::c::S: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:41:11
|
LL | fn check<T: Impossible>(_: T) {}
| ----------------------------- required by `check`
| ----- ---------- required by this bound in `check`
...
LL | check(xm2::S{});
| ^^^^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::S`
@ -115,7 +115,7 @@ error[E0277]: the trait bound `namespace_mix::c::Item: Impossible` is not satisf
--> $DIR/namespace-mix.rs:42:11
|
LL | fn check<T: Impossible>(_: T) {}
| ----------------------------- required by `check`
| ----- ---------- required by this bound in `check`
...
LL | check(xm2::S);
| ^^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::Item`
@ -124,7 +124,7 @@ error[E0277]: the trait bound `c::Item: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:55:11
|
LL | fn check<T: Impossible>(_: T) {}
| ----------------------------- required by `check`
| ----- ---------- required by this bound in `check`
...
LL | check(m3::TS{});
| ^^^^^^^^ the trait `Impossible` is not implemented for `c::Item`
@ -133,7 +133,7 @@ error[E0277]: the trait bound `fn() -> c::TS {c::TS}: Impossible` is not satisfi
--> $DIR/namespace-mix.rs:56:11
|
LL | fn check<T: Impossible>(_: T) {}
| ----------------------------- required by `check`
| ----- ---------- required by this bound in `check`
...
LL | check(m3::TS);
| ^^^^^^ the trait `Impossible` is not implemented for `fn() -> c::TS {c::TS}`
@ -142,7 +142,7 @@ error[E0277]: the trait bound `c::TS: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:57:11
|
LL | fn check<T: Impossible>(_: T) {}
| ----------------------------- required by `check`
| ----- ---------- required by this bound in `check`
...
LL | check(m4::TS{});
| ^^^^^^^^ the trait `Impossible` is not implemented for `c::TS`
@ -151,7 +151,7 @@ error[E0277]: the trait bound `c::Item: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:58:11
|
LL | fn check<T: Impossible>(_: T) {}
| ----------------------------- required by `check`
| ----- ---------- required by this bound in `check`
...
LL | check(m4::TS);
| ^^^^^^ the trait `Impossible` is not implemented for `c::Item`
@ -160,7 +160,7 @@ error[E0277]: the trait bound `namespace_mix::c::Item: Impossible` is not satisf
--> $DIR/namespace-mix.rs:61:11
|
LL | fn check<T: Impossible>(_: T) {}
| ----------------------------- required by `check`
| ----- ---------- required by this bound in `check`
...
LL | check(xm3::TS{});
| ^^^^^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::Item`
@ -169,7 +169,7 @@ error[E0277]: the trait bound `fn() -> namespace_mix::c::TS {namespace_mix::c::T
--> $DIR/namespace-mix.rs:62:11
|
LL | fn check<T: Impossible>(_: T) {}
| ----------------------------- required by `check`
| ----- ---------- required by this bound in `check`
...
LL | check(xm3::TS);
| ^^^^^^^ the trait `Impossible` is not implemented for `fn() -> namespace_mix::c::TS {namespace_mix::c::TS}`
@ -178,7 +178,7 @@ error[E0277]: the trait bound `namespace_mix::c::TS: Impossible` is not satisfie
--> $DIR/namespace-mix.rs:63:11
|
LL | fn check<T: Impossible>(_: T) {}
| ----------------------------- required by `check`
| ----- ---------- required by this bound in `check`
...
LL | check(xm4::TS{});
| ^^^^^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::TS`
@ -187,7 +187,7 @@ error[E0277]: the trait bound `namespace_mix::c::Item: Impossible` is not satisf
--> $DIR/namespace-mix.rs:64:11
|
LL | fn check<T: Impossible>(_: T) {}
| ----------------------------- required by `check`
| ----- ---------- required by this bound in `check`
...
LL | check(xm4::TS);
| ^^^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::Item`
@ -196,7 +196,7 @@ error[E0277]: the trait bound `c::Item: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:77:11
|
LL | fn check<T: Impossible>(_: T) {}
| ----------------------------- required by `check`
| ----- ---------- required by this bound in `check`
...
LL | check(m5::US{});
| ^^^^^^^^ the trait `Impossible` is not implemented for `c::Item`
@ -205,7 +205,7 @@ error[E0277]: the trait bound `c::US: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:78:11
|
LL | fn check<T: Impossible>(_: T) {}
| ----------------------------- required by `check`
| ----- ---------- required by this bound in `check`
...
LL | check(m5::US);
| ^^^^^^ the trait `Impossible` is not implemented for `c::US`
@ -214,7 +214,7 @@ error[E0277]: the trait bound `c::US: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:79:11
|
LL | fn check<T: Impossible>(_: T) {}
| ----------------------------- required by `check`
| ----- ---------- required by this bound in `check`
...
LL | check(m6::US{});
| ^^^^^^^^ the trait `Impossible` is not implemented for `c::US`
@ -223,7 +223,7 @@ error[E0277]: the trait bound `c::Item: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:80:11
|
LL | fn check<T: Impossible>(_: T) {}
| ----------------------------- required by `check`
| ----- ---------- required by this bound in `check`
...
LL | check(m6::US);
| ^^^^^^ the trait `Impossible` is not implemented for `c::Item`
@ -232,7 +232,7 @@ error[E0277]: the trait bound `namespace_mix::c::Item: Impossible` is not satisf
--> $DIR/namespace-mix.rs:83:11
|
LL | fn check<T: Impossible>(_: T) {}
| ----------------------------- required by `check`
| ----- ---------- required by this bound in `check`
...
LL | check(xm5::US{});
| ^^^^^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::Item`
@ -241,7 +241,7 @@ error[E0277]: the trait bound `namespace_mix::c::US: Impossible` is not satisfie
--> $DIR/namespace-mix.rs:84:11
|
LL | fn check<T: Impossible>(_: T) {}
| ----------------------------- required by `check`
| ----- ---------- required by this bound in `check`
...
LL | check(xm5::US);
| ^^^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::US`
@ -250,7 +250,7 @@ error[E0277]: the trait bound `namespace_mix::c::US: Impossible` is not satisfie
--> $DIR/namespace-mix.rs:85:11
|
LL | fn check<T: Impossible>(_: T) {}
| ----------------------------- required by `check`
| ----- ---------- required by this bound in `check`
...
LL | check(xm6::US{});
| ^^^^^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::US`
@ -259,7 +259,7 @@ error[E0277]: the trait bound `namespace_mix::c::Item: Impossible` is not satisf
--> $DIR/namespace-mix.rs:86:11
|
LL | fn check<T: Impossible>(_: T) {}
| ----------------------------- required by `check`
| ----- ---------- required by this bound in `check`
...
LL | check(xm6::US);
| ^^^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::Item`
@ -268,7 +268,7 @@ error[E0277]: the trait bound `c::Item: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:99:11
|
LL | fn check<T: Impossible>(_: T) {}
| ----------------------------- required by `check`
| ----- ---------- required by this bound in `check`
...
LL | check(m7::V{});
| ^^^^^^^ the trait `Impossible` is not implemented for `c::Item`
@ -277,7 +277,7 @@ error[E0277]: the trait bound `c::E: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:101:11
|
LL | fn check<T: Impossible>(_: T) {}
| ----------------------------- required by `check`
| ----- ---------- required by this bound in `check`
...
LL | check(m8::V{});
| ^^^^^^^ the trait `Impossible` is not implemented for `c::E`
@ -286,7 +286,7 @@ error[E0277]: the trait bound `c::Item: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:102:11
|
LL | fn check<T: Impossible>(_: T) {}
| ----------------------------- required by `check`
| ----- ---------- required by this bound in `check`
...
LL | check(m8::V);
| ^^^^^ the trait `Impossible` is not implemented for `c::Item`
@ -295,7 +295,7 @@ error[E0277]: the trait bound `namespace_mix::c::Item: Impossible` is not satisf
--> $DIR/namespace-mix.rs:105:11
|
LL | fn check<T: Impossible>(_: T) {}
| ----------------------------- required by `check`
| ----- ---------- required by this bound in `check`
...
LL | check(xm7::V{});
| ^^^^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::Item`
@ -304,7 +304,7 @@ error[E0277]: the trait bound `namespace_mix::c::E: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:107:11
|
LL | fn check<T: Impossible>(_: T) {}
| ----------------------------- required by `check`
| ----- ---------- required by this bound in `check`
...
LL | check(xm8::V{});
| ^^^^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::E`
@ -313,7 +313,7 @@ error[E0277]: the trait bound `namespace_mix::c::Item: Impossible` is not satisf
--> $DIR/namespace-mix.rs:108:11
|
LL | fn check<T: Impossible>(_: T) {}
| ----------------------------- required by `check`
| ----- ---------- required by this bound in `check`
...
LL | check(xm8::V);
| ^^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::Item`
@ -322,7 +322,7 @@ error[E0277]: the trait bound `c::Item: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:121:11
|
LL | fn check<T: Impossible>(_: T) {}
| ----------------------------- required by `check`
| ----- ---------- required by this bound in `check`
...
LL | check(m9::TV{});
| ^^^^^^^^ the trait `Impossible` is not implemented for `c::Item`
@ -331,7 +331,7 @@ error[E0277]: the trait bound `fn() -> c::E {c::E::TV}: Impossible` is not satis
--> $DIR/namespace-mix.rs:122:11
|
LL | fn check<T: Impossible>(_: T) {}
| ----------------------------- required by `check`
| ----- ---------- required by this bound in `check`
...
LL | check(m9::TV);
| ^^^^^^ the trait `Impossible` is not implemented for `fn() -> c::E {c::E::TV}`
@ -340,7 +340,7 @@ error[E0277]: the trait bound `c::E: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:123:11
|
LL | fn check<T: Impossible>(_: T) {}
| ----------------------------- required by `check`
| ----- ---------- required by this bound in `check`
...
LL | check(mA::TV{});
| ^^^^^^^^ the trait `Impossible` is not implemented for `c::E`
@ -349,7 +349,7 @@ error[E0277]: the trait bound `c::Item: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:124:11
|
LL | fn check<T: Impossible>(_: T) {}
| ----------------------------- required by `check`
| ----- ---------- required by this bound in `check`
...
LL | check(mA::TV);
| ^^^^^^ the trait `Impossible` is not implemented for `c::Item`
@ -358,7 +358,7 @@ error[E0277]: the trait bound `namespace_mix::c::Item: Impossible` is not satisf
--> $DIR/namespace-mix.rs:127:11
|
LL | fn check<T: Impossible>(_: T) {}
| ----------------------------- required by `check`
| ----- ---------- required by this bound in `check`
...
LL | check(xm9::TV{});
| ^^^^^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::Item`
@ -367,7 +367,7 @@ error[E0277]: the trait bound `fn() -> namespace_mix::c::E {namespace_mix::xm7::
--> $DIR/namespace-mix.rs:128:11
|
LL | fn check<T: Impossible>(_: T) {}
| ----------------------------- required by `check`
| ----- ---------- required by this bound in `check`
...
LL | check(xm9::TV);
| ^^^^^^^ the trait `Impossible` is not implemented for `fn() -> namespace_mix::c::E {namespace_mix::xm7::TV}`
@ -376,7 +376,7 @@ error[E0277]: the trait bound `namespace_mix::c::E: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:129:11
|
LL | fn check<T: Impossible>(_: T) {}
| ----------------------------- required by `check`
| ----- ---------- required by this bound in `check`
...
LL | check(xmA::TV{});
| ^^^^^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::E`
@ -385,7 +385,7 @@ error[E0277]: the trait bound `namespace_mix::c::Item: Impossible` is not satisf
--> $DIR/namespace-mix.rs:130:11
|
LL | fn check<T: Impossible>(_: T) {}
| ----------------------------- required by `check`
| ----- ---------- required by this bound in `check`
...
LL | check(xmA::TV);
| ^^^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::Item`
@ -394,7 +394,7 @@ error[E0277]: the trait bound `c::Item: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:143:11
|
LL | fn check<T: Impossible>(_: T) {}
| ----------------------------- required by `check`
| ----- ---------- required by this bound in `check`
...
LL | check(mB::UV{});
| ^^^^^^^^ the trait `Impossible` is not implemented for `c::Item`
@ -403,7 +403,7 @@ error[E0277]: the trait bound `c::E: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:144:11
|
LL | fn check<T: Impossible>(_: T) {}
| ----------------------------- required by `check`
| ----- ---------- required by this bound in `check`
...
LL | check(mB::UV);
| ^^^^^^ the trait `Impossible` is not implemented for `c::E`
@ -412,7 +412,7 @@ error[E0277]: the trait bound `c::E: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:145:11
|
LL | fn check<T: Impossible>(_: T) {}
| ----------------------------- required by `check`
| ----- ---------- required by this bound in `check`
...
LL | check(mC::UV{});
| ^^^^^^^^ the trait `Impossible` is not implemented for `c::E`
@ -421,7 +421,7 @@ error[E0277]: the trait bound `c::Item: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:146:11
|
LL | fn check<T: Impossible>(_: T) {}
| ----------------------------- required by `check`
| ----- ---------- required by this bound in `check`
...
LL | check(mC::UV);
| ^^^^^^ the trait `Impossible` is not implemented for `c::Item`
@ -430,7 +430,7 @@ error[E0277]: the trait bound `namespace_mix::c::Item: Impossible` is not satisf
--> $DIR/namespace-mix.rs:149:11
|
LL | fn check<T: Impossible>(_: T) {}
| ----------------------------- required by `check`
| ----- ---------- required by this bound in `check`
...
LL | check(xmB::UV{});
| ^^^^^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::Item`
@ -439,7 +439,7 @@ error[E0277]: the trait bound `namespace_mix::c::E: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:150:11
|
LL | fn check<T: Impossible>(_: T) {}
| ----------------------------- required by `check`
| ----- ---------- required by this bound in `check`
...
LL | check(xmB::UV);
| ^^^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::E`
@ -448,7 +448,7 @@ error[E0277]: the trait bound `namespace_mix::c::E: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:151:11
|
LL | fn check<T: Impossible>(_: T) {}
| ----------------------------- required by `check`
| ----- ---------- required by this bound in `check`
...
LL | check(xmC::UV{});
| ^^^^^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::E`
@ -457,7 +457,7 @@ error[E0277]: the trait bound `namespace_mix::c::Item: Impossible` is not satisf
--> $DIR/namespace-mix.rs:152:11
|
LL | fn check<T: Impossible>(_: T) {}
| ----------------------------- required by `check`
| ----- ---------- required by this bound in `check`
...
LL | check(xmC::UV);
| ^^^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::Item`

View File

@ -3,12 +3,16 @@ error[E0277]: `std::rc::Rc<()>` cannot be sent between threads safely
|
LL | thread::spawn(move|| {
| ^^^^^^^^^^^^^ `std::rc::Rc<()>` cannot be sent between threads safely
|
::: $SRC_DIR/libstd/thread/mod.rs:LL:COL
|
LL | F: FnOnce() -> T, F: Send + 'static, T: Send + 'static
| ---- required by this bound in `std::thread::spawn`
|
= help: within `[closure@$DIR/no-send-res-ports.rs:25:19: 29:6 x:main::Foo]`, the trait `std::marker::Send` is not implemented for `std::rc::Rc<()>`
= note: required because it appears within the type `Port<()>`
= note: required because it appears within the type `main::Foo`
= note: required because it appears within the type `[closure@$DIR/no-send-res-ports.rs:25:19: 29:6 x:main::Foo]`
= note: required by `std::thread::spawn`
error: aborting due to previous error

View File

@ -2,7 +2,7 @@ error[E0277]: `NoSend` cannot be sent between threads safely
--> $DIR/no_send-enum.rs:16:5
|
LL | fn bar<T: Send>(_: T) {}
| --------------------- required by `bar`
| --- ---- required by this bound in `bar`
...
LL | bar(x);
| ^^^ `NoSend` cannot be sent between threads safely

View File

@ -2,7 +2,7 @@ error[E0277]: `std::rc::Rc<{integer}>` cannot be sent between threads safely
--> $DIR/no_send-rc.rs:7:9
|
LL | fn bar<T: Send>(_: T) {}
| --------------------- required by `bar`
| --- ---- required by this bound in `bar`
...
LL | bar(x);
| ^ `std::rc::Rc<{integer}>` cannot be sent between threads safely

View File

@ -2,7 +2,7 @@ error[E0277]: `Foo` cannot be sent between threads safely
--> $DIR/no_send-struct.rs:15:9
|
LL | fn bar<T: Send>(_: T) {}
| --------------------- required by `bar`
| --- ---- required by this bound in `bar`
...
LL | bar(x);
| ^ `Foo` cannot be sent between threads safely

View File

@ -2,7 +2,7 @@ error[E0277]: `NoSync` cannot be shared between threads safely
--> $DIR/no_share-enum.rs:14:5
|
LL | fn bar<T: Sync>(_: T) {}
| --------------------- required by `bar`
| --- ---- required by this bound in `bar`
...
LL | bar(x);
| ^^^ `NoSync` cannot be shared between threads safely

View File

@ -2,7 +2,7 @@ error[E0277]: `Foo` cannot be shared between threads safely
--> $DIR/no_share-struct.rs:12:9
|
LL | fn bar<T: Sync>(_: T) {}
| --------------------- required by `bar`
| --- ---- required by this bound in `bar`
...
LL | bar(x);
| ^ `Foo` cannot be shared between threads safely

View File

@ -2,7 +2,7 @@ error[E0277]: the type `std::cell::UnsafeCell<i32>` may contain interior mutabil
--> $DIR/not-panic-safe-2.rs:10:5
|
LL | fn assert<T: UnwindSafe + ?Sized>() {}
| ----------------------------------- required by `assert`
| ------ ---------- required by this bound in `assert`
...
LL | assert::<Rc<RefCell<i32>>>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ `std::cell::UnsafeCell<i32>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
@ -15,7 +15,7 @@ error[E0277]: the type `std::cell::UnsafeCell<isize>` may contain interior mutab
--> $DIR/not-panic-safe-2.rs:10:5
|
LL | fn assert<T: UnwindSafe + ?Sized>() {}
| ----------------------------------- required by `assert`
| ------ ---------- required by this bound in `assert`
...
LL | assert::<Rc<RefCell<i32>>>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ `std::cell::UnsafeCell<isize>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary

View File

@ -2,7 +2,7 @@ error[E0277]: the type `std::cell::UnsafeCell<i32>` may contain interior mutabil
--> $DIR/not-panic-safe-3.rs:10:5
|
LL | fn assert<T: UnwindSafe + ?Sized>() {}
| ----------------------------------- required by `assert`
| ------ ---------- required by this bound in `assert`
...
LL | assert::<Arc<RefCell<i32>>>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ `std::cell::UnsafeCell<i32>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
@ -15,7 +15,7 @@ error[E0277]: the type `std::cell::UnsafeCell<isize>` may contain interior mutab
--> $DIR/not-panic-safe-3.rs:10:5
|
LL | fn assert<T: UnwindSafe + ?Sized>() {}
| ----------------------------------- required by `assert`
| ------ ---------- required by this bound in `assert`
...
LL | assert::<Arc<RefCell<i32>>>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ `std::cell::UnsafeCell<isize>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary

View File

@ -2,7 +2,7 @@ error[E0277]: the type `std::cell::UnsafeCell<i32>` may contain interior mutabil
--> $DIR/not-panic-safe-4.rs:9:5
|
LL | fn assert<T: UnwindSafe + ?Sized>() {}
| ----------------------------------- required by `assert`
| ------ ---------- required by this bound in `assert`
...
LL | assert::<&RefCell<i32>>();
| ^^^^^^^^^^^^^^^^^^^^^^^ `std::cell::UnsafeCell<i32>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
@ -15,7 +15,7 @@ error[E0277]: the type `std::cell::UnsafeCell<isize>` may contain interior mutab
--> $DIR/not-panic-safe-4.rs:9:5
|
LL | fn assert<T: UnwindSafe + ?Sized>() {}
| ----------------------------------- required by `assert`
| ------ ---------- required by this bound in `assert`
...
LL | assert::<&RefCell<i32>>();
| ^^^^^^^^^^^^^^^^^^^^^^^ `std::cell::UnsafeCell<isize>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary

View File

@ -2,7 +2,7 @@ error[E0277]: the type `std::cell::UnsafeCell<i32>` may contain interior mutabil
--> $DIR/not-panic-safe-5.rs:9:5
|
LL | fn assert<T: UnwindSafe + ?Sized>() {}
| ----------------------------------- required by `assert`
| ------ ---------- required by this bound in `assert`
...
LL | assert::<*const UnsafeCell<i32>>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `std::cell::UnsafeCell<i32>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary

View File

@ -2,7 +2,7 @@ error[E0277]: the type `std::cell::UnsafeCell<i32>` may contain interior mutabil
--> $DIR/not-panic-safe-6.rs:9:5
|
LL | fn assert<T: UnwindSafe + ?Sized>() {}
| ----------------------------------- required by `assert`
| ------ ---------- required by this bound in `assert`
...
LL | assert::<*mut RefCell<i32>>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ `std::cell::UnsafeCell<i32>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
@ -15,7 +15,7 @@ error[E0277]: the type `std::cell::UnsafeCell<isize>` may contain interior mutab
--> $DIR/not-panic-safe-6.rs:9:5
|
LL | fn assert<T: UnwindSafe + ?Sized>() {}
| ----------------------------------- required by `assert`
| ------ ---------- required by this bound in `assert`
...
LL | assert::<*mut RefCell<i32>>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ `std::cell::UnsafeCell<isize>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary

View File

@ -2,7 +2,7 @@ error[E0277]: the type `&mut i32` may not be safely transferred across an unwind
--> $DIR/not-panic-safe.rs:9:5
|
LL | fn assert<T: UnwindSafe + ?Sized>() {}
| ----------------------------------- required by `assert`
| ------ ---------- required by this bound in `assert`
...
LL | assert::<&mut i32>();
| ^^^^^^^^^^^^^^^^^^ `&mut i32` may not be safely transferred across an unwind boundary

View File

@ -2,7 +2,7 @@ error[E0277]: `std::cell::Cell<i32>` cannot be shared between threads safely
--> $DIR/not-sync.rs:8:5
|
LL | fn test<T: Sync>() {}
| ------------------ required by `test`
| ---- ---- required by this bound in `test`
...
LL | test::<Cell<i32>>();
| ^^^^^^^^^^^^^^^^^ `std::cell::Cell<i32>` cannot be shared between threads safely
@ -13,7 +13,7 @@ error[E0277]: `std::cell::RefCell<i32>` cannot be shared between threads safely
--> $DIR/not-sync.rs:10:5
|
LL | fn test<T: Sync>() {}
| ------------------ required by `test`
| ---- ---- required by this bound in `test`
...
LL | test::<RefCell<i32>>();
| ^^^^^^^^^^^^^^^^^^^^ `std::cell::RefCell<i32>` cannot be shared between threads safely
@ -24,7 +24,7 @@ error[E0277]: `std::rc::Rc<i32>` cannot be shared between threads safely
--> $DIR/not-sync.rs:13:5
|
LL | fn test<T: Sync>() {}
| ------------------ required by `test`
| ---- ---- required by this bound in `test`
...
LL | test::<Rc<i32>>();
| ^^^^^^^^^^^^^^^ `std::rc::Rc<i32>` cannot be shared between threads safely
@ -35,7 +35,7 @@ error[E0277]: `std::rc::Weak<i32>` cannot be shared between threads safely
--> $DIR/not-sync.rs:15:5
|
LL | fn test<T: Sync>() {}
| ------------------ required by `test`
| ---- ---- required by this bound in `test`
...
LL | test::<Weak<i32>>();
| ^^^^^^^^^^^^^^^^^ `std::rc::Weak<i32>` cannot be shared between threads safely
@ -46,7 +46,7 @@ error[E0277]: `std::sync::mpsc::Receiver<i32>` cannot be shared between threads
--> $DIR/not-sync.rs:18:5
|
LL | fn test<T: Sync>() {}
| ------------------ required by `test`
| ---- ---- required by this bound in `test`
...
LL | test::<Receiver<i32>>();
| ^^^^^^^^^^^^^^^^^^^^^ `std::sync::mpsc::Receiver<i32>` cannot be shared between threads safely
@ -57,7 +57,7 @@ error[E0277]: `std::sync::mpsc::Sender<i32>` cannot be shared between threads sa
--> $DIR/not-sync.rs:20:5
|
LL | fn test<T: Sync>() {}
| ------------------ required by `test`
| ---- ---- required by this bound in `test`
...
LL | test::<Sender<i32>>();
| ^^^^^^^^^^^^^^^^^^^ `std::sync::mpsc::Sender<i32>` cannot be shared between threads safely

View File

@ -2,7 +2,7 @@ error[E0277]: the trait bound `std::boxed::Box<dyn Foo>: Foo` is not satisfied
--> $DIR/object-does-not-impl-trait.rs:6:44
|
LL | fn take_foo<F:Foo>(f: F) {}
| ------------------------ required by `take_foo`
| -------- --- required by this bound in `take_foo`
LL | fn take_object(f: Box<dyn Foo>) { take_foo(f); }
| ^ the trait `Foo` is not implemented for `std::boxed::Box<dyn Foo>`

View File

@ -2,7 +2,7 @@ error[E0277]: the trait bound `std::option::Option<std::vec::Vec<u8>>: MyFromIte
--> $DIR/on-trait.rs:28:30
|
LL | fn collect<A, I: Iterator<Item=A>, B: MyFromIterator<A>>(it: I) -> B {
| -------------------------------------------------------------------- required by `collect`
| ------- ----------------- required by this bound in `collect`
...
LL | let y: Option<Vec<u8>> = collect(x.iter()); // this should give approximately the same error for x.iter().collect()
| ^^^^^^^ a collection of type `std::option::Option<std::vec::Vec<u8>>` cannot be built from an iterator over elements of type `&u8`
@ -13,7 +13,7 @@ error[E0277]: the trait bound `std::string::String: Bar::Foo<u8, _, u32>` is not
--> $DIR/on-trait.rs:31:21
|
LL | fn foobar<U: Clone, T: Foo<u8, U, u32>>() -> T {
| ---------------------------------------------- required by `foobar`
| ------ --------------- required by this bound in `foobar`
...
LL | let x: String = foobar();
| ^^^^^^ test error `std::string::String` with `u8` `_` `u32` in `Bar::Foo`

View File

@ -2,7 +2,7 @@ error[E0277]: the trait bound `NotDebugOrDisplay: Marker` is not satisfied
--> $DIR/overlap-marker-trait.rs:30:5
|
LL | fn is_marker<T: Marker>() { }
| ------------------------- required by `is_marker`
| --------- ------ required by this bound in `is_marker`
...
LL | is_marker::<NotDebugOrDisplay>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Marker` is not implemented for `NotDebugOrDisplay`

View File

@ -2,7 +2,7 @@ error[E0277]: `T` cannot be shared between threads safely
--> $DIR/phantom-oibit.rs:21:12
|
LL | fn is_zen<T: Zen>(_: T) {}
| ----------------------- required by `is_zen`
| ------ --- required by this bound in `is_zen`
...
LL | is_zen(x)
| ^ `T` cannot be shared between threads safely
@ -17,7 +17,7 @@ error[E0277]: `T` cannot be shared between threads safely
--> $DIR/phantom-oibit.rs:26:12
|
LL | fn is_zen<T: Zen>(_: T) {}
| ----------------------- required by `is_zen`
| ------ --- required by this bound in `is_zen`
...
LL | is_zen(x)
| ^ `T` cannot be shared between threads safely

Some files were not shown because too many files have changed in this diff Show More