-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Use is_unstable_const_fn
instead of is_min_const_fn
in rustdoc where appropriate
#76623
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @GuillaumeGomez (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
r? @jyn514 Could you please add a test for these changes in |
Will do. It looks like I still didn't quite get all the existing tests to pass though, without bringing the actual problem back... I'll have to see if there's a better function to use. |
Those test cases just look wrong?
// @has 'foo/fn.foo2.html' '//pre' 'pub fn foo2() -> u32'
#[unstable(feature = "humans", issue = "none")]
pub const fn foo2() -> u32 { 42 }
// @has 'foo/fn.foo2_gated.html' '//pre' 'pub unsafe fn foo2_gated() -> u32'
#[unstable(feature = "foo2", issue = "none")]
pub const unsafe fn foo2_gated() -> u32 { 42 }
// @has 'foo/fn.bar_not_gated.html' '//pre' 'pub unsafe fn bar_not_gated() -> u32'
pub const unsafe fn bar_not_gated() -> u32 { 42 } All of those should havea |
That's kind of what I was thinking as well. Particularly the one that is literally called |
I'll hold off on uploading the test file with the code from #76501 until we hear back, as there's no point in triggering another build when it's still going to fail Edit: How does this look as far as the XPATH stuff for it, though: #![feature(const_fn)]
// @has 'issue_76501/fn.bloop.html' '//pre' 'pub const fn bloop() -> i32'
/// A useless function that always returns 1.
pub const fn bloop() -> i32 {
1
}
/// A struct.
pub struct Struct {}
impl Struct {
// @has 'issue_76501/struct.Struct.html' '//*[@class="method"]' 'pub const fn bloop() -> i32'
/// A useless function that always returns 1.
pub const fn bloop() -> i32 {
1
}
} |
We should check why the tests were written this way maybe, but it seems wrong. |
Looks like this was introduced in a6943d9 as part of #56845. There wasn't any mention there of treating Your new test looks great :) |
* Fix `const-display.rs` XPATH queries * Add `issue_76501.rs` test file * Rename issue_76501.rs to issue-76501.rs
Ok, since everything passed, I went ahead and committed the function name changes in the Not sure if you want to let the whole build run again just for that, as it's definitely going to pass again? |
Sounds good to me, thanks for the PR! @bors r+ |
📌 Commit 8a1288b has been approved by |
No problem! Thanks for the guidance on it. |
Use `is_unstable_const_fn` instead of `is_min_const_fn` in rustdoc where appropriate This closes rust-lang#76501. Specifically, it allows for nightly users with the `#![feature(const_fn)]` flag enabled to still have their `const fn` declarations documented as such, while retaining the desired behavior that rustdoc *not* document functions that have the `rustc_const_unstable` attribute as `const`.
Use `is_unstable_const_fn` instead of `is_min_const_fn` in rustdoc where appropriate This closes rust-lang#76501. Specifically, it allows for nightly users with the `#![feature(const_fn)]` flag enabled to still have their `const fn` declarations documented as such, while retaining the desired behavior that rustdoc *not* document functions that have the `rustc_const_unstable` attribute as `const`.
☀️ Test successful - checks-actions, checks-azure |
This closes #76501. Specifically, it allows for nightly users with the
#![feature(const_fn)]
flag enabled to still have theirconst fn
declarations documented as such, while retaining the desired behavior that rustdoc not document functions that have therustc_const_unstable
attribute asconst
.