1
Fork 0

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:
Luca Versari 2025-01-25 21:36:40 +01:00
parent 203e6c127c
commit 6bdc8778db
3 changed files with 47 additions and 13 deletions

View file

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