When possible point at argument causing item obligation failure

This commit is contained in:
Esteban Küber 2019-09-15 21:58:20 -07:00
parent 9b9d2aff8d
commit 02e3fb89a7
66 changed files with 726 additions and 565 deletions

View file

@ -3253,6 +3253,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
@ -3265,7 +3267,32 @@ 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);
// We don't use `select_obligations_where_possible` to try to figure out if the
// obligation is comming from a single fn call argument, and if it is, we point
// at the expression corresponding to that argument, instead of the call.
if let Err(
mut errors,
) = self.fulfillment_cx.borrow_mut().select_where_possible(self) {
for error in &mut errors {
if let ty::Predicate::Trait(predicate) = error.obligation.predicate {
let mut referenced_in = vec![];
for (i, ty) in &final_arg_types {
let ty = self.resolve_vars_if_possible(ty);
info!("final ty {} {:?}", i, ty);
for ty in ty.walk() {
info!("walk {:?}", ty);
if ty == predicate.skip_binder().self_ty() {
referenced_in.push(*i);
}
}
}
if referenced_in.len() == 1 {
error.obligation.cause.span = args[referenced_in[0]].span;
}
}
}
self.report_fulfillment_errors(&errors, self.inh.body_id, false);
}
}
// For C-variadic functions, we don't have a declared type for all of
@ -3311,6 +3338,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.
@ -3514,8 +3542,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))
@ -4639,7 +4670,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

@ -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

@ -14,7 +14,8 @@ async fn foo2() -> Result<(), ()> {
}
async fn foo3() -> Result<(), ()> {
let _ = await bar()?; //~ ERROR incorrect use of `await`
//~^ ERROR the `?` operator can only be applied to values that implement `std::ops::Try`
//~^ ERROR the trait bound `impl std::future::Future: std::ops::Try` is not satisfied
//~| ERROR the trait bound `impl std::future::Future: std::ops::Try` is not satisfied
Ok(())
}
async fn foo21() -> Result<(), ()> {

View file

@ -17,103 +17,103 @@ LL | let _ = await bar()?;
| ^^^^^^^^^^^^ help: `await` is a postfix operation: `bar()?.await`
error: incorrect use of `await`
--> $DIR/incorrect-syntax-suggestions.rs:21:13
--> $DIR/incorrect-syntax-suggestions.rs:22:13
|
LL | let _ = await { bar() };
| ^^^^^^^^^^^^^^^ help: `await` is a postfix operation: `{ bar() }.await`
error: incorrect use of `await`
--> $DIR/incorrect-syntax-suggestions.rs:25:13
--> $DIR/incorrect-syntax-suggestions.rs:26:13
|
LL | let _ = await(bar());
| ^^^^^^^^^^^^ help: `await` is a postfix operation: `(bar()).await`
error: incorrect use of `await`
--> $DIR/incorrect-syntax-suggestions.rs:29:13
--> $DIR/incorrect-syntax-suggestions.rs:30:13
|
LL | let _ = await { bar() }?;
| ^^^^^^^^^^^^^^^ help: `await` is a postfix operation: `{ bar() }.await`
error: incorrect use of `await`
--> $DIR/incorrect-syntax-suggestions.rs:33:14
--> $DIR/incorrect-syntax-suggestions.rs:34:14
|
LL | let _ = (await bar())?;
| ^^^^^^^^^^^ help: `await` is a postfix operation: `bar().await`
error: incorrect use of `await`
--> $DIR/incorrect-syntax-suggestions.rs:37:24
--> $DIR/incorrect-syntax-suggestions.rs:38:24
|
LL | let _ = bar().await();
| ^^ help: `await` is not a method call, remove the parentheses
error: incorrect use of `await`
--> $DIR/incorrect-syntax-suggestions.rs:41:24
--> $DIR/incorrect-syntax-suggestions.rs:42:24
|
LL | let _ = bar().await()?;
| ^^ help: `await` is not a method call, remove the parentheses
error: incorrect use of `await`
--> $DIR/incorrect-syntax-suggestions.rs:53:13
--> $DIR/incorrect-syntax-suggestions.rs:54:13
|
LL | let _ = await bar();
| ^^^^^^^^^^^ help: `await` is a postfix operation: `bar().await`
error: incorrect use of `await`
--> $DIR/incorrect-syntax-suggestions.rs:58:13
--> $DIR/incorrect-syntax-suggestions.rs:59:13
|
LL | let _ = await? bar();
| ^^^^^^^^^^^^ help: `await` is a postfix operation: `bar().await?`
error: incorrect use of `await`
--> $DIR/incorrect-syntax-suggestions.rs:63:13
--> $DIR/incorrect-syntax-suggestions.rs:64:13
|
LL | let _ = await bar()?;
| ^^^^^^^^^^^^ help: `await` is a postfix operation: `bar()?.await`
error: incorrect use of `await`
--> $DIR/incorrect-syntax-suggestions.rs:68:14
--> $DIR/incorrect-syntax-suggestions.rs:69:14
|
LL | let _ = (await bar())?;
| ^^^^^^^^^^^ help: `await` is a postfix operation: `bar().await`
error: incorrect use of `await`
--> $DIR/incorrect-syntax-suggestions.rs:73:24
--> $DIR/incorrect-syntax-suggestions.rs:74:24
|
LL | let _ = bar().await();
| ^^ help: `await` is not a method call, remove the parentheses
error: incorrect use of `await`
--> $DIR/incorrect-syntax-suggestions.rs:78:24
--> $DIR/incorrect-syntax-suggestions.rs:79:24
|
LL | let _ = bar().await()?;
| ^^ help: `await` is not a method call, remove the parentheses
error: incorrect use of `await`
--> $DIR/incorrect-syntax-suggestions.rs:106:13
--> $DIR/incorrect-syntax-suggestions.rs:107:13
|
LL | let _ = await!(bar());
| ^^^^^^^^^^^^^ help: `await` is a postfix operation: `bar().await`
error: incorrect use of `await`
--> $DIR/incorrect-syntax-suggestions.rs:110:13
--> $DIR/incorrect-syntax-suggestions.rs:111:13
|
LL | let _ = await!(bar())?;
| ^^^^^^^^^^^^^ help: `await` is a postfix operation: `bar().await`
error: incorrect use of `await`
--> $DIR/incorrect-syntax-suggestions.rs:115:17
--> $DIR/incorrect-syntax-suggestions.rs:116:17
|
LL | let _ = await!(bar())?;
| ^^^^^^^^^^^^^ help: `await` is a postfix operation: `bar().await`
error: incorrect use of `await`
--> $DIR/incorrect-syntax-suggestions.rs:123:17
--> $DIR/incorrect-syntax-suggestions.rs:124:17
|
LL | let _ = await!(bar())?;
| ^^^^^^^^^^^^^ help: `await` is a postfix operation: `bar().await`
error: expected expression, found `=>`
--> $DIR/incorrect-syntax-suggestions.rs:131:25
--> $DIR/incorrect-syntax-suggestions.rs:132:25
|
LL | match await { await => () }
| ----- ^^ expected expression
@ -121,13 +121,13 @@ LL | match await { await => () }
| while parsing this incorrect await expression
error: incorrect use of `await`
--> $DIR/incorrect-syntax-suggestions.rs:131:11
--> $DIR/incorrect-syntax-suggestions.rs:132:11
|
LL | match await { await => () }
| ^^^^^^^^^^^^^^^^^^^^^ help: `await` is a postfix operation: `{ await => () }.await`
error: expected one of `.`, `?`, `{`, or an operator, found `}`
--> $DIR/incorrect-syntax-suggestions.rs:134:1
--> $DIR/incorrect-syntax-suggestions.rs:135:1
|
LL | match await { await => () }
| ----- - expected one of `.`, `?`, `{`, or an operator here
@ -138,7 +138,7 @@ LL | }
| ^ unexpected token
error[E0728]: `await` is only allowed inside `async` functions and blocks
--> $DIR/incorrect-syntax-suggestions.rs:53:13
--> $DIR/incorrect-syntax-suggestions.rs:54:13
|
LL | fn foo9() -> Result<(), ()> {
| ---- this is not `async`
@ -146,7 +146,7 @@ LL | let _ = await bar();
| ^^^^^^^^^^^ only allowed inside `async` functions and blocks
error[E0728]: `await` is only allowed inside `async` functions and blocks
--> $DIR/incorrect-syntax-suggestions.rs:58:13
--> $DIR/incorrect-syntax-suggestions.rs:59:13
|
LL | fn foo10() -> Result<(), ()> {
| ----- this is not `async`
@ -154,7 +154,7 @@ LL | let _ = await? bar();
| ^^^^^^^^^^^^ only allowed inside `async` functions and blocks
error[E0728]: `await` is only allowed inside `async` functions and blocks
--> $DIR/incorrect-syntax-suggestions.rs:63:13
--> $DIR/incorrect-syntax-suggestions.rs:64:13
|
LL | fn foo11() -> Result<(), ()> {
| ----- this is not `async`
@ -162,7 +162,7 @@ LL | let _ = await bar()?;
| ^^^^^^^^^^^^ only allowed inside `async` functions and blocks
error[E0728]: `await` is only allowed inside `async` functions and blocks
--> $DIR/incorrect-syntax-suggestions.rs:68:14
--> $DIR/incorrect-syntax-suggestions.rs:69:14
|
LL | fn foo12() -> Result<(), ()> {
| ----- this is not `async`
@ -170,7 +170,7 @@ LL | let _ = (await bar())?;
| ^^^^^^^^^^^ only allowed inside `async` functions and blocks
error[E0728]: `await` is only allowed inside `async` functions and blocks
--> $DIR/incorrect-syntax-suggestions.rs:73:13
--> $DIR/incorrect-syntax-suggestions.rs:74:13
|
LL | fn foo13() -> Result<(), ()> {
| ----- this is not `async`
@ -178,7 +178,7 @@ LL | let _ = bar().await();
| ^^^^^^^^^^^ only allowed inside `async` functions and blocks
error[E0728]: `await` is only allowed inside `async` functions and blocks
--> $DIR/incorrect-syntax-suggestions.rs:78:13
--> $DIR/incorrect-syntax-suggestions.rs:79:13
|
LL | fn foo14() -> Result<(), ()> {
| ----- this is not `async`
@ -186,7 +186,7 @@ LL | let _ = bar().await()?;
| ^^^^^^^^^^^ only allowed inside `async` functions and blocks
error[E0728]: `await` is only allowed inside `async` functions and blocks
--> $DIR/incorrect-syntax-suggestions.rs:83:13
--> $DIR/incorrect-syntax-suggestions.rs:84:13
|
LL | fn foo15() -> Result<(), ()> {
| ----- this is not `async`
@ -194,7 +194,7 @@ LL | let _ = bar().await;
| ^^^^^^^^^^^ only allowed inside `async` functions and blocks
error[E0728]: `await` is only allowed inside `async` functions and blocks
--> $DIR/incorrect-syntax-suggestions.rs:87:13
--> $DIR/incorrect-syntax-suggestions.rs:88:13
|
LL | fn foo16() -> Result<(), ()> {
| ----- this is not `async`
@ -202,7 +202,7 @@ LL | let _ = bar().await?;
| ^^^^^^^^^^^ only allowed inside `async` functions and blocks
error[E0728]: `await` is only allowed inside `async` functions and blocks
--> $DIR/incorrect-syntax-suggestions.rs:92:17
--> $DIR/incorrect-syntax-suggestions.rs:93:17
|
LL | fn foo() -> Result<(), ()> {
| --- this is not `async`
@ -210,7 +210,7 @@ LL | let _ = bar().await?;
| ^^^^^^^^^^^ only allowed inside `async` functions and blocks
error[E0728]: `await` is only allowed inside `async` functions and blocks
--> $DIR/incorrect-syntax-suggestions.rs:99:17
--> $DIR/incorrect-syntax-suggestions.rs:100:17
|
LL | let foo = || {
| -- this is not `async`
@ -218,7 +218,7 @@ LL | let _ = bar().await?;
| ^^^^^^^^^^^ only allowed inside `async` functions and blocks
error[E0728]: `await` is only allowed inside `async` functions and blocks
--> $DIR/incorrect-syntax-suggestions.rs:115:17
--> $DIR/incorrect-syntax-suggestions.rs:116:17
|
LL | fn foo() -> Result<(), ()> {
| --- this is not `async`
@ -226,22 +226,27 @@ LL | let _ = await!(bar())?;
| ^^^^^^^^^^^^^ only allowed inside `async` functions and blocks
error[E0728]: `await` is only allowed inside `async` functions and blocks
--> $DIR/incorrect-syntax-suggestions.rs:123:17
--> $DIR/incorrect-syntax-suggestions.rs:124:17
|
LL | let foo = || {
| -- this is not `async`
LL | let _ = await!(bar())?;
| ^^^^^^^^^^^^^ only allowed inside `async` functions and blocks
error[E0277]: the `?` operator can only be applied to values that implement `std::ops::Try`
error[E0277]: the trait bound `impl std::future::Future: std::ops::Try` is not satisfied
--> $DIR/incorrect-syntax-suggestions.rs:16:19
|
LL | let _ = await bar()?;
| ^^^^^^ the `?` operator cannot be applied to type `impl std::future::Future`
| ^^^^^ the trait `std::ops::Try` is not implemented for `impl std::future::Future`
|
= help: the trait `std::ops::Try` is not implemented for `impl std::future::Future`
= note: required by `std::ops::Try::into_result`
error: aborting due to 35 previous errors
error[E0277]: the trait bound `impl std::future::Future: std::ops::Try` is not satisfied
--> $DIR/incorrect-syntax-suggestions.rs:16:19
|
LL | let _ = await bar()?;
| ^^^^^^ the trait `std::ops::Try` is not implemented for `impl std::future::Future`
error: aborting due to 36 previous errors
For more information about this error, try `rustc --explain E0277`.

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

@ -40,12 +40,14 @@ fn nested_within_if_expr() {
fn _check_try_binds_tighter() -> Result<(), ()> {
if let 0 = 0? {}
//~^ ERROR the `?` operator can only be applied to values that implement `std::ops::Try`
//~^ ERROR the trait bound `{integer}: std::ops::Try` is not satisfied
//~| ERROR the trait bound `{integer}: std::ops::Try` is not satisfied
Ok(())
}
if (let 0 = 0)? {} //~ ERROR `let` expressions are not supported here
//~^ ERROR the `?` operator can only be applied to values that implement `std::ops::Try`
//~| ERROR the `?` operator can only be used in a function that returns `Result`
//~^ ERROR the trait bound `bool: std::ops::Try` is not satisfied
//~| ERROR the trait bound `bool: std::ops::Try` is not satisfied
//~| ERROR the `?` operator can only be used in a function that returns `Result` or `Option`
if true || let 0 = 0 {} //~ ERROR `let` expressions are not supported here
if (true || let 0 = 0) {} //~ ERROR `let` expressions are not supported here
@ -104,12 +106,14 @@ fn nested_within_while_expr() {
fn _check_try_binds_tighter() -> Result<(), ()> {
while let 0 = 0? {}
//~^ ERROR the `?` operator can only be applied to values that implement `std::ops::Try`
//~^ ERROR the trait bound `{integer}: std::ops::Try` is not satisfied
//~| ERROR the trait bound `{integer}: std::ops::Try` is not satisfied
Ok(())
}
while (let 0 = 0)? {} //~ ERROR `let` expressions are not supported here
//~^ ERROR the `?` operator can only be applied to values that implement `std::ops::Try`
//~| ERROR the `?` operator can only be used in a function that returns `Result`
//~^ ERROR the trait bound `bool: std::ops::Try` is not satisfied
//~| ERROR the trait bound `bool: std::ops::Try` is not satisfied
//~| ERROR the `?` operator can only be used in a function that returns `Result` or `Option`
while true || let 0 = 0 {} //~ ERROR `let` expressions are not supported here
while (true || let 0 = 0) {} //~ ERROR `let` expressions are not supported here
@ -177,12 +181,14 @@ fn outside_if_and_while_expr() {
fn _check_try_binds_tighter() -> Result<(), ()> {
let 0 = 0?;
//~^ ERROR the `?` operator can only be applied to values that implement `std::ops::Try`
//~^ ERROR the trait bound `{integer}: std::ops::Try` is not satisfied
//~| ERROR the trait bound `{integer}: std::ops::Try` is not satisfied
Ok(())
}
(let 0 = 0)?; //~ ERROR `let` expressions are not supported here
//~^ ERROR the `?` operator can only be used in a function that returns `Result`
//~| ERROR the `?` operator can only be applied to values that implement `std::ops::Try`
//~^ ERROR the trait bound `bool: std::ops::Try` is not satisfied
//~| ERROR the trait bound `bool: std::ops::Try` is not satisfied
//~| ERROR the `?` operator can only be used in a function that returns `Result` or `Option`
true || let 0 = 0; //~ ERROR `let` expressions are not supported here
(true || let 0 = 0); //~ ERROR `let` expressions are not supported here

View file

@ -1,5 +1,5 @@
error: expected one of `,` or `>`, found `&&`
--> $DIR/disallowed-positions.rs:242:14
--> $DIR/disallowed-positions.rs:248:14
|
LL | true && let 1 = 1
| ^^ expected one of `,` or `>` here
@ -41,7 +41,7 @@ LL | if -let 0 = 0 {}
= note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:46:9
--> $DIR/disallowed-positions.rs:47:9
|
LL | if (let 0 = 0)? {}
| ^^^^^^^^^
@ -50,7 +50,7 @@ LL | if (let 0 = 0)? {}
= note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:50:16
--> $DIR/disallowed-positions.rs:52:16
|
LL | if true || let 0 = 0 {}
| ^^^^^^^^^
@ -59,7 +59,7 @@ LL | if true || let 0 = 0 {}
= note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:51:17
--> $DIR/disallowed-positions.rs:53:17
|
LL | if (true || let 0 = 0) {}
| ^^^^^^^^^
@ -68,7 +68,7 @@ LL | if (true || let 0 = 0) {}
= note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:52:25
--> $DIR/disallowed-positions.rs:54:25
|
LL | if true && (true || let 0 = 0) {}
| ^^^^^^^^^
@ -77,7 +77,7 @@ LL | if true && (true || let 0 = 0) {}
= note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:53:25
--> $DIR/disallowed-positions.rs:55:25
|
LL | if true || (true && let 0 = 0) {}
| ^^^^^^^^^
@ -86,7 +86,7 @@ LL | if true || (true && let 0 = 0) {}
= note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:56:12
--> $DIR/disallowed-positions.rs:58:12
|
LL | if x = let 0 = 0 {}
| ^^^^^^^^^
@ -95,7 +95,7 @@ LL | if x = let 0 = 0 {}
= note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:59:15
--> $DIR/disallowed-positions.rs:61:15
|
LL | if true..(let 0 = 0) {}
| ^^^^^^^^^
@ -104,7 +104,7 @@ LL | if true..(let 0 = 0) {}
= note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:61:11
--> $DIR/disallowed-positions.rs:63:11
|
LL | if ..(let 0 = 0) {}
| ^^^^^^^^^
@ -113,7 +113,7 @@ LL | if ..(let 0 = 0) {}
= note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:63:9
--> $DIR/disallowed-positions.rs:65:9
|
LL | if (let 0 = 0).. {}
| ^^^^^^^^^
@ -122,7 +122,7 @@ LL | if (let 0 = 0).. {}
= note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:67:8
--> $DIR/disallowed-positions.rs:69:8
|
LL | if let Range { start: _, end: _ } = true..true && false {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -131,7 +131,7 @@ LL | if let Range { start: _, end: _ } = true..true && false {}
= note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:71:8
--> $DIR/disallowed-positions.rs:73:8
|
LL | if let Range { start: _, end: _ } = true..true || false {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -140,7 +140,7 @@ LL | if let Range { start: _, end: _ } = true..true || false {}
= note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:78:8
--> $DIR/disallowed-positions.rs:80:8
|
LL | if let Range { start: F, end } = F..|| true {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -149,7 +149,7 @@ LL | if let Range { start: F, end } = F..|| true {}
= note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:86:8
--> $DIR/disallowed-positions.rs:88:8
|
LL | if let Range { start: true, end } = t..&&false {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -158,7 +158,7 @@ LL | if let Range { start: true, end } = t..&&false {}
= note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:92:19
--> $DIR/disallowed-positions.rs:94:19
|
LL | if let true = let true = true {}
| ^^^^^^^^^^^^^^^
@ -167,7 +167,7 @@ LL | if let true = let true = true {}
= note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:96:12
--> $DIR/disallowed-positions.rs:98:12
|
LL | while &let 0 = 0 {}
| ^^^^^^^^^
@ -176,7 +176,7 @@ LL | while &let 0 = 0 {}
= note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:99:12
--> $DIR/disallowed-positions.rs:101:12
|
LL | while !let 0 = 0 {}
| ^^^^^^^^^
@ -185,7 +185,7 @@ LL | while !let 0 = 0 {}
= note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:100:12
--> $DIR/disallowed-positions.rs:102:12
|
LL | while *let 0 = 0 {}
| ^^^^^^^^^
@ -194,7 +194,7 @@ LL | while *let 0 = 0 {}
= note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:102:12
--> $DIR/disallowed-positions.rs:104:12
|
LL | while -let 0 = 0 {}
| ^^^^^^^^^
@ -203,7 +203,7 @@ LL | while -let 0 = 0 {}
= note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:110:12
--> $DIR/disallowed-positions.rs:113:12
|
LL | while (let 0 = 0)? {}
| ^^^^^^^^^
@ -212,7 +212,7 @@ LL | while (let 0 = 0)? {}
= note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:114:19
--> $DIR/disallowed-positions.rs:118:19
|
LL | while true || let 0 = 0 {}
| ^^^^^^^^^
@ -221,7 +221,7 @@ LL | while true || let 0 = 0 {}
= note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:115:20
--> $DIR/disallowed-positions.rs:119:20
|
LL | while (true || let 0 = 0) {}
| ^^^^^^^^^
@ -230,7 +230,7 @@ LL | while (true || let 0 = 0) {}
= note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:116:28
--> $DIR/disallowed-positions.rs:120:28
|
LL | while true && (true || let 0 = 0) {}
| ^^^^^^^^^
@ -239,7 +239,7 @@ LL | while true && (true || let 0 = 0) {}
= note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:117:28
--> $DIR/disallowed-positions.rs:121:28
|
LL | while true || (true && let 0 = 0) {}
| ^^^^^^^^^
@ -248,7 +248,7 @@ LL | while true || (true && let 0 = 0) {}
= note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:120:15
--> $DIR/disallowed-positions.rs:124:15
|
LL | while x = let 0 = 0 {}
| ^^^^^^^^^
@ -257,7 +257,7 @@ LL | while x = let 0 = 0 {}
= note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:123:18
--> $DIR/disallowed-positions.rs:127:18
|
LL | while true..(let 0 = 0) {}
| ^^^^^^^^^
@ -266,7 +266,7 @@ LL | while true..(let 0 = 0) {}
= note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:125:14
--> $DIR/disallowed-positions.rs:129:14
|
LL | while ..(let 0 = 0) {}
| ^^^^^^^^^
@ -275,7 +275,7 @@ LL | while ..(let 0 = 0) {}
= note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:127:12
--> $DIR/disallowed-positions.rs:131:12
|
LL | while (let 0 = 0).. {}
| ^^^^^^^^^
@ -284,7 +284,7 @@ LL | while (let 0 = 0).. {}
= note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:131:11
--> $DIR/disallowed-positions.rs:135:11
|
LL | while let Range { start: _, end: _ } = true..true && false {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -293,7 +293,7 @@ LL | while let Range { start: _, end: _ } = true..true && false {}
= note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:135:11
--> $DIR/disallowed-positions.rs:139:11
|
LL | while let Range { start: _, end: _ } = true..true || false {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -302,7 +302,7 @@ LL | while let Range { start: _, end: _ } = true..true || false {}
= note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:142:11
--> $DIR/disallowed-positions.rs:146:11
|
LL | while let Range { start: F, end } = F..|| true {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -311,7 +311,7 @@ LL | while let Range { start: F, end } = F..|| true {}
= note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:150:11
--> $DIR/disallowed-positions.rs:154:11
|
LL | while let Range { start: true, end } = t..&&false {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -320,7 +320,7 @@ LL | while let Range { start: true, end } = t..&&false {}
= note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:156:22
--> $DIR/disallowed-positions.rs:160:22
|
LL | while let true = let true = true {}
| ^^^^^^^^^^^^^^^
@ -329,7 +329,7 @@ LL | while let true = let true = true {}
= note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:170:6
--> $DIR/disallowed-positions.rs:174:6
|
LL | &let 0 = 0;
| ^^^^^^^^^
@ -338,7 +338,7 @@ LL | &let 0 = 0;
= note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:172:6
--> $DIR/disallowed-positions.rs:176:6
|
LL | !let 0 = 0;
| ^^^^^^^^^
@ -347,7 +347,7 @@ LL | !let 0 = 0;
= note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:173:6
--> $DIR/disallowed-positions.rs:177:6
|
LL | *let 0 = 0;
| ^^^^^^^^^
@ -356,7 +356,7 @@ LL | *let 0 = 0;
= note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:175:6
--> $DIR/disallowed-positions.rs:179:6
|
LL | -let 0 = 0;
| ^^^^^^^^^
@ -365,7 +365,7 @@ LL | -let 0 = 0;
= note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:183:6
--> $DIR/disallowed-positions.rs:188:6
|
LL | (let 0 = 0)?;
| ^^^^^^^^^
@ -374,7 +374,7 @@ LL | (let 0 = 0)?;
= note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:187:13
--> $DIR/disallowed-positions.rs:193:13
|
LL | true || let 0 = 0;
| ^^^^^^^^^
@ -383,7 +383,7 @@ LL | true || let 0 = 0;
= note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:188:14
--> $DIR/disallowed-positions.rs:194:14
|
LL | (true || let 0 = 0);
| ^^^^^^^^^
@ -392,7 +392,7 @@ LL | (true || let 0 = 0);
= note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:189:22
--> $DIR/disallowed-positions.rs:195:22
|
LL | true && (true || let 0 = 0);
| ^^^^^^^^^
@ -401,7 +401,7 @@ LL | true && (true || let 0 = 0);
= note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:192:9
--> $DIR/disallowed-positions.rs:198:9
|
LL | x = let 0 = 0;
| ^^^^^^^^^
@ -410,7 +410,7 @@ LL | x = let 0 = 0;
= note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:194:12
--> $DIR/disallowed-positions.rs:200:12
|
LL | true..(let 0 = 0);
| ^^^^^^^^^
@ -419,7 +419,7 @@ LL | true..(let 0 = 0);
= note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:195:8
--> $DIR/disallowed-positions.rs:201:8
|
LL | ..(let 0 = 0);
| ^^^^^^^^^
@ -428,7 +428,7 @@ LL | ..(let 0 = 0);
= note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:196:6
--> $DIR/disallowed-positions.rs:202:6
|
LL | (let 0 = 0)..;
| ^^^^^^^^^
@ -437,7 +437,7 @@ LL | (let 0 = 0)..;
= note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:198:6
--> $DIR/disallowed-positions.rs:204:6
|
LL | (let Range { start: _, end: _ } = true..true || false);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -446,7 +446,7 @@ LL | (let Range { start: _, end: _ } = true..true || false);
= note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:202:6
--> $DIR/disallowed-positions.rs:208:6
|
LL | (let true = let true = true);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -455,7 +455,7 @@ LL | (let true = let true = true);
= note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:202:17
--> $DIR/disallowed-positions.rs:208:17
|
LL | (let true = let true = true);
| ^^^^^^^^^^^^^^^
@ -464,7 +464,7 @@ LL | (let true = let true = true);
= note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:207:6
--> $DIR/disallowed-positions.rs:213:6
|
LL | &let 0 = 0
| ^^^^^^^^^
@ -472,15 +472,6 @@ LL | &let 0 = 0
= note: only supported directly in conditions of `if`- and `while`-expressions
= note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:218:17
|
LL | true && let 1 = 1
| ^^^^^^^^^
|
= note: only supported directly in conditions of `if`- and `while`-expressions
= note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:224:17
|
@ -499,6 +490,15 @@ LL | true && let 1 = 1
= note: only supported directly in conditions of `if`- and `while`-expressions
= note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:236:17
|
LL | true && let 1 = 1
| ^^^^^^^^^
|
= note: only supported directly in conditions of `if`- and `while`-expressions
= note: as well as when nested within `&&` and parenthesis in those conditions
warning: the feature `const_generics` is incomplete and may cause the compiler to crash
--> $DIR/disallowed-positions.rs:20:12
|
@ -536,17 +536,16 @@ LL | if -let 0 = 0 {}
|
= note: an implementation of `std::ops::Neg` might be missing for `bool`
error[E0277]: the `?` operator can only be applied to values that implement `std::ops::Try`
--> $DIR/disallowed-positions.rs:46:8
error[E0277]: the trait bound `bool: std::ops::Try` is not satisfied
--> $DIR/disallowed-positions.rs:47:8
|
LL | if (let 0 = 0)? {}
| ^^^^^^^^^^^^ the `?` operator cannot be applied to type `bool`
| ^^^^^^^^^^^ the trait `std::ops::Try` is not implemented for `bool`
|
= help: the trait `std::ops::Try` is not implemented for `bool`
= note: required by `std::ops::Try::into_result`
error[E0277]: the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `std::ops::Try`)
--> $DIR/disallowed-positions.rs:46:8
--> $DIR/disallowed-positions.rs:47:8
|
LL | if (let 0 = 0)? {}
| ^^^^^^^^^^^^ cannot use the `?` operator in a function that returns `()`
@ -555,7 +554,7 @@ LL | if (let 0 = 0)? {}
= note: required by `std::ops::Try::from_error`
error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:56:8
--> $DIR/disallowed-positions.rs:58:8
|
LL | if x = let 0 = 0 {}
| ^^^^^^^^^^^^^
@ -567,7 +566,7 @@ LL | if x = let 0 = 0 {}
found type `()`
error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:59:8
--> $DIR/disallowed-positions.rs:61:8
|
LL | if true..(let 0 = 0) {}
| ^^^^^^^^^^^^^^^^^ expected bool, found struct `std::ops::Range`
@ -576,7 +575,7 @@ LL | if true..(let 0 = 0) {}
found type `std::ops::Range<bool>`
error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:61:8
--> $DIR/disallowed-positions.rs:63:8
|
LL | if ..(let 0 = 0) {}
| ^^^^^^^^^^^^^ expected bool, found struct `std::ops::RangeTo`
@ -585,7 +584,7 @@ LL | if ..(let 0 = 0) {}
found type `std::ops::RangeTo<bool>`
error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:63:8
--> $DIR/disallowed-positions.rs:65:8
|
LL | if (let 0 = 0).. {}
| ^^^^^^^^^^^^^ expected bool, found struct `std::ops::RangeFrom`
@ -594,7 +593,7 @@ LL | if (let 0 = 0).. {}
found type `std::ops::RangeFrom<bool>`
error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:67:12
--> $DIR/disallowed-positions.rs:69:12
|
LL | if let Range { start: _, end: _ } = true..true && false {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ ---- this match expression has type `bool`
@ -605,7 +604,7 @@ LL | if let Range { start: _, end: _ } = true..true && false {}
found type `std::ops::Range<_>`
error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:67:8
--> $DIR/disallowed-positions.rs:69:8
|
LL | if let Range { start: _, end: _ } = true..true && false {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected bool, found struct `std::ops::Range`
@ -614,7 +613,7 @@ LL | if let Range { start: _, end: _ } = true..true && false {}
found type `std::ops::Range<bool>`
error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:71:12
--> $DIR/disallowed-positions.rs:73:12
|
LL | if let Range { start: _, end: _ } = true..true || false {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ ---- this match expression has type `bool`
@ -625,7 +624,7 @@ LL | if let Range { start: _, end: _ } = true..true || false {}
found type `std::ops::Range<_>`
error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:71:8
--> $DIR/disallowed-positions.rs:73:8
|
LL | if let Range { start: _, end: _ } = true..true || false {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected bool, found struct `std::ops::Range`
@ -634,7 +633,7 @@ LL | if let Range { start: _, end: _ } = true..true || false {}
found type `std::ops::Range<bool>`
error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:78:12
--> $DIR/disallowed-positions.rs:80:12
|
LL | if let Range { start: F, end } = F..|| true {}
| ^^^^^^^^^^^^^^^^^^^^^^^ expected fn pointer, found struct `std::ops::Range`
@ -643,16 +642,16 @@ LL | if let Range { start: F, end } = F..|| true {}
found type `std::ops::Range<_>`
error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:78:41
--> $DIR/disallowed-positions.rs:80:41
|
LL | if let Range { start: F, end } = F..|| true {}
| ^^^^^^^ expected bool, found closure
|
= note: expected type `bool`
found type `[closure@$DIR/disallowed-positions.rs:78:41: 78:48]`
found type `[closure@$DIR/disallowed-positions.rs:80:41: 80:48]`
error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:78:8
--> $DIR/disallowed-positions.rs:80:8
|
LL | if let Range { start: F, end } = F..|| true {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected bool, found struct `std::ops::Range`
@ -661,7 +660,7 @@ LL | if let Range { start: F, end } = F..|| true {}
found type `std::ops::Range<bool>`
error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:86:12
--> $DIR/disallowed-positions.rs:88:12
|
LL | if let Range { start: true, end } = t..&&false {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ - this match expression has type `bool`
@ -672,7 +671,7 @@ LL | if let Range { start: true, end } = t..&&false {}
found type `std::ops::Range<_>`
error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:86:44
--> $DIR/disallowed-positions.rs:88:44
|
LL | if let Range { start: true, end } = t..&&false {}
| ^^^^^^^ expected bool, found &&bool
@ -681,7 +680,7 @@ LL | if let Range { start: true, end } = t..&&false {}
found type `&&bool`
error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:86:8
--> $DIR/disallowed-positions.rs:88:8
|
LL | if let Range { start: true, end } = t..&&false {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected bool, found struct `std::ops::Range`
@ -689,17 +688,41 @@ LL | if let Range { start: true, end } = t..&&false {}
= note: expected type `bool`
found type `std::ops::Range<bool>`
error[E0277]: the `?` operator can only be applied to values that implement `std::ops::Try`
error[E0277]: the trait bound `bool: std::ops::Try` is not satisfied
--> $DIR/disallowed-positions.rs:47:8
|
LL | if (let 0 = 0)? {}
| ^^^^^^^^^^^^ the trait `std::ops::Try` is not implemented for `bool`
error[E0277]: the trait bound `{integer}: std::ops::Try` is not satisfied
--> $DIR/disallowed-positions.rs:42:20
|
LL | if let 0 = 0? {}
| ^^ the `?` operator cannot be applied to type `{integer}`
| ^ the trait `std::ops::Try` is not implemented for `{integer}`
|
= help: the trait `std::ops::Try` is not implemented for `{integer}`
= help: the following implementations were found:
<std::iter::LoopState<C, B> as std::ops::Try>
<std::option::Option<T> as std::ops::Try>
<std::result::Result<T, E> as std::ops::Try>
<std::task::Poll<std::option::Option<std::result::Result<T, E>>> as std::ops::Try>
<std::task::Poll<std::result::Result<T, E>> as std::ops::Try>
= note: required by `std::ops::Try::into_result`
error[E0277]: the trait bound `{integer}: std::ops::Try` is not satisfied
--> $DIR/disallowed-positions.rs:42:20
|
LL | if let 0 = 0? {}
| ^^ the trait `std::ops::Try` is not implemented for `{integer}`
|
= help: the following implementations were found:
<std::iter::LoopState<C, B> as std::ops::Try>
<std::option::Option<T> as std::ops::Try>
<std::result::Result<T, E> as std::ops::Try>
<std::task::Poll<std::option::Option<std::result::Result<T, E>>> as std::ops::Try>
<std::task::Poll<std::result::Result<T, E>> as std::ops::Try>
error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:96:11
--> $DIR/disallowed-positions.rs:98:11
|
LL | while &let 0 = 0 {}
| ^^^^^^^^^^ expected bool, found &bool
@ -708,30 +731,29 @@ LL | while &let 0 = 0 {}
found type `&bool`
error[E0614]: type `bool` cannot be dereferenced
--> $DIR/disallowed-positions.rs:100:11
--> $DIR/disallowed-positions.rs:102:11
|
LL | while *let 0 = 0 {}
| ^^^^^^^^^^
error[E0600]: cannot apply unary operator `-` to type `bool`
--> $DIR/disallowed-positions.rs:102:11
--> $DIR/disallowed-positions.rs:104:11
|
LL | while -let 0 = 0 {}
| ^^^^^^^^^^ cannot apply unary operator `-`
|
= note: an implementation of `std::ops::Neg` might be missing for `bool`
error[E0277]: the `?` operator can only be applied to values that implement `std::ops::Try`
--> $DIR/disallowed-positions.rs:110:11
error[E0277]: the trait bound `bool: std::ops::Try` is not satisfied
--> $DIR/disallowed-positions.rs:113:11
|
LL | while (let 0 = 0)? {}
| ^^^^^^^^^^^^ the `?` operator cannot be applied to type `bool`
| ^^^^^^^^^^^ the trait `std::ops::Try` is not implemented for `bool`
|
= help: the trait `std::ops::Try` is not implemented for `bool`
= note: required by `std::ops::Try::into_result`
error[E0277]: the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `std::ops::Try`)
--> $DIR/disallowed-positions.rs:110:11
--> $DIR/disallowed-positions.rs:113:11
|
LL | while (let 0 = 0)? {}
| ^^^^^^^^^^^^ cannot use the `?` operator in a function that returns `()`
@ -740,7 +762,7 @@ LL | while (let 0 = 0)? {}
= note: required by `std::ops::Try::from_error`
error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:120:11
--> $DIR/disallowed-positions.rs:124:11
|
LL | while x = let 0 = 0 {}
| ^^^^^^^^^^^^^
@ -752,7 +774,7 @@ LL | while x = let 0 = 0 {}
found type `()`
error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:123:11
--> $DIR/disallowed-positions.rs:127:11
|
LL | while true..(let 0 = 0) {}
| ^^^^^^^^^^^^^^^^^ expected bool, found struct `std::ops::Range`
@ -761,7 +783,7 @@ LL | while true..(let 0 = 0) {}
found type `std::ops::Range<bool>`
error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:125:11
--> $DIR/disallowed-positions.rs:129:11
|
LL | while ..(let 0 = 0) {}
| ^^^^^^^^^^^^^ expected bool, found struct `std::ops::RangeTo`
@ -770,7 +792,7 @@ LL | while ..(let 0 = 0) {}
found type `std::ops::RangeTo<bool>`
error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:127:11
--> $DIR/disallowed-positions.rs:131:11
|
LL | while (let 0 = 0).. {}
| ^^^^^^^^^^^^^ expected bool, found struct `std::ops::RangeFrom`
@ -778,30 +800,10 @@ LL | while (let 0 = 0).. {}
= note: expected type `bool`
found type `std::ops::RangeFrom<bool>`
error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:131:15
|
LL | while let Range { start: _, end: _ } = true..true && false {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ ---- this match expression has type `bool`
| |
| expected bool, found struct `std::ops::Range`
|
= note: expected type `bool`
found type `std::ops::Range<_>`
error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:131:11
|
LL | while let Range { start: _, end: _ } = true..true && false {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected bool, found struct `std::ops::Range`
|
= note: expected type `bool`
found type `std::ops::Range<bool>`
error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:135:15
|
LL | while let Range { start: _, end: _ } = true..true || false {}
LL | while let Range { start: _, end: _ } = true..true && false {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ ---- this match expression has type `bool`
| |
| expected bool, found struct `std::ops::Range`
@ -812,6 +814,26 @@ LL | while let Range { start: _, end: _ } = true..true || false {}
error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:135:11
|
LL | while let Range { start: _, end: _ } = true..true && false {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected bool, found struct `std::ops::Range`
|
= note: expected type `bool`
found type `std::ops::Range<bool>`
error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:139:15
|
LL | while let Range { start: _, end: _ } = true..true || false {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ ---- this match expression has type `bool`
| |
| expected bool, found struct `std::ops::Range`
|
= note: expected type `bool`
found type `std::ops::Range<_>`
error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:139:11
|
LL | while let Range { start: _, end: _ } = true..true || false {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected bool, found struct `std::ops::Range`
|
@ -819,7 +841,7 @@ LL | while let Range { start: _, end: _ } = true..true || false {}
found type `std::ops::Range<bool>`
error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:142:15
--> $DIR/disallowed-positions.rs:146:15
|
LL | while let Range { start: F, end } = F..|| true {}
| ^^^^^^^^^^^^^^^^^^^^^^^ expected fn pointer, found struct `std::ops::Range`
@ -828,16 +850,16 @@ LL | while let Range { start: F, end } = F..|| true {}
found type `std::ops::Range<_>`
error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:142:44
--> $DIR/disallowed-positions.rs:146:44
|
LL | while let Range { start: F, end } = F..|| true {}
| ^^^^^^^ expected bool, found closure
|
= note: expected type `bool`
found type `[closure@$DIR/disallowed-positions.rs:142:44: 142:51]`
found type `[closure@$DIR/disallowed-positions.rs:146:44: 146:51]`
error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:142:11
--> $DIR/disallowed-positions.rs:146:11
|
LL | while let Range { start: F, end } = F..|| true {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected bool, found struct `std::ops::Range`
@ -846,7 +868,7 @@ LL | while let Range { start: F, end } = F..|| true {}
found type `std::ops::Range<bool>`
error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:150:15
--> $DIR/disallowed-positions.rs:154:15
|
LL | while let Range { start: true, end } = t..&&false {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ - this match expression has type `bool`
@ -857,7 +879,7 @@ LL | while let Range { start: true, end } = t..&&false {}
found type `std::ops::Range<_>`
error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:150:47
--> $DIR/disallowed-positions.rs:154:47
|
LL | while let Range { start: true, end } = t..&&false {}
| ^^^^^^^ expected bool, found &&bool
@ -866,7 +888,7 @@ LL | while let Range { start: true, end } = t..&&false {}
found type `&&bool`
error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:150:11
--> $DIR/disallowed-positions.rs:154:11
|
LL | while let Range { start: true, end } = t..&&false {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected bool, found struct `std::ops::Range`
@ -874,40 +896,63 @@ LL | while let Range { start: true, end } = t..&&false {}
= note: expected type `bool`
found type `std::ops::Range<bool>`
error[E0277]: the `?` operator can only be applied to values that implement `std::ops::Try`
--> $DIR/disallowed-positions.rs:106:23
error[E0277]: the trait bound `bool: std::ops::Try` is not satisfied
--> $DIR/disallowed-positions.rs:113:11
|
LL | while (let 0 = 0)? {}
| ^^^^^^^^^^^^ the trait `std::ops::Try` is not implemented for `bool`
error[E0277]: the trait bound `{integer}: std::ops::Try` is not satisfied
--> $DIR/disallowed-positions.rs:108:23
|
LL | while let 0 = 0? {}
| ^^ the `?` operator cannot be applied to type `{integer}`
| ^ the trait `std::ops::Try` is not implemented for `{integer}`
|
= help: the trait `std::ops::Try` is not implemented for `{integer}`
= help: the following implementations were found:
<std::iter::LoopState<C, B> as std::ops::Try>
<std::option::Option<T> as std::ops::Try>
<std::result::Result<T, E> as std::ops::Try>
<std::task::Poll<std::option::Option<std::result::Result<T, E>>> as std::ops::Try>
<std::task::Poll<std::result::Result<T, E>> as std::ops::Try>
= note: required by `std::ops::Try::into_result`
error[E0277]: the trait bound `{integer}: std::ops::Try` is not satisfied
--> $DIR/disallowed-positions.rs:108:23
|
LL | while let 0 = 0? {}
| ^^ the trait `std::ops::Try` is not implemented for `{integer}`
|
= help: the following implementations were found:
<std::iter::LoopState<C, B> as std::ops::Try>
<std::option::Option<T> as std::ops::Try>
<std::result::Result<T, E> as std::ops::Try>
<std::task::Poll<std::option::Option<std::result::Result<T, E>>> as std::ops::Try>
<std::task::Poll<std::result::Result<T, E>> as std::ops::Try>
error[E0614]: type `bool` cannot be dereferenced
--> $DIR/disallowed-positions.rs:173:5
--> $DIR/disallowed-positions.rs:177:5
|
LL | *let 0 = 0;
| ^^^^^^^^^^
error[E0600]: cannot apply unary operator `-` to type `bool`
--> $DIR/disallowed-positions.rs:175:5
--> $DIR/disallowed-positions.rs:179:5
|
LL | -let 0 = 0;
| ^^^^^^^^^^ cannot apply unary operator `-`
|
= note: an implementation of `std::ops::Neg` might be missing for `bool`
error[E0277]: the `?` operator can only be applied to values that implement `std::ops::Try`
--> $DIR/disallowed-positions.rs:183:5
error[E0277]: the trait bound `bool: std::ops::Try` is not satisfied
--> $DIR/disallowed-positions.rs:188:5
|
LL | (let 0 = 0)?;
| ^^^^^^^^^^^^ the `?` operator cannot be applied to type `bool`
| ^^^^^^^^^^^ the trait `std::ops::Try` is not implemented for `bool`
|
= help: the trait `std::ops::Try` is not implemented for `bool`
= note: required by `std::ops::Try::into_result`
error[E0277]: the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `std::ops::Try`)
--> $DIR/disallowed-positions.rs:183:5
--> $DIR/disallowed-positions.rs:188:5
|
LL | (let 0 = 0)?;
| ^^^^^^^^^^^^ cannot use the `?` operator in a function that returns `()`
@ -916,7 +961,7 @@ LL | (let 0 = 0)?;
= note: required by `std::ops::Try::from_error`
error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:198:10
--> $DIR/disallowed-positions.rs:204:10
|
LL | (let Range { start: _, end: _ } = true..true || false);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ ---- this match expression has type `bool`
@ -927,7 +972,7 @@ LL | (let Range { start: _, end: _ } = true..true || false);
found type `std::ops::Range<_>`
error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:207:5
--> $DIR/disallowed-positions.rs:213:5
|
LL | fn outside_if_and_while_expr() {
| - help: try adding a return type: `-> &bool`
@ -938,26 +983,38 @@ LL | &let 0 = 0
= note: expected type `()`
found type `&bool`
error[E0277]: the `?` operator can only be applied to values that implement `std::ops::Try`
--> $DIR/disallowed-positions.rs:179:17
error[E0277]: the trait bound `bool: std::ops::Try` is not satisfied
--> $DIR/disallowed-positions.rs:188:5
|
LL | (let 0 = 0)?;
| ^^^^^^^^^^^^ the trait `std::ops::Try` is not implemented for `bool`
error[E0277]: the trait bound `{integer}: std::ops::Try` is not satisfied
--> $DIR/disallowed-positions.rs:183:17
|
LL | let 0 = 0?;
| ^^ the `?` operator cannot be applied to type `{integer}`
| ^ the trait `std::ops::Try` is not implemented for `{integer}`
|
= help: the trait `std::ops::Try` is not implemented for `{integer}`
= help: the following implementations were found:
<std::iter::LoopState<C, B> as std::ops::Try>
<std::option::Option<T> as std::ops::Try>
<std::result::Result<T, E> as std::ops::Try>
<std::task::Poll<std::option::Option<std::result::Result<T, E>>> as std::ops::Try>
<std::task::Poll<std::result::Result<T, E>> as std::ops::Try>
= note: required by `std::ops::Try::into_result`
error[E0019]: constant contains unimplemented expression type
--> $DIR/disallowed-positions.rs:218:25
error[E0277]: the trait bound `{integer}: std::ops::Try` is not satisfied
--> $DIR/disallowed-positions.rs:183:17
|
LL | true && let 1 = 1
| ^
error[E0019]: constant contains unimplemented expression type
--> $DIR/disallowed-positions.rs:218:21
LL | let 0 = 0?;
| ^^ the trait `std::ops::Try` is not implemented for `{integer}`
|
LL | true && let 1 = 1
| ^
= help: the following implementations were found:
<std::iter::LoopState<C, B> as std::ops::Try>
<std::option::Option<T> as std::ops::Try>
<std::result::Result<T, E> as std::ops::Try>
<std::task::Poll<std::option::Option<std::result::Result<T, E>>> as std::ops::Try>
<std::task::Poll<std::result::Result<T, E>> as std::ops::Try>
error[E0019]: constant contains unimplemented expression type
--> $DIR/disallowed-positions.rs:224:25
@ -983,7 +1040,19 @@ error[E0019]: constant contains unimplemented expression type
LL | true && let 1 = 1
| ^
error: aborting due to 109 previous errors
error[E0019]: constant contains unimplemented expression type
--> $DIR/disallowed-positions.rs:236:25
|
LL | true && let 1 = 1
| ^
error[E0019]: constant contains unimplemented expression type
--> $DIR/disallowed-positions.rs:236:21
|
LL | true && let 1 = 1
| ^
error: aborting due to 115 previous errors
Some errors have detailed explanations: E0019, E0277, E0308, E0600, E0614.
For more information about an error, try `rustc --explain E0019`.

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,11 +1,11 @@
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}`
| ^^^ the trait `std::future::Future` is not implemented for `fn() -> impl std::future::Future {foo}`
|
= help: use parentheses to call the function: `foo()`

View file

@ -1,11 +1,11 @@
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}`
| ^^^ the trait `T` is not implemented for `fn() -> impl T {foo}`
|
= help: use parentheses to call the function: `foo()`

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

@ -10,6 +10,7 @@ fn main() {
// a non-`Try` type on a non-`Try` fn
()?; //~ ERROR the `?` operator can only
//~^ ERROR the trait bound `(): std::ops::Try` is not satisfied
// an unrelated use of `Try`
try_trait_generic::<()>(); //~ ERROR the trait bound
@ -19,7 +20,8 @@ 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 trait bound `(): std::ops::Try` is not satisfied
//~^ ERROR the trait bound `(): std::ops::Try` is not satisfied
loop {}
}

View file

@ -7,17 +7,25 @@ LL | std::fs::File::open("foo")?;
= help: the trait `std::ops::Try` is not implemented for `()`
= note: required by `std::ops::Try::from_error`
error[E0277]: the `?` operator can only be applied to values that implement `std::ops::Try`
error[E0277]: the trait bound `(): std::ops::Try` is not satisfied
--> $DIR/try-operator-on-main.rs:12:5
|
LL | ()?;
| ^^^ the `?` operator cannot be applied to type `()`
| ^^ the trait `std::ops::Try` is not implemented for `()`
|
= help: the trait `std::ops::Try` is not implemented for `()`
= note: required by `std::ops::Try::into_result`
error[E0277]: the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `std::ops::Try`)
--> $DIR/try-operator-on-main.rs:12:5
|
LL | ()?;
| ^^^ cannot use the `?` operator in a function that returns `()`
|
= help: the trait `std::ops::Try` is not implemented for `()`
= note: required by `std::ops::Try::from_error`
error[E0277]: the trait bound `(): std::ops::Try` is not satisfied
--> $DIR/try-operator-on-main.rs:15:5
--> $DIR/try-operator-on-main.rs:16:5
|
LL | try_trait_generic::<()>();
| ^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::ops::Try` is not implemented for `()`
@ -25,15 +33,20 @@ LL | try_trait_generic::<()>();
LL | fn try_trait_generic<T: Try>() -> T {
| ----------------------------------- required by `try_trait_generic`
error[E0277]: the `?` operator can only be applied to values that implement `std::ops::Try`
--> $DIR/try-operator-on-main.rs:22:5
error[E0277]: the trait bound `(): std::ops::Try` is not satisfied
--> $DIR/try-operator-on-main.rs:23:5
|
LL | ()?;
| ^^^ the `?` operator cannot be applied to type `()`
| ^^ the trait `std::ops::Try` is not implemented for `()`
|
= help: the trait `std::ops::Try` is not implemented for `()`
= note: required by `std::ops::Try::into_result`
error: aborting due to 4 previous errors
error[E0277]: the trait bound `(): std::ops::Try` is not satisfied
--> $DIR/try-operator-on-main.rs:23:5
|
LL | ()?;
| ^^^ the trait `std::ops::Try` is not implemented for `()`
error: aborting due to 6 previous errors
For more information about this error, try `rustc --explain E0277`.

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