You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey @philberty , Your closure |x| x does not capture any variables, so it can be converted into a fn type, using explicit coercion, you can actually convert it.
About the nighty nightly features thing, I think, it does not use nightly features, because #[lang = "sized"] and #[lang = "fn_once"], they are part of the stable Rust language and used to define fundamental traits so.
3.The error message 'FnOnce' is not satisfied [E0277] indicates that Rust couldn't convert the closure into a function pointer because closures implement the FnOnce trait but aren't automatically convertible to function pointers.SO I guess we can resolve it using an explicit coercion..
Summary
Closures automatically implement the fn trait so this needs fixed
Reproducer
I tried this code:
Does the code make use of any (1.49) nightly feature ?
Godbolt link
https://godbolt.org/z/d4oo8dYoT
Actual behavior
The current behavior is...
Expected behavior
I expected to see...
compiles
GCC Version
9de4235
The text was updated successfully, but these errors were encountered: