We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closures automatically implement the fn trait so this needs fixed
I tried this code:
#[lang = "sized"] pub trait Sized {} #[lang = "fn_once"] pub trait FnOnce<Args> { #[lang = "fn_once_output"] type Output; extern "rust-call" fn call_once(self, args: Args) -> Self::Output; } pub fn test() { let add: fn(i32) -> i32 = |x| { x }; }
https://godbolt.org/z/d4oo8dYoT
The current behavior is...
<source>:14:5: error: bounds not satisfied for fnptr (i32 ,) -> i32 'FnOnce' is not satisfied [E0277] 14 | let add: fn(i32) -> i32 = |x| { | ^~~
I expected to see...
compiles
9de4235
The text was updated successfully, but these errors were encountered:
philberty
No branches or pull requests
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: