Auto merge of #64498 - estebank:point-at-arg, r=Centril

When possible point at argument causing item obligation failure

Fix https://github.com/rust-lang/rust/issues/41781, fix https://github.com/rust-lang/rust/issues/42855, fix https://github.com/rust-lang/rust/issues/46658, fix https://github.com/rust-lang/rust/issues/48099, fix https://github.com/rust-lang/rust/issues/63143.
This commit is contained in:
bors 2019-09-20 07:53:23 +00:00
commit 72252646a8
67 changed files with 528 additions and 400 deletions

View File

@ -81,6 +81,7 @@ impl TraitEngine<'tcx> for FulfillmentContext<'tcx> {
.map(|obligation| FulfillmentError {
obligation: obligation.goal.clone(),
code: FulfillmentErrorCode::CodeAmbiguity,
points_at_arg_span: false,
})
.collect();
Err(errors)
@ -129,6 +130,7 @@ impl TraitEngine<'tcx> for FulfillmentContext<'tcx> {
code: FulfillmentErrorCode::CodeSelectionError(
SelectionError::Unimplemented
),
points_at_arg_span: false,
}),
}
} else {
@ -142,6 +144,7 @@ impl TraitEngine<'tcx> for FulfillmentContext<'tcx> {
code: FulfillmentErrorCode::CodeSelectionError(
SelectionError::Unimplemented
),
points_at_arg_span: false,
})
}
}

View File

@ -119,11 +119,11 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
// returns if `cond` not occurring implies that `error` does not occur - i.e., that
// `error` occurring implies that `cond` occurs.
fn error_implies(&self,
cond: &ty::Predicate<'tcx>,
error: &ty::Predicate<'tcx>)
-> bool
{
fn error_implies(
&self,
cond: &ty::Predicate<'tcx>,
error: &ty::Predicate<'tcx>,
) -> bool {
if cond == error {
return true
}
@ -155,13 +155,21 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
false
}
fn report_fulfillment_error(&self, error: &FulfillmentError<'tcx>,
body_id: Option<hir::BodyId>,
fallback_has_occurred: bool) {
fn report_fulfillment_error(
&self,
error: &FulfillmentError<'tcx>,
body_id: Option<hir::BodyId>,
fallback_has_occurred: bool,
) {
debug!("report_fulfillment_errors({:?})", error);
match error.code {
FulfillmentErrorCode::CodeSelectionError(ref e) => {
self.report_selection_error(&error.obligation, e, fallback_has_occurred);
FulfillmentErrorCode::CodeSelectionError(ref selection_error) => {
self.report_selection_error(
&error.obligation,
selection_error,
fallback_has_occurred,
error.points_at_arg_span,
);
}
FulfillmentErrorCode::CodeProjectionError(ref e) => {
self.report_projection_error(&error.obligation, e);
@ -170,19 +178,21 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
self.maybe_report_ambiguity(&error.obligation, body_id);
}
FulfillmentErrorCode::CodeSubtypeError(ref expected_found, ref err) => {
self.report_mismatched_types(&error.obligation.cause,
expected_found.expected,
expected_found.found,
err.clone())
.emit();
self.report_mismatched_types(
&error.obligation.cause,
expected_found.expected,
expected_found.found,
err.clone(),
).emit();
}
}
}
fn report_projection_error(&self,
obligation: &PredicateObligation<'tcx>,
error: &MismatchedProjectionTypes<'tcx>)
{
fn report_projection_error(
&self,
obligation: &PredicateObligation<'tcx>,
error: &MismatchedProjectionTypes<'tcx>,
) {
let predicate =
self.resolve_vars_if_possible(&obligation.predicate);
@ -603,6 +613,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
obligation: &PredicateObligation<'tcx>,
error: &SelectionError<'tcx>,
fallback_has_occurred: bool,
points_at_arg: bool,
) {
let span = obligation.cause.span;
@ -690,7 +701,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
}
self.suggest_borrow_on_unsized_slice(&obligation.cause.code, &mut err);
self.suggest_fn_call(&obligation, &mut err, &trait_ref);
self.suggest_fn_call(&obligation, &mut err, &trait_ref, points_at_arg);
self.suggest_remove_reference(&obligation, &mut err, &trait_ref);
self.suggest_semicolon_removal(&obligation, &mut err, span, &trait_ref);
@ -963,6 +974,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
obligation: &PredicateObligation<'tcx>,
err: &mut DiagnosticBuilder<'tcx>,
trait_ref: &ty::Binder<ty::TraitRef<'tcx>>,
points_at_arg: bool,
) {
let self_ty = trait_ref.self_ty();
match self_ty.sty {
@ -991,15 +1003,31 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
..
})) = self.tcx.hir().get_if_local(def_id) {
let body = self.tcx.hir().body(*body_id);
err.help(&format!(
"use parentheses to call the function: `{}({})`",
let msg = "use parentheses to call the function";
let snippet = format!(
"{}({})",
ident,
body.params.iter()
.map(|arg| match &arg.pat.node {
hir::PatKind::Binding(_, _, ident, None)
if ident.name != kw::SelfLower => ident.to_string(),
_ => "_".to_string(),
}).collect::<Vec<_>>().join(", ")));
}).collect::<Vec<_>>().join(", "),
);
// When the obligation error has been ensured to have been caused by
// an argument, the `obligation.cause.span` points at the expression
// of the argument, so we can provide a suggestion. This is signaled
// by `points_at_arg`. Otherwise, we give a more general note.
if points_at_arg {
err.span_suggestion(
obligation.cause.span,
msg,
snippet,
Applicability::HasPlaceholders,
);
} else {
err.help(&format!("{}: `{}`", msg, snippet));
}
}
}
_ => {}

View File

@ -484,7 +484,11 @@ EnumTypeFoldableImpl! {
pub struct FulfillmentError<'tcx> {
pub obligation: PredicateObligation<'tcx>,
pub code: FulfillmentErrorCode<'tcx>
pub code: FulfillmentErrorCode<'tcx>,
/// Diagnostics only: we opportunistically change the `code.span` when we encounter an
/// obligation error caused by a call argument. When this is the case, we also signal that in
/// this field to ensure accuracy of suggestions.
pub points_at_arg_span: bool,
}
#[derive(Clone)]
@ -1183,7 +1187,7 @@ impl<'tcx> FulfillmentError<'tcx> {
code: FulfillmentErrorCode<'tcx>)
-> FulfillmentError<'tcx>
{
FulfillmentError { obligation: obligation, code: code }
FulfillmentError { obligation: obligation, code: code, points_at_arg_span: false }
}
}

View File

@ -1999,6 +1999,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
),
&traits::SelectionError::Unimplemented,
false,
false,
);
}
}

View File

@ -617,7 +617,7 @@ impl<'f, 'tcx> Coerce<'f, 'tcx> {
// Object safety violations or miscellaneous.
Err(err) => {
self.report_selection_error(&obligation, &err, false);
self.report_selection_error(&obligation, &err, false, false);
// Treat this like an obligation and follow through
// with the unsizing - the lack of a coercion should
// be silent, as it causes a type mismatch later.

View File

@ -912,12 +912,12 @@ fn typeck_tables_of(tcx: TyCtxt<'_>, def_id: DefId) -> &ty::TypeckTables<'_> {
};
// All type checking constraints were added, try to fallback unsolved variables.
fcx.select_obligations_where_possible(false);
fcx.select_obligations_where_possible(false, |_| {});
let mut fallback_has_occurred = false;
for ty in &fcx.unsolved_variables() {
fallback_has_occurred |= fcx.fallback_if_possible(ty);
}
fcx.select_obligations_where_possible(fallback_has_occurred);
fcx.select_obligations_where_possible(fallback_has_occurred, |_| {});
// Even though coercion casts provide type hints, we check casts after fallback for
// backwards compatibility. This makes fallback a stronger type hint than a cast coercion.
@ -2391,7 +2391,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
// possible. This can help substantially when there are
// indirect dependencies that don't seem worth tracking
// precisely.
self.select_obligations_where_possible(false);
self.select_obligations_where_possible(false, |_| {});
ty = self.resolve_vars_if_possible(&ty);
debug!("resolve_type_vars_with_obligations: ty={:?}", ty);
@ -2842,7 +2842,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
fn resolve_generator_interiors(&self, def_id: DefId) {
let mut generators = self.deferred_generator_interiors.borrow_mut();
for (body_id, interior, kind) in generators.drain(..) {
self.select_obligations_where_possible(false);
self.select_obligations_where_possible(false, |_| {});
generator_interior::resolve_interior(self, def_id, body_id, interior, kind);
}
}
@ -2879,8 +2879,13 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
}
/// Select as many obligations as we can at present.
fn select_obligations_where_possible(&self, fallback_has_occurred: bool) {
if let Err(errors) = self.fulfillment_cx.borrow_mut().select_where_possible(self) {
fn select_obligations_where_possible(
&self,
fallback_has_occurred: bool,
mutate_fullfillment_errors: impl Fn(&mut Vec<traits::FulfillmentError<'tcx>>),
) {
if let Err(mut errors) = self.fulfillment_cx.borrow_mut().select_where_possible(self) {
mutate_fullfillment_errors(&mut errors);
self.report_fulfillment_errors(&errors, self.inh.body_id, fallback_has_occurred);
}
}
@ -3288,6 +3293,8 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
formal_tys.clone()
};
let mut final_arg_types: Vec<(usize, Ty<'_>)> = vec![];
// Check the arguments.
// We do this in a pretty awful way: first we type-check any arguments
// that are not closures, then we type-check the closures. This is so
@ -3300,7 +3307,14 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
// an "opportunistic" vtable resolution of any trait bounds on
// the call. This helps coercions.
if check_closures {
self.select_obligations_where_possible(false);
self.select_obligations_where_possible(false, |errors| {
self.point_at_arg_instead_of_call_if_possible(
errors,
&final_arg_types[..],
sp,
&args,
);
})
}
// For C-variadic functions, we don't have a declared type for all of
@ -3346,6 +3360,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
// We're processing function arguments so we definitely want to use
// two-phase borrows.
self.demand_coerce(&arg, checked_ty, coerce_ty, AllowTwoPhase::Yes);
final_arg_types.push((i, coerce_ty));
// 3. Relate the expected type and the formal one,
// if the expected type was used for the coercion.
@ -3392,6 +3407,44 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
vec![self.tcx.types.err; len]
}
/// Given a vec of evaluated `FullfillmentError`s and an `fn` call argument expressions, we
/// walk the resolved types for each argument to see if any of the `FullfillmentError`s
/// reference a type argument. If they do, and there's only *one* argument that does, we point
/// at the corresponding argument's expression span instead of the `fn` call path span.
fn point_at_arg_instead_of_call_if_possible(
&self,
errors: &mut Vec<traits::FulfillmentError<'_>>,
final_arg_types: &[(usize, Ty<'tcx>)],
call_sp: Span,
args: &'tcx [hir::Expr],
) {
if !call_sp.desugaring_kind().is_some() {
// We *do not* do this for desugared call spans to keep good diagnostics when involving
// the `?` operator.
for error in errors {
if let ty::Predicate::Trait(predicate) = error.obligation.predicate {
// Collect the argument position for all arguments that could have caused this
// `FullfillmentError`.
let mut referenced_in = final_arg_types.iter()
.flat_map(|(i, ty)| {
let ty = self.resolve_vars_if_possible(ty);
// We walk the argument type because the argument's type could have
// been `Option<T>`, but the `FullfillmentError` references `T`.
ty.walk()
.filter(|&ty| ty == predicate.skip_binder().self_ty())
.map(move |_| *i)
});
if let (Some(ref_in), None) = (referenced_in.next(), referenced_in.next()) {
// We make sure that only *one* argument matches the obligation failure
// and thet the obligation's span to its expression's.
error.obligation.cause.span = args[ref_in].span;
error.points_at_arg_span = true;
}
}
}
}
}
// AST fragment checking
fn check_lit(&self,
lit: &hir::Lit,
@ -3549,8 +3602,11 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
// Check bounds on type arguments used in the path.
let bounds = self.instantiate_bounds(path_span, did, substs);
let cause = traits::ObligationCause::new(path_span, self.body_id,
traits::ItemObligation(did));
let cause = traits::ObligationCause::new(
path_span,
self.body_id,
traits::ItemObligation(did),
);
self.add_obligations_for_parameters(cause, &bounds);
Some((variant, ty))
@ -4674,7 +4730,8 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
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)),
&bounds);
&bounds,
);
// Substitute the values for the type parameters into the type of
// the referenced item.

View File

@ -724,7 +724,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
match method {
Some(ok) => {
let method = self.register_infer_ok_obligations(ok);
self.select_obligations_where_possible(false);
self.select_obligations_where_possible(false, |_| {});
Ok(method)
}

View File

@ -506,7 +506,7 @@ fn check_where_clauses<'tcx, 'fcx>(
});
// Now we build the substituted predicates.
let default_obligations = predicates.predicates.iter().flat_map(|&(pred, _)| {
let default_obligations = predicates.predicates.iter().flat_map(|&(pred, sp)| {
#[derive(Default)]
struct CountParams { params: FxHashSet<u32> }
impl<'tcx> ty::fold::TypeVisitor<'tcx> for CountParams {
@ -539,9 +539,9 @@ fn check_where_clauses<'tcx, 'fcx>(
// Avoid duplication of predicates that contain no parameters, for example.
None
} else {
Some(substituted_pred)
Some((substituted_pred, sp))
}
}).map(|pred| {
}).map(|(pred, sp)| {
// Convert each of those into an obligation. So if you have
// something like `struct Foo<T: Copy = String>`, we would
// take that predicate `T: Copy`, substitute to `String: Copy`
@ -551,8 +551,8 @@ fn check_where_clauses<'tcx, 'fcx>(
// Note the subtle difference from how we handle `predicates`
// below: there, we are not trying to prove those predicates
// to be *true* but merely *well-formed*.
let pred = fcx.normalize_associated_types_in(span, &pred);
let cause = traits::ObligationCause::new(span, fcx.body_id, traits::ItemObligation(def_id));
let pred = fcx.normalize_associated_types_in(sp, &pred);
let cause = traits::ObligationCause::new(sp, fcx.body_id, traits::ItemObligation(def_id));
traits::Obligation::new(cause, fcx.param_env, pred)
});

View File

@ -1,11 +1,11 @@
error[E0277]: the trait bound `<G as GetToInt>::R: ToInt` is not satisfied
--> $DIR/associated-types-bound-failure.rs:17:5
--> $DIR/associated-types-bound-failure.rs:17:19
|
LL | fn to_int(&self) -> isize;
| -------------------------- required by `ToInt::to_int`
...
LL | ToInt::to_int(&g.get())
| ^^^^^^^^^^^^^ the trait `ToInt` is not implemented for `<G as GetToInt>::R`
| ^^^^^^^^ the trait `ToInt` is not implemented for `<G as GetToInt>::R`
|
= help: consider adding a `where <G as GetToInt>::R: ToInt` bound

View File

@ -1,8 +1,8 @@
error[E0277]: expected a `std::ops::FnOnce<()>` closure, found `{integer}`
--> $DIR/closure-expected.rs:3:15
--> $DIR/closure-expected.rs:3:23
|
LL | let y = x.or_else(4);
| ^^^^^^^ expected an `FnOnce<()>` closure, found `{integer}`
| ^ expected an `FnOnce<()>` closure, found `{integer}`
|
= help: the trait `std::ops::FnOnce<()>` is not implemented for `{integer}`
= note: wrap the `{integer}` in a closure with no arguments: `|| { /* code */ }

View File

@ -1,11 +1,11 @@
error[E0277]: `F` cannot be shared between threads safely
--> $DIR/closure-bounds-subtype.rs:13:5
--> $DIR/closure-bounds-subtype.rs:13:22
|
LL | fn take_const_owned<F>(_: F) where F: FnOnce() + Sync + Send {
| ------------------------------------------------------------ required by `take_const_owned`
...
LL | take_const_owned(f);
| ^^^^^^^^^^^^^^^^ `F` cannot be shared between threads safely
| ^ `F` cannot be shared between threads safely
|
= help: the trait `std::marker::Sync` is not implemented for `F`
= help: consider adding a `where F: std::marker::Sync` bound

View File

@ -8,10 +8,10 @@ LL | println!("{:?}", [0_usize; 33]);
= note: required by `std::fmt::Debug::fmt`
error[E0277]: arrays only have std trait implementations for lengths 0..=32
--> $DIR/core-traits-no-impls-length-33.rs:9:9
--> $DIR/core-traits-no-impls-length-33.rs:9:16
|
LL | set.insert([0_usize; 33]);
| ^^^^^^ the trait `std::array::LengthAtMost32` is not implemented for `[usize; 33]`
| ^^^^^^^^^^^^^ the trait `std::array::LengthAtMost32` is not implemented for `[usize; 33]`
|
= note: required because of the requirements on the impl of `std::cmp::Eq` for `[usize; 33]`

View File

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

View File

@ -1,11 +1,11 @@
error[E0277]: the trait bound `i8: Foo<i32>` is not satisfied
--> $DIR/issue-39802-show-5-trait-impls.rs:24:5
--> $DIR/issue-39802-show-5-trait-impls.rs:24:21
|
LL | fn bar(&self){}
| ------------- required by `Foo::bar`
...
LL | Foo::<i32>::bar(&1i8);
| ^^^^^^^^^^^^^^^ the trait `Foo<i32>` is not implemented for `i8`
| ^^^^ the trait `Foo<i32>` is not implemented for `i8`
|
= help: the following implementations were found:
<i8 as Foo<bool>>
@ -15,13 +15,13 @@ LL | Foo::<i32>::bar(&1i8);
<i8 as Foo<u8>>
error[E0277]: the trait bound `u8: Foo<i32>` is not satisfied
--> $DIR/issue-39802-show-5-trait-impls.rs:25:5
--> $DIR/issue-39802-show-5-trait-impls.rs:25:21
|
LL | fn bar(&self){}
| ------------- required by `Foo::bar`
...
LL | Foo::<i32>::bar(&1u8);
| ^^^^^^^^^^^^^^^ the trait `Foo<i32>` is not implemented for `u8`
| ^^^^ the trait `Foo<i32>` is not implemented for `u8`
|
= help: the following implementations were found:
<u8 as Foo<bool>>
@ -30,13 +30,13 @@ LL | Foo::<i32>::bar(&1u8);
<u8 as Foo<u64>>
error[E0277]: the trait bound `bool: Foo<i32>` is not satisfied
--> $DIR/issue-39802-show-5-trait-impls.rs:26:5
--> $DIR/issue-39802-show-5-trait-impls.rs:26:21
|
LL | fn bar(&self){}
| ------------- required by `Foo::bar`
...
LL | Foo::<i32>::bar(&true);
| ^^^^^^^^^^^^^^^ the trait `Foo<i32>` is not implemented for `bool`
| ^^^^^ the trait `Foo<i32>` is not implemented for `bool`
|
= help: the following implementations were found:
<bool as Foo<bool>>

View File

@ -11,13 +11,13 @@ LL | fn f(p: Path) { }
= help: unsized locals are gated as an unstable feature
error[E0277]: the trait bound `i32: Foo` is not satisfied
--> $DIR/E0277.rs:17:5
--> $DIR/E0277.rs:17:15
|
LL | fn some_func<T: Foo>(foo: T) {
| ---------------------------- required by `some_func`
...
LL | some_func(5i32);
| ^^^^^^^^^ the trait `Foo` is not implemented for `i32`
| ^^^^ the trait `Foo` is not implemented for `i32`
error: aborting due to 2 previous errors

View File

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

View File

@ -1,11 +1,11 @@
error[E0277]: expected a `std::ops::Fn<()>` closure, found `extern "C" fn() {f}`
--> $DIR/extern-wrong-value-type.rs:9:5
--> $DIR/extern-wrong-value-type.rs:9:11
|
LL | fn is_fn<F>(_: F) where F: Fn() {}
| ------------------------------- required by `is_fn`
...
LL | is_fn(f);
| ^^^^^ expected an `Fn<()>` closure, found `extern "C" fn() {f}`
| ^ expected an `Fn<()>` closure, found `extern "C" fn() {f}`
|
= help: the trait `std::ops::Fn<()>` is not implemented for `extern "C" fn() {f}`
= note: wrap the `extern "C" fn() {f}` in a closure with no arguments: `|| { /* code */ }

View File

@ -26,13 +26,13 @@ LL | let _: () = (box || -> isize { unimplemented!() }) as Box<dyn FnMut() -
found type `std::boxed::Box<dyn std::ops::FnMut() -> isize>`
error[E0277]: expected a `std::ops::Fn<(isize,)>` closure, found `{integer}`
--> $DIR/fn-trait-formatting.rs:19:5
--> $DIR/fn-trait-formatting.rs:19:14
|
LL | fn needs_fn<F>(x: F) where F: Fn(isize) -> isize {}
| ------------------------------------------------ required by `needs_fn`
...
LL | needs_fn(1);
| ^^^^^^^^ expected an `Fn<(isize,)>` closure, found `{integer}`
| ^ expected an `Fn<(isize,)>` closure, found `{integer}`
|
= help: the trait `std::ops::Fn<(isize,)>` is not implemented for `{integer}`

View File

@ -6,6 +6,9 @@ fn main() {
//~| NOTE `&str` is not an iterator
//~| HELP the trait `std::iter::Iterator` is not implemented for `&str`
//~| NOTE required by `std::iter::IntoIterator::into_iter`
//~| NOTE in this expansion of desugaring of `for` loop
//~| NOTE in this expansion of desugaring of `for` loop
//~| NOTE in this expansion of desugaring of `for` loop
println!();
}
}

View File

@ -1,11 +1,11 @@
error[E0277]: the trait bound `[static generator@$DIR/static-not-unpin.rs:11:25: 13:6 _]: std::marker::Unpin` is not satisfied
--> $DIR/static-not-unpin.rs:14:5
--> $DIR/static-not-unpin.rs:14:18
|
LL | fn assert_unpin<T: Unpin>(_: T) {
| ------------------------------- required by `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 _]`
| ^^^^^^^^^ the trait `std::marker::Unpin` is not implemented for `[static generator@$DIR/static-not-unpin.rs:11:25: 13:6 _]`
error: aborting due to previous error

View File

@ -1,5 +1,5 @@
error[E0277]: the trait bound `for<'ccx> B: Bar<'ccx>` is not satisfied
--> $DIR/hrtb-higher-ranker-supertraits-transitive.rs:47:5
--> $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>
@ -8,7 +8,7 @@ LL | | }
| |_- required by `want_bar_for_any_ccx`
...
LL | want_bar_for_any_ccx(b);
| ^^^^^^^^^^^^^^^^^^^^ the trait `for<'ccx> Bar<'ccx>` is not implemented for `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,8 +1,8 @@
error[E0277]: the trait bound `for<'tcx> F: Foo<'tcx>` is not satisfied
--> $DIR/hrtb-higher-ranker-supertraits.rs:18:5
--> $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`
| ^ 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>
@ -15,10 +15,10 @@ LL | | }
= 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:5
--> $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`
| ^ 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>

View File

@ -4,4 +4,5 @@
fn main() {
(|| Box::new(*(&[0][..])))();
//~^ ERROR the size for values of type
//~| ERROR the size for values of type
}

View File

@ -1,3 +1,13 @@
error[E0277]: the size for values of type `[{integer}]` cannot be known at compilation time
--> $DIR/issue-17651.rs:5:18
|
LL | (|| Box::new(*(&[0][..])))();
| ^^^^^^^^^^^ doesn't have a size known at compile-time
|
= help: the trait `std::marker::Sized` is not implemented for `[{integer}]`
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
= note: required by `std::boxed::Box::<T>::new`
error[E0277]: the size for values of type `[{integer}]` cannot be known at compilation time
--> $DIR/issue-17651.rs:5:9
|
@ -6,8 +16,9 @@ LL | (|| Box::new(*(&[0][..])))();
|
= help: the trait `std::marker::Sized` is not implemented for `[{integer}]`
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
= note: required by `std::boxed::Box::<T>::new`
= note: all function arguments must have a statically known size
= help: unsized locals are gated as an unstable feature
error: aborting due to previous error
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0277`.

View File

@ -1,8 +1,8 @@
error[E0277]: expected a `std::ops::FnMut<(_, char)>` closure, found `()`
--> $DIR/issue-23966.rs:2:16
--> $DIR/issue-23966.rs:2:32
|
LL | "".chars().fold(|_, _| (), ());
| ^^^^ expected an `FnMut<(_, char)>` closure, found `()`
| ^^ expected an `FnMut<(_, char)>` closure, found `()`
|
= help: the trait `std::ops::FnMut<(_, char)>` is not implemented for `()`

View File

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

View File

@ -1,6 +1,7 @@
fn main() {
let _ = Iterator::next(&mut ());
//~^ ERROR `()` is not an iterator
//~| ERROR `()` is not an iterator
for _ in false {}
//~^ ERROR `bool` is not an iterator
@ -16,6 +17,7 @@ pub fn other() {
let _ = Iterator::next(&mut ());
//~^ ERROR `()` is not an iterator
//~| ERROR `()` is not an iterator
let _ = Iterator::next(&mut ());
//~^ ERROR `()` is not an iterator

View File

@ -1,3 +1,30 @@
error[E0277]: `()` is not an iterator
--> $DIR/issue-28098.rs:2:28
|
LL | let _ = Iterator::next(&mut ());
| ^^^^^^^ `()` is not an iterator
|
= help: the trait `std::iter::Iterator` is not implemented for `()`
= note: required by `std::iter::Iterator::next`
error[E0277]: `bool` is not an iterator
--> $DIR/issue-28098.rs:6:14
|
LL | for _ in false {}
| ^^^^^ `bool` is not an iterator
|
= help: the trait `std::iter::Iterator` is not implemented for `bool`
= note: required by `std::iter::IntoIterator::into_iter`
error[E0277]: `()` is not an iterator
--> $DIR/issue-28098.rs:9:28
|
LL | let _ = Iterator::next(&mut ());
| ^^^^^^^ `()` is not an iterator
|
= help: the trait `std::iter::Iterator` is not implemented for `()`
= note: required by `std::iter::Iterator::next`
error[E0277]: `()` is not an iterator
--> $DIR/issue-28098.rs:2:13
|
@ -5,10 +32,27 @@ LL | let _ = Iterator::next(&mut ());
| ^^^^^^^^^^^^^^ `()` is not an iterator
|
= help: the trait `std::iter::Iterator` is not implemented for `()`
error[E0277]: `()` is not an iterator
--> $DIR/issue-28098.rs:18:28
|
LL | let _ = Iterator::next(&mut ());
| ^^^^^^^ `()` is not an iterator
|
= help: the trait `std::iter::Iterator` is not implemented for `()`
= note: required by `std::iter::Iterator::next`
error[E0277]: `()` is not an iterator
--> $DIR/issue-28098.rs:22:28
|
LL | let _ = Iterator::next(&mut ());
| ^^^^^^^ `()` is not an iterator
|
= help: the trait `std::iter::Iterator` is not implemented for `()`
= note: required by `std::iter::Iterator::next`
error[E0277]: `bool` is not an iterator
--> $DIR/issue-28098.rs:5:14
--> $DIR/issue-28098.rs:25:14
|
LL | for _ in false {}
| ^^^^^ `bool` is not an iterator
@ -17,41 +61,13 @@ LL | for _ in false {}
= note: required by `std::iter::IntoIterator::into_iter`
error[E0277]: `()` is not an iterator
--> $DIR/issue-28098.rs:8:13
--> $DIR/issue-28098.rs:18:13
|
LL | let _ = Iterator::next(&mut ());
| ^^^^^^^^^^^^^^ `()` is not an iterator
|
= help: the trait `std::iter::Iterator` is not implemented for `()`
= note: required by `std::iter::Iterator::next`
error[E0277]: `()` is not an iterator
--> $DIR/issue-28098.rs:17:13
|
LL | let _ = Iterator::next(&mut ());
| ^^^^^^^^^^^^^^ `()` is not an iterator
|
= help: the trait `std::iter::Iterator` is not implemented for `()`
= note: required by `std::iter::Iterator::next`
error[E0277]: `()` is not an iterator
--> $DIR/issue-28098.rs:20:13
|
LL | let _ = Iterator::next(&mut ());
| ^^^^^^^^^^^^^^ `()` is not an iterator
|
= help: the trait `std::iter::Iterator` is not implemented for `()`
= note: required by `std::iter::Iterator::next`
error[E0277]: `bool` is not an iterator
--> $DIR/issue-28098.rs:23:14
|
LL | for _ in false {}
| ^^^^^ `bool` is not an iterator
|
= help: the trait `std::iter::Iterator` is not implemented for `bool`
= note: required by `std::iter::IntoIterator::into_iter`
error: aborting due to 6 previous errors
error: aborting due to 8 previous errors
For more information about this error, try `rustc --explain E0277`.

View File

@ -1,10 +1,10 @@
error[E0593]: function is expected to take a single 0-tuple as argument, but it takes 2 distinct arguments
--> $DIR/issue-47706-trait.rs:3:20
--> $DIR/issue-47706-trait.rs:3:24
|
LL | fn f(&self, _: ()) {
| ------------------ takes 2 distinct arguments
LL | None::<()>.map(Self::f);
| ^^^ expected function that takes a single 0-tuple as argument
| ^^^^^^^ expected function that takes a single 0-tuple as argument
error: aborting due to previous error

View File

@ -1,14 +1,14 @@
error[E0593]: function is expected to take 1 argument, but it takes 2 arguments
--> $DIR/issue-47706.rs:11:18
--> $DIR/issue-47706.rs:11:22
|
LL | pub fn new(foo: Option<i32>, _: ()) -> Foo {
| ------------------------------------------ takes 2 arguments
...
LL | self.foo.map(Foo::new)
| ^^^ expected function that takes 1 argument
| ^^^^^^^^ expected function that takes 1 argument
error[E0593]: function is expected to take 0 arguments, but it takes 1 argument
--> $DIR/issue-47706.rs:27:5
--> $DIR/issue-47706.rs:27:9
|
LL | Bar(i32),
| -------- takes 1 argument
@ -21,7 +21,7 @@ LL | | }
| |_- required by `foo`
...
LL | foo(Qux::Bar);
| ^^^ expected function that takes 0 arguments
| ^^^^^^^^ expected function that takes 0 arguments
error: aborting due to 2 previous errors

View File

@ -1,5 +1,5 @@
error[E0631]: type mismatch in function arguments
--> $DIR/issue-60283.rs:14:5
--> $DIR/issue-60283.rs:14:13
|
LL | / pub fn foo<T, F>(_: T, _: F)
LL | | where T: for<'a> Trait<'a>,
@ -7,10 +7,10 @@ LL | | F: for<'a> FnMut(<T as Trait<'a>>::Item) {}
| |_________________________________________________- required by `foo`
...
LL | foo((), drop)
| ^^^
| |
| expected signature of `for<'a> fn(<() as Trait<'a>>::Item) -> _`
| found signature of `fn(_) -> _`
| ^^^^
| |
| 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

View File

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

View File

@ -1,11 +1,11 @@
error[E0277]: the trait bound `std::boxed::Box<{integer}>: std::marker::Copy` is not satisfied
--> $DIR/kindck-inherited-copy-bound.rs:18:5
--> $DIR/kindck-inherited-copy-bound.rs:18:16
|
LL | fn take_param<T:Foo>(foo: &T) { }
| ----------------------------- required by `take_param`
...
LL | take_param(&x);
| ^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `std::boxed::Box<{integer}>`
| ^^ the trait `std::marker::Copy` is not implemented for `std::boxed::Box<{integer}>`
|
= note: required because of the requirements on the impl of `Foo` for `std::boxed::Box<{integer}>`

View File

@ -21,7 +21,7 @@ LL | bar(|_: isize| {});
| expected signature of `fn(usize) -> _`
error[E0631]: type mismatch in function arguments
--> $DIR/E0631.rs:9:5
--> $DIR/E0631.rs:9:9
|
LL | fn foo<F: Fn(usize)>(_: F) {}
| -------------------------- required by `foo`
@ -30,10 +30,10 @@ LL | fn f(_: u64) {}
| ------------ found signature of `fn(u64) -> _`
...
LL | foo(f);
| ^^^ expected signature of `fn(usize) -> _`
| ^ expected signature of `fn(usize) -> _`
error[E0631]: type mismatch in function arguments
--> $DIR/E0631.rs:10:5
--> $DIR/E0631.rs:10:9
|
LL | fn bar<F: Fn<usize>>(_: F) {}
| -------------------------- required by `bar`
@ -42,7 +42,7 @@ LL | fn f(_: u64) {}
| ------------ found signature of `fn(u64) -> _`
...
LL | bar(f);
| ^^^ expected signature of `fn(usize) -> _`
| ^ expected signature of `fn(usize) -> _`
error: aborting due to 4 previous errors

View File

@ -105,42 +105,42 @@ LL | let _it = vec![1, 2, 3].into_iter().enumerate().map(|i, x, y| i);
| expected closure that takes a single 2-tuple as argument
error[E0593]: function is expected to take a single 2-tuple as argument, but it takes 0 arguments
--> $DIR/closure-arg-count.rs:24:53
--> $DIR/closure-arg-count.rs:24:57
|
LL | let _it = vec![1, 2, 3].into_iter().enumerate().map(foo);
| ^^^ expected function that takes a single 2-tuple as argument
| ^^^ expected function that takes a single 2-tuple as argument
...
LL | fn foo() {}
| -------- takes 0 arguments
error[E0593]: closure is expected to take a single 2-tuple as argument, but it takes 3 distinct arguments
--> $DIR/closure-arg-count.rs:27:53
--> $DIR/closure-arg-count.rs:27:57
|
LL | let bar = |i, x, y| i;
| --------- takes 3 distinct arguments
LL | let _it = vec![1, 2, 3].into_iter().enumerate().map(bar);
| ^^^ expected closure that takes a single 2-tuple as argument
| ^^^ expected closure that takes a single 2-tuple as argument
error[E0593]: function is expected to take a single 2-tuple as argument, but it takes 2 distinct arguments
--> $DIR/closure-arg-count.rs:29:53
--> $DIR/closure-arg-count.rs:29:57
|
LL | let _it = vec![1, 2, 3].into_iter().enumerate().map(qux);
| ^^^ expected function that takes a single 2-tuple as argument
| ^^^ expected function that takes a single 2-tuple as argument
...
LL | fn qux(x: usize, y: usize) {}
| -------------------------- takes 2 distinct arguments
error[E0593]: function is expected to take 1 argument, but it takes 2 arguments
--> $DIR/closure-arg-count.rs:32:41
--> $DIR/closure-arg-count.rs:32:45
|
LL | let _it = vec![1, 2, 3].into_iter().map(usize::checked_add);
| ^^^ expected function that takes 1 argument
| ^^^^^^^^^^^^^^^^^^ expected function that takes 1 argument
error[E0593]: function is expected to take 0 arguments, but it takes 1 argument
--> $DIR/closure-arg-count.rs:35:5
--> $DIR/closure-arg-count.rs:35:10
|
LL | call(Foo);
| ^^^^ expected function that takes 0 arguments
| ^^^ expected function that takes 0 arguments
...
LL | fn call<F, R>(_: F) where F: FnOnce() -> R {}
| ------------------------------------------ required by `call`

View File

@ -23,16 +23,16 @@ LL | a.iter().map(|_: (u16, u16)| 45);
| expected signature of `fn(&(u32, u32)) -> _`
error[E0631]: type mismatch in function arguments
--> $DIR/closure-arg-type-mismatch.rs:10:5
--> $DIR/closure-arg-type-mismatch.rs:10:9
|
LL | fn baz<F: Fn(*mut &u32)>(_: F) {}
| ------------------------------ required by `baz`
LL | fn _test<'a>(f: fn(*mut &'a u32)) {
LL | baz(f);
| ^^^
| |
| expected signature of `for<'r> fn(*mut &'r u32) -> _`
| found signature of `fn(*mut &'a u32) -> _`
| ^
| |
| expected signature of `for<'r> fn(*mut &'r u32) -> _`
| found signature of `fn(*mut &'a u32) -> _`
error[E0271]: type mismatch resolving `for<'r> <fn(*mut &'a u32) as std::ops::FnOnce<(*mut &'r u32,)>>::Output == ()`
--> $DIR/closure-arg-type-mismatch.rs:10:5

View File

@ -1,5 +1,5 @@
error[E0631]: type mismatch in function arguments
--> $DIR/fn-variance-1.rs:11:5
--> $DIR/fn-variance-1.rs:11:15
|
LL | fn takes_mut(x: &mut isize) { }
| --------------------------- found signature of `for<'r> fn(&'r mut isize) -> _`
@ -8,10 +8,10 @@ LL | fn apply<T, F>(t: T, f: F) where F: FnOnce(T) {
| --------------------------------------------- required by `apply`
...
LL | apply(&3, takes_mut);
| ^^^^^ expected signature of `fn(&{integer}) -> _`
| ^^^^^^^^^ expected signature of `fn(&{integer}) -> _`
error[E0631]: type mismatch in function arguments
--> $DIR/fn-variance-1.rs:15:5
--> $DIR/fn-variance-1.rs:15:19
|
LL | fn takes_imm(x: &isize) { }
| ----------------------- found signature of `for<'r> fn(&'r isize) -> _`
@ -20,7 +20,7 @@ LL | fn apply<T, F>(t: T, f: F) where F: FnOnce(T) {
| --------------------------------------------- required by `apply`
...
LL | apply(&mut 3, takes_imm);
| ^^^^^ expected signature of `fn(&mut {integer}) -> _`
| ^^^^^^^^^ expected signature of `fn(&mut {integer}) -> _`
error: aborting due to 2 previous errors

View File

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

View File

@ -1,11 +1,11 @@
error[E0277]: `std::cell::Cell<i32>` cannot be shared between threads safely
--> $DIR/mutexguard-sync.rs:11:5
--> $DIR/mutexguard-sync.rs:11:15
|
LL | fn test_sync<T: Sync>(_t: T) {}
| ---------------------------- required by `test_sync`
...
LL | test_sync(guard);
| ^^^^^^^^^ `std::cell::Cell<i32>` cannot be shared between threads safely
| ^^^^^ `std::cell::Cell<i32>` cannot be shared between threads safely
|
= help: the trait `std::marker::Sync` is not implemented for `std::cell::Cell<i32>`
= note: required because of the requirements on the impl of `std::marker::Sync` for `std::sync::MutexGuard<'_, std::cell::Cell<i32>>`

View File

@ -67,400 +67,400 @@ LL | use namespace_mix::xm8::V;
|
error[E0277]: the trait bound `c::Item: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:33:5
--> $DIR/namespace-mix.rs:33:11
|
LL | fn check<T: Impossible>(_: T) {}
| ----------------------------- required by `check`
...
LL | check(m1::S{});
| ^^^^^ the trait `Impossible` is not implemented for `c::Item`
| ^^^^^^^ the trait `Impossible` is not implemented for `c::Item`
error[E0277]: the trait bound `c::S: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:35:5
--> $DIR/namespace-mix.rs:35:11
|
LL | fn check<T: Impossible>(_: T) {}
| ----------------------------- required by `check`
...
LL | check(m2::S{});
| ^^^^^ the trait `Impossible` is not implemented for `c::S`
| ^^^^^^^ the trait `Impossible` is not implemented for `c::S`
error[E0277]: the trait bound `c::Item: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:36:5
--> $DIR/namespace-mix.rs:36:11
|
LL | fn check<T: Impossible>(_: T) {}
| ----------------------------- required by `check`
...
LL | check(m2::S);
| ^^^^^ the trait `Impossible` is not implemented for `c::Item`
| ^^^^^ the trait `Impossible` is not implemented for `c::Item`
error[E0277]: the trait bound `namespace_mix::c::Item: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:39:5
--> $DIR/namespace-mix.rs:39:11
|
LL | fn check<T: Impossible>(_: T) {}
| ----------------------------- required by `check`
...
LL | check(xm1::S{});
| ^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::Item`
| ^^^^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::Item`
error[E0277]: the trait bound `namespace_mix::c::S: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:41:5
--> $DIR/namespace-mix.rs:41:11
|
LL | fn check<T: Impossible>(_: T) {}
| ----------------------------- required by `check`
...
LL | check(xm2::S{});
| ^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::S`
| ^^^^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::S`
error[E0277]: the trait bound `namespace_mix::c::Item: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:42:5
--> $DIR/namespace-mix.rs:42:11
|
LL | fn check<T: Impossible>(_: T) {}
| ----------------------------- required by `check`
...
LL | check(xm2::S);
| ^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::Item`
| ^^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::Item`
error[E0277]: the trait bound `c::Item: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:55:5
--> $DIR/namespace-mix.rs:55:11
|
LL | fn check<T: Impossible>(_: T) {}
| ----------------------------- required by `check`
...
LL | check(m3::TS{});
| ^^^^^ the trait `Impossible` is not implemented for `c::Item`
| ^^^^^^^^ the trait `Impossible` is not implemented for `c::Item`
error[E0277]: the trait bound `fn() -> c::TS {c::TS}: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:56:5
--> $DIR/namespace-mix.rs:56:11
|
LL | fn check<T: Impossible>(_: T) {}
| ----------------------------- required by `check`
...
LL | check(m3::TS);
| ^^^^^ the trait `Impossible` is not implemented for `fn() -> c::TS {c::TS}`
| ^^^^^^ the trait `Impossible` is not implemented for `fn() -> c::TS {c::TS}`
error[E0277]: the trait bound `c::TS: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:57:5
--> $DIR/namespace-mix.rs:57:11
|
LL | fn check<T: Impossible>(_: T) {}
| ----------------------------- required by `check`
...
LL | check(m4::TS{});
| ^^^^^ the trait `Impossible` is not implemented for `c::TS`
| ^^^^^^^^ the trait `Impossible` is not implemented for `c::TS`
error[E0277]: the trait bound `c::Item: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:58:5
--> $DIR/namespace-mix.rs:58:11
|
LL | fn check<T: Impossible>(_: T) {}
| ----------------------------- required by `check`
...
LL | check(m4::TS);
| ^^^^^ the trait `Impossible` is not implemented for `c::Item`
| ^^^^^^ the trait `Impossible` is not implemented for `c::Item`
error[E0277]: the trait bound `namespace_mix::c::Item: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:61:5
--> $DIR/namespace-mix.rs:61:11
|
LL | fn check<T: Impossible>(_: T) {}
| ----------------------------- required by `check`
...
LL | check(xm3::TS{});
| ^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::Item`
| ^^^^^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::Item`
error[E0277]: the trait bound `fn() -> namespace_mix::c::TS {namespace_mix::c::TS}: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:62:5
--> $DIR/namespace-mix.rs:62:11
|
LL | fn check<T: Impossible>(_: T) {}
| ----------------------------- required by `check`
...
LL | check(xm3::TS);
| ^^^^^ the trait `Impossible` is not implemented for `fn() -> namespace_mix::c::TS {namespace_mix::c::TS}`
| ^^^^^^^ the trait `Impossible` is not implemented for `fn() -> namespace_mix::c::TS {namespace_mix::c::TS}`
error[E0277]: the trait bound `namespace_mix::c::TS: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:63:5
--> $DIR/namespace-mix.rs:63:11
|
LL | fn check<T: Impossible>(_: T) {}
| ----------------------------- required by `check`
...
LL | check(xm4::TS{});
| ^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::TS`
| ^^^^^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::TS`
error[E0277]: the trait bound `namespace_mix::c::Item: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:64:5
--> $DIR/namespace-mix.rs:64:11
|
LL | fn check<T: Impossible>(_: T) {}
| ----------------------------- required by `check`
...
LL | check(xm4::TS);
| ^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::Item`
| ^^^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::Item`
error[E0277]: the trait bound `c::Item: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:77:5
--> $DIR/namespace-mix.rs:77:11
|
LL | fn check<T: Impossible>(_: T) {}
| ----------------------------- required by `check`
...
LL | check(m5::US{});
| ^^^^^ the trait `Impossible` is not implemented for `c::Item`
| ^^^^^^^^ the trait `Impossible` is not implemented for `c::Item`
error[E0277]: the trait bound `c::US: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:78:5
--> $DIR/namespace-mix.rs:78:11
|
LL | fn check<T: Impossible>(_: T) {}
| ----------------------------- required by `check`
...
LL | check(m5::US);
| ^^^^^ the trait `Impossible` is not implemented for `c::US`
| ^^^^^^ the trait `Impossible` is not implemented for `c::US`
error[E0277]: the trait bound `c::US: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:79:5
--> $DIR/namespace-mix.rs:79:11
|
LL | fn check<T: Impossible>(_: T) {}
| ----------------------------- required by `check`
...
LL | check(m6::US{});
| ^^^^^ the trait `Impossible` is not implemented for `c::US`
| ^^^^^^^^ the trait `Impossible` is not implemented for `c::US`
error[E0277]: the trait bound `c::Item: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:80:5
--> $DIR/namespace-mix.rs:80:11
|
LL | fn check<T: Impossible>(_: T) {}
| ----------------------------- required by `check`
...
LL | check(m6::US);
| ^^^^^ the trait `Impossible` is not implemented for `c::Item`
| ^^^^^^ the trait `Impossible` is not implemented for `c::Item`
error[E0277]: the trait bound `namespace_mix::c::Item: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:83:5
--> $DIR/namespace-mix.rs:83:11
|
LL | fn check<T: Impossible>(_: T) {}
| ----------------------------- required by `check`
...
LL | check(xm5::US{});
| ^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::Item`
| ^^^^^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::Item`
error[E0277]: the trait bound `namespace_mix::c::US: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:84:5
--> $DIR/namespace-mix.rs:84:11
|
LL | fn check<T: Impossible>(_: T) {}
| ----------------------------- required by `check`
...
LL | check(xm5::US);
| ^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::US`
| ^^^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::US`
error[E0277]: the trait bound `namespace_mix::c::US: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:85:5
--> $DIR/namespace-mix.rs:85:11
|
LL | fn check<T: Impossible>(_: T) {}
| ----------------------------- required by `check`
...
LL | check(xm6::US{});
| ^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::US`
| ^^^^^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::US`
error[E0277]: the trait bound `namespace_mix::c::Item: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:86:5
--> $DIR/namespace-mix.rs:86:11
|
LL | fn check<T: Impossible>(_: T) {}
| ----------------------------- required by `check`
...
LL | check(xm6::US);
| ^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::Item`
| ^^^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::Item`
error[E0277]: the trait bound `c::Item: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:99:5
--> $DIR/namespace-mix.rs:99:11
|
LL | fn check<T: Impossible>(_: T) {}
| ----------------------------- required by `check`
...
LL | check(m7::V{});
| ^^^^^ the trait `Impossible` is not implemented for `c::Item`
| ^^^^^^^ the trait `Impossible` is not implemented for `c::Item`
error[E0277]: the trait bound `c::E: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:101:5
--> $DIR/namespace-mix.rs:101:11
|
LL | fn check<T: Impossible>(_: T) {}
| ----------------------------- required by `check`
...
LL | check(m8::V{});
| ^^^^^ the trait `Impossible` is not implemented for `c::E`
| ^^^^^^^ the trait `Impossible` is not implemented for `c::E`
error[E0277]: the trait bound `c::Item: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:102:5
--> $DIR/namespace-mix.rs:102:11
|
LL | fn check<T: Impossible>(_: T) {}
| ----------------------------- required by `check`
...
LL | check(m8::V);
| ^^^^^ the trait `Impossible` is not implemented for `c::Item`
| ^^^^^ the trait `Impossible` is not implemented for `c::Item`
error[E0277]: the trait bound `namespace_mix::c::Item: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:105:5
--> $DIR/namespace-mix.rs:105:11
|
LL | fn check<T: Impossible>(_: T) {}
| ----------------------------- required by `check`
...
LL | check(xm7::V{});
| ^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::Item`
| ^^^^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::Item`
error[E0277]: the trait bound `namespace_mix::c::E: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:107:5
--> $DIR/namespace-mix.rs:107:11
|
LL | fn check<T: Impossible>(_: T) {}
| ----------------------------- required by `check`
...
LL | check(xm8::V{});
| ^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::E`
| ^^^^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::E`
error[E0277]: the trait bound `namespace_mix::c::Item: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:108:5
--> $DIR/namespace-mix.rs:108:11
|
LL | fn check<T: Impossible>(_: T) {}
| ----------------------------- required by `check`
...
LL | check(xm8::V);
| ^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::Item`
| ^^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::Item`
error[E0277]: the trait bound `c::Item: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:121:5
--> $DIR/namespace-mix.rs:121:11
|
LL | fn check<T: Impossible>(_: T) {}
| ----------------------------- required by `check`
...
LL | check(m9::TV{});
| ^^^^^ the trait `Impossible` is not implemented for `c::Item`
| ^^^^^^^^ the trait `Impossible` is not implemented for `c::Item`
error[E0277]: the trait bound `fn() -> c::E {c::E::TV}: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:122:5
--> $DIR/namespace-mix.rs:122:11
|
LL | fn check<T: Impossible>(_: T) {}
| ----------------------------- required by `check`
...
LL | check(m9::TV);
| ^^^^^ the trait `Impossible` is not implemented for `fn() -> c::E {c::E::TV}`
| ^^^^^^ the trait `Impossible` is not implemented for `fn() -> c::E {c::E::TV}`
error[E0277]: the trait bound `c::E: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:123:5
--> $DIR/namespace-mix.rs:123:11
|
LL | fn check<T: Impossible>(_: T) {}
| ----------------------------- required by `check`
...
LL | check(mA::TV{});
| ^^^^^ the trait `Impossible` is not implemented for `c::E`
| ^^^^^^^^ the trait `Impossible` is not implemented for `c::E`
error[E0277]: the trait bound `c::Item: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:124:5
--> $DIR/namespace-mix.rs:124:11
|
LL | fn check<T: Impossible>(_: T) {}
| ----------------------------- required by `check`
...
LL | check(mA::TV);
| ^^^^^ the trait `Impossible` is not implemented for `c::Item`
| ^^^^^^ the trait `Impossible` is not implemented for `c::Item`
error[E0277]: the trait bound `namespace_mix::c::Item: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:127:5
--> $DIR/namespace-mix.rs:127:11
|
LL | fn check<T: Impossible>(_: T) {}
| ----------------------------- required by `check`
...
LL | check(xm9::TV{});
| ^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::Item`
| ^^^^^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::Item`
error[E0277]: the trait bound `fn() -> namespace_mix::c::E {namespace_mix::xm7::TV}: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:128:5
--> $DIR/namespace-mix.rs:128:11
|
LL | fn check<T: Impossible>(_: T) {}
| ----------------------------- required by `check`
...
LL | check(xm9::TV);
| ^^^^^ the trait `Impossible` is not implemented for `fn() -> namespace_mix::c::E {namespace_mix::xm7::TV}`
| ^^^^^^^ the trait `Impossible` is not implemented for `fn() -> namespace_mix::c::E {namespace_mix::xm7::TV}`
error[E0277]: the trait bound `namespace_mix::c::E: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:129:5
--> $DIR/namespace-mix.rs:129:11
|
LL | fn check<T: Impossible>(_: T) {}
| ----------------------------- required by `check`
...
LL | check(xmA::TV{});
| ^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::E`
| ^^^^^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::E`
error[E0277]: the trait bound `namespace_mix::c::Item: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:130:5
--> $DIR/namespace-mix.rs:130:11
|
LL | fn check<T: Impossible>(_: T) {}
| ----------------------------- required by `check`
...
LL | check(xmA::TV);
| ^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::Item`
| ^^^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::Item`
error[E0277]: the trait bound `c::Item: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:143:5
--> $DIR/namespace-mix.rs:143:11
|
LL | fn check<T: Impossible>(_: T) {}
| ----------------------------- required by `check`
...
LL | check(mB::UV{});
| ^^^^^ the trait `Impossible` is not implemented for `c::Item`
| ^^^^^^^^ the trait `Impossible` is not implemented for `c::Item`
error[E0277]: the trait bound `c::E: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:144:5
--> $DIR/namespace-mix.rs:144:11
|
LL | fn check<T: Impossible>(_: T) {}
| ----------------------------- required by `check`
...
LL | check(mB::UV);
| ^^^^^ the trait `Impossible` is not implemented for `c::E`
| ^^^^^^ the trait `Impossible` is not implemented for `c::E`
error[E0277]: the trait bound `c::E: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:145:5
--> $DIR/namespace-mix.rs:145:11
|
LL | fn check<T: Impossible>(_: T) {}
| ----------------------------- required by `check`
...
LL | check(mC::UV{});
| ^^^^^ the trait `Impossible` is not implemented for `c::E`
| ^^^^^^^^ the trait `Impossible` is not implemented for `c::E`
error[E0277]: the trait bound `c::Item: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:146:5
--> $DIR/namespace-mix.rs:146:11
|
LL | fn check<T: Impossible>(_: T) {}
| ----------------------------- required by `check`
...
LL | check(mC::UV);
| ^^^^^ the trait `Impossible` is not implemented for `c::Item`
| ^^^^^^ the trait `Impossible` is not implemented for `c::Item`
error[E0277]: the trait bound `namespace_mix::c::Item: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:149:5
--> $DIR/namespace-mix.rs:149:11
|
LL | fn check<T: Impossible>(_: T) {}
| ----------------------------- required by `check`
...
LL | check(xmB::UV{});
| ^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::Item`
| ^^^^^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::Item`
error[E0277]: the trait bound `namespace_mix::c::E: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:150:5
--> $DIR/namespace-mix.rs:150:11
|
LL | fn check<T: Impossible>(_: T) {}
| ----------------------------- required by `check`
...
LL | check(xmB::UV);
| ^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::E`
| ^^^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::E`
error[E0277]: the trait bound `namespace_mix::c::E: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:151:5
--> $DIR/namespace-mix.rs:151:11
|
LL | fn check<T: Impossible>(_: T) {}
| ----------------------------- required by `check`
...
LL | check(xmC::UV{});
| ^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::E`
| ^^^^^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::E`
error[E0277]: the trait bound `namespace_mix::c::Item: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:152:5
--> $DIR/namespace-mix.rs:152:11
|
LL | fn check<T: Impossible>(_: T) {}
| ----------------------------- required by `check`
...
LL | check(xmC::UV);
| ^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::Item`
| ^^^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::Item`
error: aborting due to 48 previous errors

View File

@ -1,11 +1,11 @@
error[E0277]: `std::rc::Rc<{integer}>` cannot be sent between threads safely
--> $DIR/no_send-rc.rs:7:5
--> $DIR/no_send-rc.rs:7:9
|
LL | fn bar<T: Send>(_: T) {}
| --------------------- required by `bar`
...
LL | bar(x);
| ^^^ `std::rc::Rc<{integer}>` cannot be sent between threads safely
| ^ `std::rc::Rc<{integer}>` cannot be sent between threads safely
|
= help: the trait `std::marker::Send` is not implemented for `std::rc::Rc<{integer}>`

View File

@ -1,11 +1,11 @@
error[E0277]: `Foo` cannot be sent between threads safely
--> $DIR/no_send-struct.rs:15:5
--> $DIR/no_send-struct.rs:15:9
|
LL | fn bar<T: Send>(_: T) {}
| --------------------- required by `bar`
...
LL | bar(x);
| ^^^ `Foo` cannot be sent between threads safely
| ^ `Foo` cannot be sent between threads safely
|
= help: the trait `std::marker::Send` is not implemented for `Foo`

View File

@ -1,11 +1,11 @@
error[E0277]: `Foo` cannot be shared between threads safely
--> $DIR/no_share-struct.rs:12:5
--> $DIR/no_share-struct.rs:12:9
|
LL | fn bar<T: Sync>(_: T) {}
| --------------------- required by `bar`
...
LL | bar(x);
| ^^^ `Foo` cannot be shared between threads safely
| ^ `Foo` cannot be shared between threads safely
|
= help: the trait `std::marker::Sync` is not implemented for `Foo`

View File

@ -1,10 +1,10 @@
error[E0277]: the trait bound `std::boxed::Box<dyn Foo>: Foo` is not satisfied
--> $DIR/object-does-not-impl-trait.rs:6:35
--> $DIR/object-does-not-impl-trait.rs:6:44
|
LL | fn take_foo<F:Foo>(f: F) {}
| ------------------------ required by `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>`
| ^ the trait `Foo` is not implemented for `std::boxed::Box<dyn Foo>`
error: aborting due to previous error

View File

@ -1,60 +1,60 @@
error[E0277]: the trait bound `[i32]: Index<u32>` is not satisfied
--> $DIR/multiple-impls.rs:33:5
--> $DIR/multiple-impls.rs:33:18
|
LL | fn index(&self, index: Idx) -> &Self::Output;
| --------------------------------------------- required by `Index::index`
...
LL | Index::index(&[] as &[i32], 2u32);
| ^^^^^^^^^^^^^ trait message
|
= help: the trait `Index<u32>` is not implemented for `[i32]`
error[E0277]: the trait bound `[i32]: Index<Foo<u32>>` is not satisfied
--> $DIR/multiple-impls.rs:36:18
|
LL | fn index(&self, index: Idx) -> &Self::Output;
| --------------------------------------------- required by `Index::index`
...
LL | Index::index(&[] as &[i32], Foo(2u32));
| ^^^^^^^^^^^^^ on impl for Foo
|
= help: the trait `Index<Foo<u32>>` is not implemented for `[i32]`
error[E0277]: the trait bound `[i32]: Index<Bar<u32>>` is not satisfied
--> $DIR/multiple-impls.rs:39:18
|
LL | fn index(&self, index: Idx) -> &Self::Output;
| --------------------------------------------- required by `Index::index`
...
LL | Index::index(&[] as &[i32], Bar(2u32));
| ^^^^^^^^^^^^^ on impl for Bar
|
= help: the trait `Index<Bar<u32>>` is not implemented for `[i32]`
error[E0277]: the trait bound `[i32]: Index<u32>` is not satisfied
--> $DIR/multiple-impls.rs:33:5
|
LL | Index::index(&[] as &[i32], 2u32);
| ^^^^^^^^^^^^ trait message
|
= help: the trait `Index<u32>` is not implemented for `[i32]`
error[E0277]: the trait bound `[i32]: Index<u32>` is not satisfied
--> $DIR/multiple-impls.rs:33:5
|
LL | Index::index(&[] as &[i32], 2u32);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ trait message
|
= help: the trait `Index<u32>` is not implemented for `[i32]`
error[E0277]: the trait bound `[i32]: Index<Foo<u32>>` is not satisfied
--> $DIR/multiple-impls.rs:36:5
|
LL | fn index(&self, index: Idx) -> &Self::Output;
| --------------------------------------------- required by `Index::index`
...
LL | Index::index(&[] as &[i32], Foo(2u32));
| ^^^^^^^^^^^^ on impl for Foo
|
= help: the trait `Index<Foo<u32>>` is not implemented for `[i32]`
error[E0277]: the trait bound `[i32]: Index<Foo<u32>>` is not satisfied
--> $DIR/multiple-impls.rs:36:5
|
LL | Index::index(&[] as &[i32], Foo(2u32));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ on impl for Foo
|
= help: the trait `Index<Foo<u32>>` is not implemented for `[i32]`
error[E0277]: the trait bound `[i32]: Index<Bar<u32>>` is not satisfied
--> $DIR/multiple-impls.rs:39:5
|
LL | fn index(&self, index: Idx) -> &Self::Output;
| --------------------------------------------- required by `Index::index`
...
LL | Index::index(&[] as &[i32], Bar(2u32));
| ^^^^^^^^^^^^ on impl for Bar
|
= help: the trait `Index<Bar<u32>>` is not implemented for `[i32]`
error[E0277]: the trait bound `[i32]: Index<Bar<u32>>` is not satisfied
--> $DIR/multiple-impls.rs:39:5
|
LL | Index::index(&[] as &[i32], Bar(2u32));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ on impl for Bar
|
= help: the trait `Index<Bar<u32>>` is not implemented for `[i32]`
error: aborting due to 6 previous errors
For more information about this error, try `rustc --explain E0277`.

View File

@ -1,11 +1,11 @@
error[E0277]: the trait bound `[i32]: Index<u32>` is not satisfied
--> $DIR/on-impl.rs:22:5
--> $DIR/on-impl.rs:22:25
|
LL | fn index(&self, index: Idx) -> &Self::Output;
| --------------------------------------------- required by `Index::index`
...
LL | Index::<u32>::index(&[1, 2, 3] as &[i32], 2u32);
| ^^^^^^^^^^^^^^^^^^^ a usize is required to index into a slice
| ^^^^^^^^^^^^^^^^^^^^ a usize is required to index into a slice
|
= help: the trait `Index<u32>` is not implemented for `[i32]`
@ -13,7 +13,7 @@ error[E0277]: the trait bound `[i32]: Index<u32>` is not satisfied
--> $DIR/on-impl.rs:22:5
|
LL | Index::<u32>::index(&[1, 2, 3] as &[i32], 2u32);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ a usize is required to index into a slice
| ^^^^^^^^^^^^^^^^^^^ a usize is required to index into a slice
|
= help: the trait `Index<u32>` is not implemented for `[i32]`

View File

@ -1,11 +1,11 @@
error[E0277]: `T` cannot be shared between threads safely
--> $DIR/phantom-oibit.rs:21:5
--> $DIR/phantom-oibit.rs:21:12
|
LL | fn is_zen<T: Zen>(_: T) {}
| ----------------------- required by `is_zen`
...
LL | is_zen(x)
| ^^^^^^ `T` cannot be shared between threads safely
| ^ `T` cannot be shared between threads safely
|
= help: the trait `std::marker::Sync` is not implemented for `T`
= help: consider adding a `where T: std::marker::Sync` bound
@ -14,13 +14,13 @@ LL | is_zen(x)
= note: required because it appears within the type `Guard<'_, T>`
error[E0277]: `T` cannot be shared between threads safely
--> $DIR/phantom-oibit.rs:26:5
--> $DIR/phantom-oibit.rs:26:12
|
LL | fn is_zen<T: Zen>(_: T) {}
| ----------------------- required by `is_zen`
...
LL | is_zen(x)
| ^^^^^^ `T` cannot be shared between threads safely
| ^ `T` cannot be shared between threads safely
|
= help: the trait `std::marker::Sync` is not implemented for `T`
= help: consider adding a `where T: std::marker::Sync` bound

View File

@ -10,20 +10,20 @@ LL | let _: u8 = s[4];
= note: required because of the requirements on the impl of `std::ops::Index<{integer}>` for `str`
error[E0277]: the type `str` cannot be indexed by `{integer}`
--> $DIR/str-idx.rs:4:15
--> $DIR/str-idx.rs:4:19
|
LL | let _ = s.get(4);
| ^^^ string indices are ranges of `usize`
| ^ string indices are ranges of `usize`
|
= help: the trait `std::slice::SliceIndex<str>` is not implemented for `{integer}`
= note: you can use `.chars().nth()` or `.bytes().nth()`
see chapter in The Book <https://doc.rust-lang.org/book/ch08-02-strings.html#indexing-into-strings>
error[E0277]: the type `str` cannot be indexed by `{integer}`
--> $DIR/str-idx.rs:5:15
--> $DIR/str-idx.rs:5:29
|
LL | let _ = s.get_unchecked(4);
| ^^^^^^^^^^^^^ string indices are ranges of `usize`
| ^ string indices are ranges of `usize`
|
= help: the trait `std::slice::SliceIndex<str>` is not implemented for `{integer}`
= note: you can use `.chars().nth()` or `.bytes().nth()`

View File

@ -30,20 +30,20 @@ LL | s[1usize] = bot();
= note: required because of the requirements on the impl of `std::ops::Index<usize>` for `str`
error[E0277]: the type `str` cannot be indexed by `{integer}`
--> $DIR/str-mut-idx.rs:9:7
--> $DIR/str-mut-idx.rs:9:15
|
LL | s.get_mut(1);
| ^^^^^^^ string indices are ranges of `usize`
| ^ string indices are ranges of `usize`
|
= help: the trait `std::slice::SliceIndex<str>` is not implemented for `{integer}`
= note: you can use `.chars().nth()` or `.bytes().nth()`
see chapter in The Book <https://doc.rust-lang.org/book/ch08-02-strings.html#indexing-into-strings>
error[E0277]: the type `str` cannot be indexed by `{integer}`
--> $DIR/str-mut-idx.rs:11:7
--> $DIR/str-mut-idx.rs:11:25
|
LL | s.get_unchecked_mut(1);
| ^^^^^^^^^^^^^^^^^ string indices are ranges of `usize`
| ^ string indices are ranges of `usize`
|
= help: the trait `std::slice::SliceIndex<str>` is not implemented for `{integer}`
= note: you can use `.chars().nth()` or `.bytes().nth()`

View File

@ -1,13 +1,14 @@
error[E0277]: the trait bound `fn() -> impl std::future::Future {foo}: std::future::Future` is not satisfied
--> $DIR/async-fn-ctor-passed-as-arg-where-it-should-have-been-called.rs:9:5
--> $DIR/async-fn-ctor-passed-as-arg-where-it-should-have-been-called.rs:9:9
|
LL | fn bar(f: impl Future<Output=()>) {}
| --------------------------------- required by `bar`
...
LL | bar(foo);
| ^^^ the trait `std::future::Future` is not implemented for `fn() -> impl std::future::Future {foo}`
|
= help: use parentheses to call the function: `foo()`
| ^^^
| |
| the trait `std::future::Future` is not implemented for `fn() -> impl std::future::Future {foo}`
| help: use parentheses to call the function: `foo()`
error: aborting due to previous error

View File

@ -1,13 +1,14 @@
error[E0277]: the trait bound `fn() -> impl T {foo}: T` is not satisfied
--> $DIR/fn-ctor-passed-as-arg-where-it-should-have-been-called.rs:17:5
--> $DIR/fn-ctor-passed-as-arg-where-it-should-have-been-called.rs:17:9
|
LL | fn bar(f: impl T<O=()>) {}
| ----------------------- required by `bar`
...
LL | bar(foo);
| ^^^ the trait `T` is not implemented for `fn() -> impl T {foo}`
|
= help: use parentheses to call the function: `foo()`
| ^^^
| |
| the trait `T` is not implemented for `fn() -> impl T {foo}`
| help: use parentheses to call the function: `foo()`
error: aborting due to previous error

View File

@ -1,8 +1,8 @@
error[E0277]: expected a `std::ops::FnMut<(char,)>` closure, found `std::string::String`
--> $DIR/issue-62843.rs:4:27
--> $DIR/issue-62843.rs:4:32
|
LL | println!("{:?}", line.find(pattern));
| ^^^^ expected an `FnMut<(char,)>` closure, found `std::string::String`
| ^^^^^^^ expected an `FnMut<(char,)>` closure, found `std::string::String`
|
= help: the trait `std::ops::FnMut<(char,)>` is not implemented for `std::string::String`
= note: borrowing the `std::string::String` might fix the problem

View File

@ -5,13 +5,13 @@ LL | auto trait Magic: Copy {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0277]: the trait bound `NoClone: std::marker::Copy` is not satisfied
--> $DIR/traits-inductive-overflow-supertrait-oibit.rs:15:18
--> $DIR/traits-inductive-overflow-supertrait-oibit.rs:15:23
|
LL | fn copy<T: Magic>(x: T) -> (T, T) { (x, x) }
| --------------------------------- required by `copy`
...
LL | let (a, b) = copy(NoClone);
| ^^^^ the trait `std::marker::Copy` is not implemented for `NoClone`
| ^^^^^^^ the trait `std::marker::Copy` is not implemented for `NoClone`
|
= note: required because of the requirements on the impl of `Magic` for `NoClone`

View File

@ -1,11 +1,11 @@
error[E0277]: `dummy::TestType` cannot be sent between threads safely
--> $DIR/traits-negative-impls.rs:23:5
--> $DIR/traits-negative-impls.rs:23:11
|
LL | struct Outer<T: Send>(T);
| ------------------------- required by `Outer`
...
LL | Outer(TestType);
| ^^^^^ `dummy::TestType` cannot be sent between threads safely
| ^^^^^^^^ `dummy::TestType` cannot be sent between threads safely
|
= help: the trait `std::marker::Send` is not implemented for `dummy::TestType`
@ -21,49 +21,49 @@ LL | Outer(TestType);
= help: the trait `std::marker::Send` is not implemented for `dummy::TestType`
error[E0277]: `dummy1b::TestType` cannot be sent between threads safely
--> $DIR/traits-negative-impls.rs:32:5
--> $DIR/traits-negative-impls.rs:32:13
|
LL | fn is_send<T: Send>(_: T) {}
| ------------------------- required by `is_send`
...
LL | is_send(TestType);
| ^^^^^^^ `dummy1b::TestType` cannot be sent between threads safely
| ^^^^^^^^ `dummy1b::TestType` cannot be sent between threads safely
|
= help: the trait `std::marker::Send` is not implemented for `dummy1b::TestType`
error[E0277]: `dummy1c::TestType` cannot be sent between threads safely
--> $DIR/traits-negative-impls.rs:40:5
--> $DIR/traits-negative-impls.rs:40:13
|
LL | fn is_send<T: Send>(_: T) {}
| ------------------------- required by `is_send`
...
LL | is_send((8, TestType));
| ^^^^^^^ `dummy1c::TestType` cannot be sent between threads safely
| ^^^^^^^^^^^^^ `dummy1c::TestType` cannot be sent between threads safely
|
= help: within `({integer}, dummy1c::TestType)`, the trait `std::marker::Send` is not implemented for `dummy1c::TestType`
= note: required because it appears within the type `({integer}, dummy1c::TestType)`
error[E0277]: `dummy2::TestType` cannot be sent between threads safely
--> $DIR/traits-negative-impls.rs:48:5
--> $DIR/traits-negative-impls.rs:48:13
|
LL | fn is_send<T: Send>(_: T) {}
| ------------------------- required by `is_send`
...
LL | is_send(Box::new(TestType));
| ^^^^^^^ `dummy2::TestType` cannot be sent between threads safely
| ^^^^^^^^^^^^^^^^^^ `dummy2::TestType` cannot be sent between threads safely
|
= help: the trait `std::marker::Send` is not implemented for `dummy2::TestType`
= note: required because of the requirements on the impl of `std::marker::Send` for `std::ptr::Unique<dummy2::TestType>`
= note: required because it appears within the type `std::boxed::Box<dummy2::TestType>`
error[E0277]: `dummy3::TestType` cannot be sent between threads safely
--> $DIR/traits-negative-impls.rs:56:5
--> $DIR/traits-negative-impls.rs:56:13
|
LL | fn is_send<T: Send>(_: T) {}
| ------------------------- required by `is_send`
...
LL | is_send(Box::new(Outer2(TestType)));
| ^^^^^^^ `dummy3::TestType` cannot be sent between threads safely
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ `dummy3::TestType` cannot be sent between threads safely
|
= help: within `Outer2<dummy3::TestType>`, the trait `std::marker::Send` is not implemented for `dummy3::TestType`
= note: required because it appears within the type `Outer2<dummy3::TestType>`
@ -71,13 +71,13 @@ LL | is_send(Box::new(Outer2(TestType)));
= note: required because it appears within the type `std::boxed::Box<Outer2<dummy3::TestType>>`
error[E0277]: `main::TestType` cannot be sent between threads safely
--> $DIR/traits-negative-impls.rs:66:5
--> $DIR/traits-negative-impls.rs:66:13
|
LL | fn is_sync<T: Sync>(_: T) {}
| ------------------------- required by `is_sync`
...
LL | is_sync(Outer2(TestType));
| ^^^^^^^ `main::TestType` cannot be sent between threads safely
| ^^^^^^^^^^^^^^^^ `main::TestType` cannot be sent between threads safely
|
= help: the trait `std::marker::Send` is not implemented for `main::TestType`
= note: required because of the requirements on the impl of `std::marker::Sync` for `Outer2<main::TestType>`

View File

@ -19,19 +19,19 @@ LL | 3i32.test();
candidate #1: `Foo`
error[E0277]: the trait bound `i32: Foo` is not satisfied
--> $DIR/trivial-bounds-leak.rs:25:5
--> $DIR/trivial-bounds-leak.rs:25:15
|
LL | fn test(&self);
| --------------- required by `Foo::test`
...
LL | Foo::test(&4i32);
| ^^^^^^^^^ the trait `Foo` is not implemented for `i32`
| ^^^^^ the trait `Foo` is not implemented for `i32`
error[E0277]: the trait bound `i32: Foo` is not satisfied
--> $DIR/trivial-bounds-leak.rs:26:5
--> $DIR/trivial-bounds-leak.rs:26:22
|
LL | generic_function(5i32);
| ^^^^^^^^^^^^^^^^ the trait `Foo` is not implemented for `i32`
| ^^^^ the trait `Foo` is not implemented for `i32`
...
LL | fn generic_function<T: Foo>(t: T) {}
| --------------------------------- required by `generic_function`

View File

@ -19,7 +19,7 @@ fn main() {
fn try_trait_generic<T: Try>() -> T {
// and a non-`Try` object on a `Try` fn.
()?; //~ ERROR the `?` operator can only
()?; //~ ERROR the `?` operator can only be applied to values that implement `std::ops::Try`
loop {}
}

View File

@ -20,30 +20,30 @@ LL | struct WellFormedNoBounds<Z:?Sized = Foo<i32, i32>>(Z);
= help: the trait `std::iter::FromIterator<i32>` is not implemented for `i32`
error[E0277]: the trait bound `std::string::String: std::marker::Copy` is not satisfied
--> $DIR/type-check-defaults.rs:11:1
--> $DIR/type-check-defaults.rs:11:17
|
LL | struct Bounds<T:Copy=String>(T);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| the trait `std::marker::Copy` is not implemented for `std::string::String`
| ----------------^^^^------------
| | |
| | the trait `std::marker::Copy` is not implemented for `std::string::String`
| required by `Bounds`
error[E0277]: the trait bound `std::string::String: std::marker::Copy` is not satisfied
--> $DIR/type-check-defaults.rs:14:1
--> $DIR/type-check-defaults.rs:14:42
|
LL | struct WhereClause<T=String>(T) where T: Copy;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| the trait `std::marker::Copy` is not implemented for `std::string::String`
| -----------------------------------------^^^^-
| | |
| | the trait `std::marker::Copy` is not implemented for `std::string::String`
| required by `WhereClause`
error[E0277]: the trait bound `std::string::String: std::marker::Copy` is not satisfied
--> $DIR/type-check-defaults.rs:17:1
--> $DIR/type-check-defaults.rs:17:20
|
LL | trait TraitBound<T:Copy=String> {}
| -------------------------------^^^
| |
| the trait `std::marker::Copy` is not implemented for `std::string::String`
| -------------------^^^^--------
| | |
| | the trait `std::marker::Copy` is not implemented for `std::string::String`
| required by `TraitBound`
error[E0277]: the trait bound `T: std::marker::Copy` is not satisfied
@ -57,12 +57,12 @@ LL | trait Base<T = String>: Super<T> { }
= help: consider adding a `where T: std::marker::Copy` bound
error[E0277]: cannot add `u8` to `i32`
--> $DIR/type-check-defaults.rs:24:1
--> $DIR/type-check-defaults.rs:24:66
|
LL | trait ProjectionPred<T:Iterator = IntoIter<i32>> where T::Item : Add<u8> {}
| ------------------------------------------------------------------------^^^
| |
| no implementation for `i32 + u8`
| -----------------------------------------------------------------^^^^^^^
| | |
| | no implementation for `i32 + u8`
| required by `ProjectionPred`
|
= help: the trait `std::ops::Add<u8>` is not implemented for `i32`

View File

@ -1,22 +1,22 @@
error[E0277]: `std::cell::UnsafeCell<MySync<{integer}>>` cannot be shared between threads safely
--> $DIR/typeck-unsafe-always-share.rs:19:5
--> $DIR/typeck-unsafe-always-share.rs:19:10
|
LL | fn test<T: Sync>(s: T) {}
| ---------------------- required by `test`
...
LL | test(us);
| ^^^^ `std::cell::UnsafeCell<MySync<{integer}>>` cannot be shared between threads safely
| ^^ `std::cell::UnsafeCell<MySync<{integer}>>` cannot be shared between threads safely
|
= help: the trait `std::marker::Sync` is not implemented for `std::cell::UnsafeCell<MySync<{integer}>>`
error[E0277]: `std::cell::UnsafeCell<NoSync>` cannot be shared between threads safely
--> $DIR/typeck-unsafe-always-share.rs:23:5
--> $DIR/typeck-unsafe-always-share.rs:23:10
|
LL | fn test<T: Sync>(s: T) {}
| ---------------------- required by `test`
...
LL | test(uns);
| ^^^^ `std::cell::UnsafeCell<NoSync>` cannot be shared between threads safely
| ^^^ `std::cell::UnsafeCell<NoSync>` cannot be shared between threads safely
|
= help: the trait `std::marker::Sync` is not implemented for `std::cell::UnsafeCell<NoSync>`
@ -33,13 +33,13 @@ LL | test(ms);
= note: required because it appears within the type `MySync<NoSync>`
error[E0277]: `NoSync` cannot be shared between threads safely
--> $DIR/typeck-unsafe-always-share.rs:30:5
--> $DIR/typeck-unsafe-always-share.rs:30:10
|
LL | fn test<T: Sync>(s: T) {}
| ---------------------- required by `test`
...
LL | test(NoSync);
| ^^^^ `NoSync` cannot be shared between threads safely
| ^^^^^^ `NoSync` cannot be shared between threads safely
|
= help: the trait `std::marker::Sync` is not implemented for `NoSync`

View File

@ -1,11 +1,11 @@
error[E0277]: expected a `std::ops::Fn<(isize,)>` closure, found `S`
--> $DIR/unboxed-closures-fnmut-as-fn.rs:28:13
--> $DIR/unboxed-closures-fnmut-as-fn.rs:28:21
|
LL | fn call_it<F:Fn(isize)->isize>(f: &F, x: isize) -> isize {
| -------------------------------------------------------- required by `call_it`
...
LL | let x = call_it(&S, 22);
| ^^^^^^^ expected an `Fn<(isize,)>` closure, found `S`
| ^^ expected an `Fn<(isize,)>` closure, found `S`
|
= help: the trait `std::ops::Fn<(isize,)>` is not implemented for `S`

View File

@ -1,55 +1,55 @@
error[E0277]: expected a `std::ops::Fn<(&isize,)>` closure, found `for<'r> unsafe fn(&'r isize) -> isize {square}`
--> $DIR/unboxed-closures-unsafe-extern-fn.rs:12:13
--> $DIR/unboxed-closures-unsafe-extern-fn.rs:12:21
|
LL | fn call_it<F:Fn(&isize)->isize>(_: &F, _: isize) -> isize { 0 }
| --------------------------------------------------------- required by `call_it`
...
LL | let x = call_it(&square, 22);
| ^^^^^^^ expected an `Fn<(&isize,)>` closure, found `for<'r> unsafe fn(&'r isize) -> isize {square}`
| ^^^^^^^ expected an `Fn<(&isize,)>` closure, found `for<'r> unsafe fn(&'r isize) -> isize {square}`
|
= help: the trait `for<'r> std::ops::Fn<(&'r isize,)>` is not implemented for `for<'r> unsafe fn(&'r isize) -> isize {square}`
error[E0277]: expected a `std::ops::FnOnce<(&isize,)>` closure, found `for<'r> unsafe fn(&'r isize) -> isize {square}`
--> $DIR/unboxed-closures-unsafe-extern-fn.rs:12:13
--> $DIR/unboxed-closures-unsafe-extern-fn.rs:12:21
|
LL | fn call_it<F:Fn(&isize)->isize>(_: &F, _: isize) -> isize { 0 }
| --------------------------------------------------------- required by `call_it`
...
LL | let x = call_it(&square, 22);
| ^^^^^^^ expected an `FnOnce<(&isize,)>` closure, found `for<'r> unsafe fn(&'r isize) -> isize {square}`
| ^^^^^^^ expected an `FnOnce<(&isize,)>` closure, found `for<'r> unsafe fn(&'r isize) -> isize {square}`
|
= help: the trait `std::ops::FnOnce<(&isize,)>` is not implemented for `for<'r> unsafe fn(&'r isize) -> isize {square}`
error[E0277]: expected a `std::ops::FnMut<(&isize,)>` closure, found `for<'r> unsafe fn(&'r isize) -> isize {square}`
--> $DIR/unboxed-closures-unsafe-extern-fn.rs:18:13
--> $DIR/unboxed-closures-unsafe-extern-fn.rs:18:25
|
LL | fn call_it_mut<F:FnMut(&isize)->isize>(_: &mut F, _: isize) -> isize { 0 }
| -------------------------------------------------------------------- required by `call_it_mut`
...
LL | let y = call_it_mut(&mut square, 22);
| ^^^^^^^^^^^ expected an `FnMut<(&isize,)>` closure, found `for<'r> unsafe fn(&'r isize) -> isize {square}`
| ^^^^^^^^^^^ expected an `FnMut<(&isize,)>` closure, found `for<'r> unsafe fn(&'r isize) -> isize {square}`
|
= help: the trait `for<'r> std::ops::FnMut<(&'r isize,)>` is not implemented for `for<'r> unsafe fn(&'r isize) -> isize {square}`
error[E0277]: expected a `std::ops::FnOnce<(&isize,)>` closure, found `for<'r> unsafe fn(&'r isize) -> isize {square}`
--> $DIR/unboxed-closures-unsafe-extern-fn.rs:18:13
--> $DIR/unboxed-closures-unsafe-extern-fn.rs:18:25
|
LL | fn call_it_mut<F:FnMut(&isize)->isize>(_: &mut F, _: isize) -> isize { 0 }
| -------------------------------------------------------------------- required by `call_it_mut`
...
LL | let y = call_it_mut(&mut square, 22);
| ^^^^^^^^^^^ expected an `FnOnce<(&isize,)>` closure, found `for<'r> unsafe fn(&'r isize) -> isize {square}`
| ^^^^^^^^^^^ expected an `FnOnce<(&isize,)>` closure, found `for<'r> unsafe fn(&'r isize) -> isize {square}`
|
= help: the trait `std::ops::FnOnce<(&isize,)>` is not implemented for `for<'r> unsafe fn(&'r isize) -> isize {square}`
error[E0277]: expected a `std::ops::FnOnce<(&isize,)>` closure, found `for<'r> unsafe fn(&'r isize) -> isize {square}`
--> $DIR/unboxed-closures-unsafe-extern-fn.rs:24:13
--> $DIR/unboxed-closures-unsafe-extern-fn.rs:24:26
|
LL | fn call_it_once<F:FnOnce(&isize)->isize>(_: F, _: isize) -> isize { 0 }
| ----------------------------------------------------------------- required by `call_it_once`
...
LL | let z = call_it_once(square, 22);
| ^^^^^^^^^^^^ expected an `FnOnce<(&isize,)>` closure, found `for<'r> unsafe fn(&'r isize) -> isize {square}`
| ^^^^^^ expected an `FnOnce<(&isize,)>` closure, found `for<'r> unsafe fn(&'r isize) -> isize {square}`
|
= help: the trait `std::ops::FnOnce<(&isize,)>` is not implemented for `for<'r> unsafe fn(&'r isize) -> isize {square}`

View File

@ -1,55 +1,55 @@
error[E0277]: expected a `std::ops::Fn<(&isize,)>` closure, found `for<'r> extern "C" fn(&'r isize) -> isize {square}`
--> $DIR/unboxed-closures-wrong-abi.rs:12:13
--> $DIR/unboxed-closures-wrong-abi.rs:12:21
|
LL | fn call_it<F:Fn(&isize)->isize>(_: &F, _: isize) -> isize { 0 }
| --------------------------------------------------------- required by `call_it`
...
LL | let x = call_it(&square, 22);
| ^^^^^^^ expected an `Fn<(&isize,)>` closure, found `for<'r> extern "C" fn(&'r isize) -> isize {square}`
| ^^^^^^^ expected an `Fn<(&isize,)>` closure, found `for<'r> extern "C" fn(&'r isize) -> isize {square}`
|
= help: the trait `for<'r> std::ops::Fn<(&'r isize,)>` is not implemented for `for<'r> extern "C" fn(&'r isize) -> isize {square}`
error[E0277]: expected a `std::ops::FnOnce<(&isize,)>` closure, found `for<'r> extern "C" fn(&'r isize) -> isize {square}`
--> $DIR/unboxed-closures-wrong-abi.rs:12:13
--> $DIR/unboxed-closures-wrong-abi.rs:12:21
|
LL | fn call_it<F:Fn(&isize)->isize>(_: &F, _: isize) -> isize { 0 }
| --------------------------------------------------------- required by `call_it`
...
LL | let x = call_it(&square, 22);
| ^^^^^^^ expected an `FnOnce<(&isize,)>` closure, found `for<'r> extern "C" fn(&'r isize) -> isize {square}`
| ^^^^^^^ expected an `FnOnce<(&isize,)>` closure, found `for<'r> extern "C" fn(&'r isize) -> isize {square}`
|
= help: the trait `std::ops::FnOnce<(&isize,)>` is not implemented for `for<'r> extern "C" fn(&'r isize) -> isize {square}`
error[E0277]: expected a `std::ops::FnMut<(&isize,)>` closure, found `for<'r> extern "C" fn(&'r isize) -> isize {square}`
--> $DIR/unboxed-closures-wrong-abi.rs:18:13
--> $DIR/unboxed-closures-wrong-abi.rs:18:25
|
LL | fn call_it_mut<F:FnMut(&isize)->isize>(_: &mut F, _: isize) -> isize { 0 }
| -------------------------------------------------------------------- required by `call_it_mut`
...
LL | let y = call_it_mut(&mut square, 22);
| ^^^^^^^^^^^ expected an `FnMut<(&isize,)>` closure, found `for<'r> extern "C" fn(&'r isize) -> isize {square}`
| ^^^^^^^^^^^ expected an `FnMut<(&isize,)>` closure, found `for<'r> extern "C" fn(&'r isize) -> isize {square}`
|
= help: the trait `for<'r> std::ops::FnMut<(&'r isize,)>` is not implemented for `for<'r> extern "C" fn(&'r isize) -> isize {square}`
error[E0277]: expected a `std::ops::FnOnce<(&isize,)>` closure, found `for<'r> extern "C" fn(&'r isize) -> isize {square}`
--> $DIR/unboxed-closures-wrong-abi.rs:18:13
--> $DIR/unboxed-closures-wrong-abi.rs:18:25
|
LL | fn call_it_mut<F:FnMut(&isize)->isize>(_: &mut F, _: isize) -> isize { 0 }
| -------------------------------------------------------------------- required by `call_it_mut`
...
LL | let y = call_it_mut(&mut square, 22);
| ^^^^^^^^^^^ expected an `FnOnce<(&isize,)>` closure, found `for<'r> extern "C" fn(&'r isize) -> isize {square}`
| ^^^^^^^^^^^ expected an `FnOnce<(&isize,)>` closure, found `for<'r> extern "C" fn(&'r isize) -> isize {square}`
|
= help: the trait `std::ops::FnOnce<(&isize,)>` is not implemented for `for<'r> extern "C" fn(&'r isize) -> isize {square}`
error[E0277]: expected a `std::ops::FnOnce<(&isize,)>` closure, found `for<'r> extern "C" fn(&'r isize) -> isize {square}`
--> $DIR/unboxed-closures-wrong-abi.rs:24:13
--> $DIR/unboxed-closures-wrong-abi.rs:24:26
|
LL | fn call_it_once<F:FnOnce(&isize)->isize>(_: F, _: isize) -> isize { 0 }
| ----------------------------------------------------------------- required by `call_it_once`
...
LL | let z = call_it_once(square, 22);
| ^^^^^^^^^^^^ expected an `FnOnce<(&isize,)>` closure, found `for<'r> extern "C" fn(&'r isize) -> isize {square}`
| ^^^^^^ expected an `FnOnce<(&isize,)>` closure, found `for<'r> extern "C" fn(&'r isize) -> isize {square}`
|
= help: the trait `std::ops::FnOnce<(&isize,)>` is not implemented for `for<'r> extern "C" fn(&'r isize) -> isize {square}`

View File

@ -1,55 +1,55 @@
error[E0277]: expected a `std::ops::Fn<(&isize,)>` closure, found `unsafe fn(isize) -> isize {square}`
--> $DIR/unboxed-closures-wrong-arg-type-extern-fn.rs:13:13
--> $DIR/unboxed-closures-wrong-arg-type-extern-fn.rs:13:21
|
LL | fn call_it<F:Fn(&isize)->isize>(_: &F, _: isize) -> isize { 0 }
| --------------------------------------------------------- required by `call_it`
...
LL | let x = call_it(&square, 22);
| ^^^^^^^ expected an `Fn<(&isize,)>` closure, found `unsafe fn(isize) -> isize {square}`
| ^^^^^^^ expected an `Fn<(&isize,)>` closure, found `unsafe fn(isize) -> isize {square}`
|
= help: the trait `for<'r> std::ops::Fn<(&'r isize,)>` is not implemented for `unsafe fn(isize) -> isize {square}`
error[E0277]: expected a `std::ops::FnOnce<(&isize,)>` closure, found `unsafe fn(isize) -> isize {square}`
--> $DIR/unboxed-closures-wrong-arg-type-extern-fn.rs:13:13
--> $DIR/unboxed-closures-wrong-arg-type-extern-fn.rs:13:21
|
LL | fn call_it<F:Fn(&isize)->isize>(_: &F, _: isize) -> isize { 0 }
| --------------------------------------------------------- required by `call_it`
...
LL | let x = call_it(&square, 22);
| ^^^^^^^ expected an `FnOnce<(&isize,)>` closure, found `unsafe fn(isize) -> isize {square}`
| ^^^^^^^ expected an `FnOnce<(&isize,)>` closure, found `unsafe fn(isize) -> isize {square}`
|
= help: the trait `std::ops::FnOnce<(&isize,)>` is not implemented for `unsafe fn(isize) -> isize {square}`
error[E0277]: expected a `std::ops::FnMut<(&isize,)>` closure, found `unsafe fn(isize) -> isize {square}`
--> $DIR/unboxed-closures-wrong-arg-type-extern-fn.rs:19:13
--> $DIR/unboxed-closures-wrong-arg-type-extern-fn.rs:19:25
|
LL | fn call_it_mut<F:FnMut(&isize)->isize>(_: &mut F, _: isize) -> isize { 0 }
| -------------------------------------------------------------------- required by `call_it_mut`
...
LL | let y = call_it_mut(&mut square, 22);
| ^^^^^^^^^^^ expected an `FnMut<(&isize,)>` closure, found `unsafe fn(isize) -> isize {square}`
| ^^^^^^^^^^^ expected an `FnMut<(&isize,)>` closure, found `unsafe fn(isize) -> isize {square}`
|
= help: the trait `for<'r> std::ops::FnMut<(&'r isize,)>` is not implemented for `unsafe fn(isize) -> isize {square}`
error[E0277]: expected a `std::ops::FnOnce<(&isize,)>` closure, found `unsafe fn(isize) -> isize {square}`
--> $DIR/unboxed-closures-wrong-arg-type-extern-fn.rs:19:13
--> $DIR/unboxed-closures-wrong-arg-type-extern-fn.rs:19:25
|
LL | fn call_it_mut<F:FnMut(&isize)->isize>(_: &mut F, _: isize) -> isize { 0 }
| -------------------------------------------------------------------- required by `call_it_mut`
...
LL | let y = call_it_mut(&mut square, 22);
| ^^^^^^^^^^^ expected an `FnOnce<(&isize,)>` closure, found `unsafe fn(isize) -> isize {square}`
| ^^^^^^^^^^^ expected an `FnOnce<(&isize,)>` closure, found `unsafe fn(isize) -> isize {square}`
|
= help: the trait `std::ops::FnOnce<(&isize,)>` is not implemented for `unsafe fn(isize) -> isize {square}`
error[E0277]: expected a `std::ops::FnOnce<(&isize,)>` closure, found `unsafe fn(isize) -> isize {square}`
--> $DIR/unboxed-closures-wrong-arg-type-extern-fn.rs:25:13
--> $DIR/unboxed-closures-wrong-arg-type-extern-fn.rs:25:26
|
LL | fn call_it_once<F:FnOnce(&isize)->isize>(_: F, _: isize) -> isize { 0 }
| ----------------------------------------------------------------- required by `call_it_once`
...
LL | let z = call_it_once(square, 22);
| ^^^^^^^^^^^^ expected an `FnOnce<(&isize,)>` closure, found `unsafe fn(isize) -> isize {square}`
| ^^^^^^ expected an `FnOnce<(&isize,)>` closure, found `unsafe fn(isize) -> isize {square}`
|
= help: the trait `std::ops::FnOnce<(&isize,)>` is not implemented for `unsafe fn(isize) -> isize {square}`

View File

@ -1,8 +1,8 @@
error[E0277]: the size for values of type `X` cannot be known at compilation time
--> $DIR/unsized3.rs:7:5
--> $DIR/unsized3.rs:7:13
|
LL | f2::<X>(x);
| ^^^^^^^ doesn't have a size known at compile-time
| ^ doesn't have a size known at compile-time
...
LL | fn f2<X>(x: &X) {
| --------------- required by `f2`
@ -12,10 +12,10 @@ LL | fn f2<X>(x: &X) {
= help: consider adding a `where X: std::marker::Sized` bound
error[E0277]: the size for values of type `X` cannot be known at compilation time
--> $DIR/unsized3.rs:18:5
--> $DIR/unsized3.rs:18:13
|
LL | f4::<X>(x);
| ^^^^^^^ doesn't have a size known at compile-time
| ^ doesn't have a size known at compile-time
...
LL | fn f4<X: T>(x: &X) {
| ------------------ required by `f4`
@ -25,13 +25,13 @@ LL | fn f4<X: T>(x: &X) {
= help: consider adding a `where X: std::marker::Sized` bound
error[E0277]: the size for values of type `X` cannot be known at compilation time
--> $DIR/unsized3.rs:33:5
--> $DIR/unsized3.rs:33:8
|
LL | fn f5<Y>(x: &Y) {}
| --------------- required by `f5`
...
LL | f5(x1);
| ^^ doesn't have a size known at compile-time
| ^^ doesn't have a size known at compile-time
|
= help: within `S<X>`, the trait `std::marker::Sized` is not implemented for `X`
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
@ -39,10 +39,10 @@ LL | f5(x1);
= note: required because it appears within the type `S<X>`
error[E0277]: the size for values of type `X` cannot be known at compilation time
--> $DIR/unsized3.rs:40:5
--> $DIR/unsized3.rs:40:8
|
LL | f5(&(*x1, 34));
| ^^ doesn't have a size known at compile-time
| ^^^^^^^^^^ doesn't have a size known at compile-time
|
= help: within `S<X>`, the trait `std::marker::Sized` is not implemented for `X`
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
@ -64,13 +64,13 @@ LL | f5(&(32, *x1));
= note: tuples must have a statically known size to be initialized
error[E0277]: the size for values of type `X` cannot be known at compilation time
--> $DIR/unsized3.rs:45:5
--> $DIR/unsized3.rs:45:8
|
LL | fn f5<Y>(x: &Y) {}
| --------------- required by `f5`
...
LL | f5(&(32, *x1));
| ^^ doesn't have a size known at compile-time
| ^^^^^^^^^^ doesn't have a size known at compile-time
|
= help: within `({integer}, S<X>)`, the trait `std::marker::Sized` is not implemented for `X`
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>

View File

@ -1,8 +1,8 @@
error[E0277]: the trait bound `{integer}: TraitA` is not satisfied
--> $DIR/vtable-res-trait-param.rs:17:7
--> $DIR/vtable-res-trait-param.rs:17:18
|
LL | b.gimme_an_a(y)
| ^^^^^^^^^^ the trait `TraitA` is not implemented for `{integer}`
| ^ the trait `TraitA` is not implemented for `{integer}`
error: aborting due to previous error

View File

@ -1,11 +1,11 @@
error[E0277]: the trait bound `T: std::marker::Copy` is not satisfied
--> $DIR/where-clause-constraints-are-local-for-inherent-impl.rs:13:9
--> $DIR/where-clause-constraints-are-local-for-inherent-impl.rs:13:22
|
LL | fn require_copy<T: Copy>(x: T) {}
| ------------------------------ required by `require_copy`
...
LL | require_copy(self.x);
| ^^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `T`
| ^^^^^^ the trait `std::marker::Copy` is not implemented for `T`
|
= help: consider adding a `where T: std::marker::Copy` bound

View File

@ -1,11 +1,11 @@
error[E0277]: the trait bound `T: std::marker::Copy` is not satisfied
--> $DIR/where-clause-constraints-are-local-for-trait-impl.rs:18:9
--> $DIR/where-clause-constraints-are-local-for-trait-impl.rs:18:22
|
LL | fn require_copy<T: Copy>(x: T) {}
| ------------------------------ required by `require_copy`
...
LL | require_copy(self.x);
| ^^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `T`
| ^^^^^^ the trait `std::marker::Copy` is not implemented for `T`
|
= help: consider adding a `where T: std::marker::Copy` bound

View File

@ -1,8 +1,8 @@
error[E0277]: the trait bound `Bar: std::cmp::Eq` is not satisfied
--> $DIR/where-clauses-method-unsatisfied.rs:18:7
--> $DIR/where-clauses-method-unsatisfied.rs:18:14
|
LL | x.equals(&x);
| ^^^^^^ the trait `std::cmp::Eq` is not implemented for `Bar`
| ^^ the trait `std::cmp::Eq` is not implemented for `Bar`
error: aborting due to previous error