Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Please add the
rustc_const_unstable
attribute and a test enabling the feature and using it.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.
See #47562 for an example.
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.
Yep, I managed to get an example going. Unfortunately writing that example made me realise that this isn't usable for what I want anyway since it's
!Send + !Sync
so can't go in a static, as I don't know of any other usecases for this to beconst
I'm gonna close this and try to find an alternative.One thing I noticed while adding the example,
rustc_const_unstable
requires astable
/unstable
directly on the item being annotated,LocalWaker
is in anunstable
module so doesn't have a direct annotation, is there some reason the attribute needs to be directly on the item instead of inheriting from its parent scope?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.
Does implementation lazyness count as a reason?
Most newly added const fns already had a stability attribute, so it was less hazzle to add an attribute to those that didn't have it than to correctly implement the attribute
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.
Implementation lazyness is the best reason.
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.
<Joke about Haskell has been elided due to laziness>