-
-
Notifications
You must be signed in to change notification settings - Fork 14.1k
Make const BorrowMut require const Borrow and make const Fn require const FnMut
#147939
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
base: main
Are you sure you want to change the base?
Conversation
This file previously contained an error annotation with incorrect syntax. Remove this annotation, as per the dev guide, since this is marked as known-bug. https://rustc-dev-guide.rust-lang.org/tests/ui.html#known-bugs
|
|
||
| fn main() { | ||
| (const || (()).foo())(); | ||
| // ^ ERROR: cannot call non-const method `<() as Foo>::foo` in constant functions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We sometimes leave these in to keep some context for when someone fixes the test. Fine here tho
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should also dedup super traits for constness goals, like we already do for traits.
|
idk if that should be part of this PR, regardless r? @oli-obk |
|
|
This makes it consistent with other const traits in the standard library with supertraits.
I am currently unsure if
const FnMutshould requireconst FnOnceor not. See zulip discussion.