Require stable/unstable annotations for the constness of all stable fns with a const modifier#67136
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
src/librustc/ty/constness.rs
Outdated
There was a problem hiding this comment.
The function this is in is called is_min_const_fn, but the body comments make it sounds more like "is the fn required to conform to min_const_fn restrictions", which is not reflected in the function name. Maybe must_be_min_const_fn?
There was a problem hiding this comment.
well... it's both :D We call is_min_const_fn to check whether a function can be called from other min const fn. When checking a function we call is_min_const_fn to check if we are callable from other min const fn and thus must conform.
src/librustc/ty/constness.rs
Outdated
There was a problem hiding this comment.
So internal unannounced functions are more restricted than stable functions with #[rustc_const_unstable]? That seems odd.
There was a problem hiding this comment.
Ah I see @Centril asked for this. Well I think this is somewhat silly and would prefer to treat functions without staging attributes the same as unstable functions, but I won't fight over this.^^
|
I'm strongly in favor of the general approach! However, I am unfamiliar with how stability checking is implemented, so I'll have to pass on the review. r? @Centril |
This comment has been minimized.
This comment has been minimized.
Centril
left a comment
There was a problem hiding this comment.
r=me with comments addressed
src/libsyntax/attr/builtin.rs
Outdated
There was a problem hiding this comment.
I have a feeling this function is doing way too much but let's not overhaul it here; making a note-to-self for now tho. I think the right structure would be to look for each attribute form independently and then do a post-processing step to merge information.
0dacbac to
50bc0d2
Compare
|
@bors r=Centril |
|
📌 Commit 50bc0d2f72babab9d9038274a0ba1e93ebcca85c has been approved by |
|
⌛ Testing commit 50bc0d2f72babab9d9038274a0ba1e93ebcca85c with merge 49c221ca4e14ea4210101b3be94ee74be1e6b444... |
|
The job Click to expand the log.I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
|
💔 Test failed - checks-azure |
…unctions with a `const` modifier
50bc0d2 to
f12affe
Compare
|
@bors r=Centril |
|
📌 Commit f12affe has been approved by |
|
@bors r- |
|
@bors r=Centril |
|
📌 Commit 0b47ba7 has been approved by |
Require stable/unstable annotations for the constness of all stable fns with a const modifier r? @RalfJung @Centril Every `#[stable]` const fn now needs either a `#[rustc_const_unstable]` attribute or a `#[rustc_const_stable]` attribute. You can't silently stabilize the constness of a function anymore.
Require stable/unstable annotations for the constness of all stable fns with a const modifier r? @RalfJung @Centril Every `#[stable]` const fn now needs either a `#[rustc_const_unstable]` attribute or a `#[rustc_const_stable]` attribute. You can't silently stabilize the constness of a function anymore.
|
☀️ Test successful - checks-azure |
r? @RalfJung @Centril
Every
#[stable]const fn now needs either a#[rustc_const_unstable]attribute or a#[rustc_const_stable]attribute. You can't silently stabilize the constness of a function anymore.