Skip to content

Commit d085194

Browse files
authored
Rollup merge of #100647 - obeis:issue-99875, r=nagisa
Make trait bound not satisfied specify kind Closes #99875
2 parents bd9750f + 1383f0e commit d085194

18 files changed

+111
-39
lines changed

Diff for: compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs

+30-7
Original file line numberDiff line numberDiff line change
@@ -450,12 +450,27 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
450450
{
451451
"consider using `()`, or a `Result`".to_owned()
452452
} else {
453-
format!(
454-
"{}the trait `{}` is not implemented for `{}`",
455-
pre_message,
456-
trait_predicate.print_modifiers_and_trait_path(),
457-
trait_ref.skip_binder().self_ty(),
458-
)
453+
let ty_desc = match trait_ref.skip_binder().self_ty().kind() {
454+
ty::FnDef(_, _) => Some("fn item"),
455+
ty::Closure(_, _) => Some("closure"),
456+
_ => None,
457+
};
458+
459+
match ty_desc {
460+
Some(desc) => format!(
461+
"{}the trait `{}` is not implemented for {} `{}`",
462+
pre_message,
463+
trait_predicate.print_modifiers_and_trait_path(),
464+
desc,
465+
trait_ref.skip_binder().self_ty(),
466+
),
467+
None => format!(
468+
"{}the trait `{}` is not implemented for `{}`",
469+
pre_message,
470+
trait_predicate.print_modifiers_and_trait_path(),
471+
trait_ref.skip_binder().self_ty(),
472+
),
473+
}
459474
};
460475

461476
if self.suggest_add_reference_to_arg(
@@ -1805,13 +1820,21 @@ impl<'a, 'tcx> InferCtxtPrivExt<'a, 'tcx> for InferCtxt<'a, 'tcx> {
18051820
return false;
18061821
}
18071822
if candidates.len() == 1 {
1823+
let ty_desc = match candidates[0].self_ty().kind() {
1824+
ty::FnPtr(_) => Some("fn pointer"),
1825+
_ => None,
1826+
};
1827+
let the_desc = match ty_desc {
1828+
Some(desc) => format!(" implemented for {} `", desc),
1829+
None => " implemented for `".to_string(),
1830+
};
18081831
err.highlighted_help(vec![
18091832
(
18101833
format!("the trait `{}` ", candidates[0].print_only_trait_path()),
18111834
Style::NoStyle,
18121835
),
18131836
("is".to_string(), Style::Highlight),
1814-
(" implemented for `".to_string(), Style::NoStyle),
1837+
(the_desc, Style::NoStyle),
18151838
(candidates[0].self_ty().to_string(), Style::Highlight),
18161839
("`".to_string(), Style::NoStyle),
18171840
]);

Diff for: src/test/ui/async-await/issues/issue-62009-1.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ error[E0277]: `[closure@$DIR/issue-62009-1.rs:12:6: 12:9]` is not a future
3030
LL | (|_| 2333).await;
3131
| ^^^^^^ `[closure@$DIR/issue-62009-1.rs:12:6: 12:9]` is not a future
3232
|
33-
= help: the trait `Future` is not implemented for `[closure@$DIR/issue-62009-1.rs:12:6: 12:9]`
33+
= help: the trait `Future` is not implemented for closure `[closure@$DIR/issue-62009-1.rs:12:6: 12:9]`
3434
= note: [closure@$DIR/issue-62009-1.rs:12:6: 12:9] must be a future or must implement `IntoFuture` to be awaited
3535
= note: required for `[closure@$DIR/issue-62009-1.rs:12:6: 12:9]` to implement `IntoFuture`
3636
help: remove the `.await`

Diff for: src/test/ui/binop/issue-77910-1.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ LL | fn foo(s: &i32) -> &i32 {
1818
LL | assert_eq!(foo, y);
1919
| ^^^^^^^^^^^^^^^^^^ `for<'r> fn(&'r i32) -> &'r i32 {foo}` cannot be formatted using `{:?}` because it doesn't implement `Debug`
2020
|
21-
= help: the trait `Debug` is not implemented for `for<'r> fn(&'r i32) -> &'r i32 {foo}`
21+
= help: the trait `Debug` is not implemented for fn item `for<'r> fn(&'r i32) -> &'r i32 {foo}`
2222
= help: use parentheses to call the function: `foo(s)`
2323
= note: this error originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
2424

Diff for: src/test/ui/closures/coerce-unsafe-to-closure.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LL | let x: Option<&[u8]> = Some("foo").map(std::mem::transmute);
66
| |
77
| required by a bound introduced by this call
88
|
9-
= help: the trait `FnOnce<(&str,)>` is not implemented for `unsafe extern "rust-intrinsic" fn(_) -> _ {transmute::<_, _>}`
9+
= help: the trait `FnOnce<(&str,)>` is not implemented for fn item `unsafe extern "rust-intrinsic" fn(_) -> _ {transmute::<_, _>}`
1010
= note: unsafe function cannot be called generically without an unsafe block
1111
note: required by a bound in `Option::<T>::map`
1212
--> $SRC_DIR/core/src/option.rs:LL:COL

Diff for: src/test/ui/extern/extern-wrong-value-type.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LL | is_fn(f);
66
| |
77
| required by a bound introduced by this call
88
|
9-
= help: the trait `Fn<()>` is not implemented for `extern "C" fn() {f}`
9+
= help: the trait `Fn<()>` is not implemented for fn item `extern "C" fn() {f}`
1010
= note: wrap the `extern "C" fn() {f}` in a closure with no arguments: `|| { /* code */ }`
1111
note: required by a bound in `is_fn`
1212
--> $DIR/extern-wrong-value-type.rs:4:28

Diff for: src/test/ui/intrinsics/const-eval-select-bad.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LL | const_eval_select((), || {}, || {});
66
| |
77
| required by a bound introduced by this call
88
|
9-
= help: the trait `~const FnOnce<()>` is not implemented for `[closure@$DIR/const-eval-select-bad.rs:7:27: 7:29]`
9+
= help: the trait `~const FnOnce<()>` is not implemented for closure `[closure@$DIR/const-eval-select-bad.rs:7:27: 7:29]`
1010
note: the trait `FnOnce<()>` is implemented for `[closure@$DIR/const-eval-select-bad.rs:7:27: 7:29]`, but that implementation is not `const`
1111
--> $DIR/const-eval-select-bad.rs:7:27
1212
|

Diff for: src/test/ui/issues/issue-59488.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ error[E0277]: `fn(usize) -> Foo {Foo::Bar}` doesn't implement `Debug`
8989
LL | assert_eq!(Foo::Bar, i);
9090
| ^^^^^^^^^^^^^^^^^^^^^^^ `fn(usize) -> Foo {Foo::Bar}` cannot be formatted using `{:?}` because it doesn't implement `Debug`
9191
|
92-
= help: the trait `Debug` is not implemented for `fn(usize) -> Foo {Foo::Bar}`
92+
= help: the trait `Debug` is not implemented for fn item `fn(usize) -> Foo {Foo::Bar}`
9393
= help: the following other types implement trait `Debug`:
9494
extern "C" fn() -> Ret
9595
extern "C" fn(A, B) -> Ret
@@ -108,7 +108,7 @@ error[E0277]: `fn(usize) -> Foo {Foo::Bar}` doesn't implement `Debug`
108108
LL | assert_eq!(Foo::Bar, i);
109109
| ^^^^^^^^^^^^^^^^^^^^^^^ `fn(usize) -> Foo {Foo::Bar}` cannot be formatted using `{:?}` because it doesn't implement `Debug`
110110
|
111-
= help: the trait `Debug` is not implemented for `fn(usize) -> Foo {Foo::Bar}`
111+
= help: the trait `Debug` is not implemented for fn item `fn(usize) -> Foo {Foo::Bar}`
112112
= help: the following other types implement trait `Debug`:
113113
extern "C" fn() -> Ret
114114
extern "C" fn(A, B) -> Ret

Diff for: src/test/ui/issues/issue-70724-add_type_neq_err_label-unwrap.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ LL | fn a() -> i32 {
2828
LL | assert_eq!(a, 0);
2929
| ^^^^^^^^^^^^^^^^ `fn() -> i32 {a}` cannot be formatted using `{:?}` because it doesn't implement `Debug`
3030
|
31-
= help: the trait `Debug` is not implemented for `fn() -> i32 {a}`
31+
= help: the trait `Debug` is not implemented for fn item `fn() -> i32 {a}`
3232
= help: use parentheses to call the function: `a()`
3333
= note: this error originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
3434

Diff for: src/test/ui/issues/issue-99875.rs

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
struct Argument;
2+
struct Return;
3+
4+
fn function(_: Argument) -> Return { todo!() }
5+
6+
trait Trait {}
7+
impl Trait for fn(Argument) -> Return {}
8+
9+
fn takes(_: impl Trait) {}
10+
11+
fn main() {
12+
takes(function);
13+
//~^ ERROR the trait bound
14+
takes(|_: Argument| -> Return { todo!() });
15+
//~^ ERROR the trait bound
16+
}

Diff for: src/test/ui/issues/issue-99875.stderr

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
error[E0277]: the trait bound `fn(Argument) -> Return {function}: Trait` is not satisfied
2+
--> $DIR/issue-99875.rs:12:11
3+
|
4+
LL | takes(function);
5+
| ----- ^^^^^^^^ the trait `Trait` is not implemented for fn item `fn(Argument) -> Return {function}`
6+
| |
7+
| required by a bound introduced by this call
8+
|
9+
= help: the trait `Trait` is implemented for fn pointer `fn(Argument) -> Return`
10+
note: required by a bound in `takes`
11+
--> $DIR/issue-99875.rs:9:18
12+
|
13+
LL | fn takes(_: impl Trait) {}
14+
| ^^^^^ required by this bound in `takes`
15+
16+
error[E0277]: the trait bound `[closure@$DIR/issue-99875.rs:14:11: 14:34]: Trait` is not satisfied
17+
--> $DIR/issue-99875.rs:14:11
18+
|
19+
LL | takes(|_: Argument| -> Return { todo!() });
20+
| ----- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Trait` is not implemented for closure `[closure@$DIR/issue-99875.rs:14:11: 14:34]`
21+
| |
22+
| required by a bound introduced by this call
23+
|
24+
= help: the trait `Trait` is implemented for fn pointer `fn(Argument) -> Return`
25+
note: required by a bound in `takes`
26+
--> $DIR/issue-99875.rs:9:18
27+
|
28+
LL | fn takes(_: impl Trait) {}
29+
| ^^^^^ required by this bound in `takes`
30+
31+
error: aborting due to 2 previous errors
32+
33+
For more information about this error, try `rustc --explain E0277`.

Diff for: src/test/ui/namespace/namespace-mix.stderr

+4-4
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ error[E0277]: the trait bound `fn() -> c::TS {c::TS}: Impossible` is not satisfi
218218
--> $DIR/namespace-mix.rs:56:11
219219
|
220220
LL | check(m3::TS);
221-
| ----- ^^^^^^ the trait `Impossible` is not implemented for `fn() -> c::TS {c::TS}`
221+
| ----- ^^^^^^ the trait `Impossible` is not implemented for fn item `fn() -> c::TS {c::TS}`
222222
| |
223223
| required by a bound introduced by this call
224224
|
@@ -274,7 +274,7 @@ error[E0277]: the trait bound `fn() -> namespace_mix::c::TS {namespace_mix::c::T
274274
--> $DIR/namespace-mix.rs:62:11
275275
|
276276
LL | check(xm3::TS);
277-
| ----- ^^^^^^^ the trait `Impossible` is not implemented for `fn() -> namespace_mix::c::TS {namespace_mix::c::TS}`
277+
| ----- ^^^^^^^ the trait `Impossible` is not implemented for fn item `fn() -> namespace_mix::c::TS {namespace_mix::c::TS}`
278278
| |
279279
| required by a bound introduced by this call
280280
|
@@ -526,7 +526,7 @@ error[E0277]: the trait bound `fn() -> c::E {c::E::TV}: Impossible` is not satis
526526
--> $DIR/namespace-mix.rs:122:11
527527
|
528528
LL | check(m9::TV);
529-
| ----- ^^^^^^ the trait `Impossible` is not implemented for `fn() -> c::E {c::E::TV}`
529+
| ----- ^^^^^^ the trait `Impossible` is not implemented for fn item `fn() -> c::E {c::E::TV}`
530530
| |
531531
| required by a bound introduced by this call
532532
|
@@ -582,7 +582,7 @@ error[E0277]: the trait bound `fn() -> namespace_mix::c::E {namespace_mix::xm7::
582582
--> $DIR/namespace-mix.rs:128:11
583583
|
584584
LL | check(xm9::TV);
585-
| ----- ^^^^^^^ the trait `Impossible` is not implemented for `fn() -> namespace_mix::c::E {namespace_mix::xm7::TV}`
585+
| ----- ^^^^^^^ the trait `Impossible` is not implemented for fn item `fn() -> namespace_mix::c::E {namespace_mix::xm7::TV}`
586586
| |
587587
| required by a bound introduced by this call
588588
|

Diff for: src/test/ui/proc-macro/signature.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ LL | | }
1010
| |_call the function in a closure: `|| unsafe { /* code */ }`
1111
| required by a bound introduced by this call
1212
|
13-
= help: the trait `Fn<(proc_macro::TokenStream,)>` is not implemented for `unsafe extern "C" fn(i32, u32) -> u32 {foo}`
13+
= help: the trait `Fn<(proc_macro::TokenStream,)>` is not implemented for fn item `unsafe extern "C" fn(i32, u32) -> u32 {foo}`
1414
= note: unsafe function cannot be called generically without an unsafe block
1515
note: required by a bound in `ProcMacro::custom_derive`
1616
--> $SRC_DIR/proc_macro/src/bridge/client.rs:LL:COL

Diff for: src/test/ui/rfcs/rfc-2396-target_feature-11/fn-traits.stderr

+6-6
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LL | call(foo);
66
| |
77
| required by a bound introduced by this call
88
|
9-
= help: the trait `Fn<()>` is not implemented for `fn() {foo}`
9+
= help: the trait `Fn<()>` is not implemented for fn item `fn() {foo}`
1010
= note: wrap the `fn() {foo}` in a closure with no arguments: `|| { /* code */ }`
1111
= note: `#[target_feature]` functions do not implement the `Fn` traits
1212
note: required by a bound in `call`
@@ -23,7 +23,7 @@ LL | call_mut(foo);
2323
| |
2424
| required by a bound introduced by this call
2525
|
26-
= help: the trait `FnMut<()>` is not implemented for `fn() {foo}`
26+
= help: the trait `FnMut<()>` is not implemented for fn item `fn() {foo}`
2727
= note: wrap the `fn() {foo}` in a closure with no arguments: `|| { /* code */ }`
2828
= note: `#[target_feature]` functions do not implement the `Fn` traits
2929
note: required by a bound in `call_mut`
@@ -40,7 +40,7 @@ LL | call_once(foo);
4040
| |
4141
| required by a bound introduced by this call
4242
|
43-
= help: the trait `FnOnce<()>` is not implemented for `fn() {foo}`
43+
= help: the trait `FnOnce<()>` is not implemented for fn item `fn() {foo}`
4444
= note: wrap the `fn() {foo}` in a closure with no arguments: `|| { /* code */ }`
4545
= note: `#[target_feature]` functions do not implement the `Fn` traits
4646
note: required by a bound in `call_once`
@@ -57,7 +57,7 @@ LL | call(foo_unsafe);
5757
| |
5858
| required by a bound introduced by this call
5959
|
60-
= help: the trait `Fn<()>` is not implemented for `unsafe fn() {foo_unsafe}`
60+
= help: the trait `Fn<()>` is not implemented for fn item `unsafe fn() {foo_unsafe}`
6161
= note: wrap the `unsafe fn() {foo_unsafe}` in a closure with no arguments: `|| { /* code */ }`
6262
= note: `#[target_feature]` functions do not implement the `Fn` traits
6363
note: required by a bound in `call`
@@ -74,7 +74,7 @@ LL | call_mut(foo_unsafe);
7474
| |
7575
| required by a bound introduced by this call
7676
|
77-
= help: the trait `FnMut<()>` is not implemented for `unsafe fn() {foo_unsafe}`
77+
= help: the trait `FnMut<()>` is not implemented for fn item `unsafe fn() {foo_unsafe}`
7878
= note: wrap the `unsafe fn() {foo_unsafe}` in a closure with no arguments: `|| { /* code */ }`
7979
= note: `#[target_feature]` functions do not implement the `Fn` traits
8080
note: required by a bound in `call_mut`
@@ -91,7 +91,7 @@ LL | call_once(foo_unsafe);
9191
| |
9292
| required by a bound introduced by this call
9393
|
94-
= help: the trait `FnOnce<()>` is not implemented for `unsafe fn() {foo_unsafe}`
94+
= help: the trait `FnOnce<()>` is not implemented for fn item `unsafe fn() {foo_unsafe}`
9595
= note: wrap the `unsafe fn() {foo_unsafe}` in a closure with no arguments: `|| { /* code */ }`
9696
= note: `#[target_feature]` functions do not implement the `Fn` traits
9797
note: required by a bound in `call_once`

Diff for: src/test/ui/suggestions/async-fn-ctor-passed-as-arg-where-it-should-have-been-called.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ LL | bar(foo);
99
| |
1010
| required by a bound introduced by this call
1111
|
12-
= help: the trait `Future` is not implemented for `fn() -> impl Future<Output = ()> {foo}`
12+
= help: the trait `Future` is not implemented for fn item `fn() -> impl Future<Output = ()> {foo}`
1313
= note: fn() -> impl Future<Output = ()> {foo} must be a future or must implement `IntoFuture` to be awaited
1414
note: required by a bound in `bar`
1515
--> $DIR/async-fn-ctor-passed-as-arg-where-it-should-have-been-called.rs:7:16
@@ -31,7 +31,7 @@ LL | bar(async_closure);
3131
| |
3232
| required by a bound introduced by this call
3333
|
34-
= help: the trait `Future` is not implemented for `[closure@$DIR/async-fn-ctor-passed-as-arg-where-it-should-have-been-called.rs:11:25: 11:33]`
34+
= help: the trait `Future` is not implemented for closure `[closure@$DIR/async-fn-ctor-passed-as-arg-where-it-should-have-been-called.rs:11:25: 11:33]`
3535
= note: [closure@$DIR/async-fn-ctor-passed-as-arg-where-it-should-have-been-called.rs:11:25: 11:33] must be a future or must implement `IntoFuture` to be awaited
3636
note: required by a bound in `bar`
3737
--> $DIR/async-fn-ctor-passed-as-arg-where-it-should-have-been-called.rs:7:16

Diff for: src/test/ui/suggestions/fn-ctor-passed-as-arg-where-it-should-have-been-called.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LL | fn foo() -> impl T<O=()> { S }
55
| --- consider calling this function
66
...
77
LL | bar(foo);
8-
| --- ^^^ the trait `T` is not implemented for `fn() -> impl T<O = ()> {foo}`
8+
| --- ^^^ the trait `T` is not implemented for fn item `fn() -> impl T<O = ()> {foo}`
99
| |
1010
| required by a bound introduced by this call
1111
|
@@ -25,7 +25,7 @@ error[E0277]: the trait bound `[closure@$DIR/fn-ctor-passed-as-arg-where-it-shou
2525
LL | let closure = || S;
2626
| -- consider calling this closure
2727
LL | bar(closure);
28-
| --- ^^^^^^^ the trait `T` is not implemented for `[closure@$DIR/fn-ctor-passed-as-arg-where-it-should-have-been-called.rs:18:19: 18:21]`
28+
| --- ^^^^^^^ the trait `T` is not implemented for closure `[closure@$DIR/fn-ctor-passed-as-arg-where-it-should-have-been-called.rs:18:19: 18:21]`
2929
| |
3030
| required by a bound introduced by this call
3131
|

Diff for: src/test/ui/unboxed-closures/unboxed-closures-unsafe-extern-fn.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LL | let x = call_it(&square, 22);
66
| |
77
| required by a bound introduced by this call
88
|
9-
= help: the trait `for<'r> Fn<(&'r isize,)>` is not implemented for `for<'r> unsafe fn(&'r isize) -> isize {square}`
9+
= help: the trait `for<'r> Fn<(&'r isize,)>` is not implemented for fn item `for<'r> unsafe fn(&'r isize) -> isize {square}`
1010
= note: unsafe function cannot be called generically without an unsafe block
1111
note: required by a bound in `call_it`
1212
--> $DIR/unboxed-closures-unsafe-extern-fn.rs:9:15
@@ -22,7 +22,7 @@ LL | let y = call_it_mut(&mut square, 22);
2222
| |
2323
| required by a bound introduced by this call
2424
|
25-
= help: the trait `for<'r> FnMut<(&'r isize,)>` is not implemented for `for<'r> unsafe fn(&'r isize) -> isize {square}`
25+
= help: the trait `for<'r> FnMut<(&'r isize,)>` is not implemented for fn item `for<'r> unsafe fn(&'r isize) -> isize {square}`
2626
= note: unsafe function cannot be called generically without an unsafe block
2727
note: required by a bound in `call_it_mut`
2828
--> $DIR/unboxed-closures-unsafe-extern-fn.rs:12:19
@@ -38,7 +38,7 @@ LL | let z = call_it_once(square, 22);
3838
| |
3939
| required by a bound introduced by this call
4040
|
41-
= help: the trait `for<'r> FnOnce<(&'r isize,)>` is not implemented for `for<'r> unsafe fn(&'r isize) -> isize {square}`
41+
= help: the trait `for<'r> FnOnce<(&'r isize,)>` is not implemented for fn item `for<'r> unsafe fn(&'r isize) -> isize {square}`
4242
= note: unsafe function cannot be called generically without an unsafe block
4343
note: required by a bound in `call_it_once`
4444
--> $DIR/unboxed-closures-unsafe-extern-fn.rs:15:20

Diff for: src/test/ui/unboxed-closures/unboxed-closures-wrong-abi.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LL | let x = call_it(&square, 22);
66
| |
77
| required by a bound introduced by this call
88
|
9-
= help: the trait `for<'r> Fn<(&'r isize,)>` is not implemented for `for<'r> extern "C" fn(&'r isize) -> isize {square}`
9+
= help: the trait `for<'r> Fn<(&'r isize,)>` is not implemented for fn item `for<'r> extern "C" fn(&'r isize) -> isize {square}`
1010
note: required by a bound in `call_it`
1111
--> $DIR/unboxed-closures-wrong-abi.rs:9:15
1212
|
@@ -21,7 +21,7 @@ LL | let y = call_it_mut(&mut square, 22);
2121
| |
2222
| required by a bound introduced by this call
2323
|
24-
= help: the trait `for<'r> FnMut<(&'r isize,)>` is not implemented for `for<'r> extern "C" fn(&'r isize) -> isize {square}`
24+
= help: the trait `for<'r> FnMut<(&'r isize,)>` is not implemented for fn item `for<'r> extern "C" fn(&'r isize) -> isize {square}`
2525
note: required by a bound in `call_it_mut`
2626
--> $DIR/unboxed-closures-wrong-abi.rs:12:19
2727
|
@@ -36,7 +36,7 @@ LL | let z = call_it_once(square, 22);
3636
| |
3737
| required by a bound introduced by this call
3838
|
39-
= help: the trait `for<'r> FnOnce<(&'r isize,)>` is not implemented for `for<'r> extern "C" fn(&'r isize) -> isize {square}`
39+
= help: the trait `for<'r> FnOnce<(&'r isize,)>` is not implemented for fn item `for<'r> extern "C" fn(&'r isize) -> isize {square}`
4040
note: required by a bound in `call_it_once`
4141
--> $DIR/unboxed-closures-wrong-abi.rs:15:20
4242
|

0 commit comments

Comments
 (0)