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
fn constrain<'a, F: FnOnce(&'a ())>(_: F) {} fn foo<'a>(_: &'a ()) -> impl Sized + use<'a> { constrain(foo); // adds use `opaque<'!a> = ()` () // adds use `opaque<'a> = ()` -> leak check error } fn main() {}
results in the following error in HIR typeck
error[E0277]: expected a `FnOnce(&())` closure, found `for<'a> fn(&'a ()) -> impl Sized {foo}` --> <source>:3:24 | 3 | constrain_identity(foo); | ------------------ ^^^ expected an `FnOnce(&())` closure, found `for<'a> fn(&'a ()) -> impl Sized {foo}` | | | required by a bound introduced by this call | = help: the trait `FnOnce(&())` is not implemented for fn item `for<'a> fn(&'a ()) -> impl Sized {foo}` note: required by a bound in `constrain_identity` --> <source>:1:30 | 1 | fn constrain_identity<'a, F: FnOnce(&'a ())>(_: F) {} | ^^^^^^^^^^^^^^ required by this bound in `constrain_identity`
The text was updated successfully, but these errors were encountered:
This adds a use referencing placeholders to the opaque type storage, might be fixed #140497
Sorry, something went wrong.
No branches or pull requests
results in the following error in HIR typeck
The text was updated successfully, but these errors were encountered: