-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
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 std::mem::drop()
not accepted as argument of type fn(&Arg)
#96057
Labels
A-inference
Area: Type inference
C-bug
Category: This is a bug.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Comments
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
The problem here is that drop is generic, so it can't even express such a bound because the reference is just |
ChrisDenton
added
the
needs-triage-legacy
Old issue that were never triaged. Remove this label once the issue has been sufficiently triaged.
label
Jul 16, 2023
Enselic
changed the title
Cannot use drop in place where toilet closure works if the argument is a reference
Jul 30, 2024
fn std::mem::drop()
not accepted as argument of type fn(&Arg)
Enselic
added
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
A-inference
Area: Type inference
and removed
needs-triage-legacy
Old issue that were never triaged. Remove this label once the issue has been sufficiently triaged.
labels
Jul 30, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-inference
Area: Type inference
C-bug
Category: This is a bug.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
I tried this code:
I expected to see this happen:
I expect the code to compile. It looks like this should work, because drop should be more or less equivalent to toilet closure, it just has generic argument, but without any bounds, so it seems like it should be accepted here.
Instead, this happened:
Code doesn't compile with:
Meta
rustc --version --verbose
:The text was updated successfully, but these errors were encountered: