about summary refs log tree commit diff
path: root/tests/ui/traits/fn-pointer/suggest-wrap-parens.stderr
blob: b71debac7156d12c4acd82e4da99f8e867dfecf0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
error[E0277]: the trait bound `fn() {main}: Foo` is not satisfied
  --> $DIR/suggest-wrap-parens.rs:8:24
   |
LL |     let _x: &dyn Foo = &main;
   |                        ^^^^^ the trait `Foo` is not implemented for fn item `fn() {main}`
   |
   = note: required for the cast from `&fn() {main}` to `&dyn Foo`
help: the trait `Foo` is implemented for fn pointer `fn()`, try casting using `as`
   |
LL |     let _x: &dyn Foo = &(main as fn());
   |                         +     ++++++++

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0277`.