Add a suggestion to cast target_feature fn items to fn pointers.
See https://github.com/rust-lang/rust/pull/134090#issuecomment-2612197095 for the motivation behind this suggestion.
This commit is contained in:
parent
203e6c127c
commit
6bdc8778db
3 changed files with 47 additions and 13 deletions
|
@ -462,6 +462,9 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
|
|||
err.note(
|
||||
"`#[target_feature]` functions do not implement the `Fn` traits",
|
||||
);
|
||||
err.note(
|
||||
"try casting the function to a `fn` pointer or wrapping it in a closure",
|
||||
);
|
||||
}
|
||||
|
||||
self.try_to_add_help_message(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue