Skip to content
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

Don't print "const" keyword on non-nightly build if rustc_const_unstable is used on the item #74936

Merged
merged 2 commits into from Aug 10, 2020

Conversation

GuillaumeGomez
Copy link
Member

Fixes #74579.

@rust-highfive
Copy link
Collaborator

r? @ollie27

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 30, 2020
@ollie27 ollie27 added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Jul 30, 2020
@ollie27
Copy link
Member

ollie27 commented Jul 30, 2020

is_min_const_fn already checks for rustc_const_unstable. The issue in #74579 is that rustdoc isn't calling is_min_const_fn for methods from the current crate. That should probably happen around

Method { decl, generics, header: self.0.header, defaultness: self.3, all_types, ret_types }
overriding the constness field of header like is done elsewhere.

@GuillaumeGomez
Copy link
Member Author

In the places I added my own check. Great! Just need to update the code I already wrote then. Thanks a lot for the pointer @ollie27 !

@GuillaumeGomez GuillaumeGomez force-pushed the const-rustc_const_unstable branch 2 times, most recently from 132fb86 to 9ceabe1 Compare July 31, 2020 11:30
@GuillaumeGomez
Copy link
Member Author

Updated!

@ollie27
Copy link
Member

ollie27 commented Aug 4, 2020

Looks good. Just needs some tests like src/test/rustdoc/const-display.rs but for methods.

…d if the "rustc_const_unstable" attribute is present
@GuillaumeGomez
Copy link
Member Author

Added the test.

@GuillaumeGomez
Copy link
Member Author

ping @rust-lang/rustdoc

@jyn514
Copy link
Member

jyn514 commented Aug 10, 2020

Test looks good to me, trusting Ollie's review for the code changes.

@bors r+

@bors
Copy link
Contributor

bors commented Aug 10, 2020

📌 Commit 2a281e0 has been approved by jyn514

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 10, 2020
@bors
Copy link
Contributor

bors commented Aug 10, 2020

⌛ Testing commit 2a281e0 with merge 1275cc1...

@bors bors mentioned this pull request Aug 10, 2020
@bors
Copy link
Contributor

bors commented Aug 10, 2020

☀️ Test successful - checks-actions, checks-azure
Approved by: jyn514
Pushing 1275cc1 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Aug 10, 2020
@bors bors merged commit 1275cc1 into rust-lang:master Aug 10, 2020
@GuillaumeGomez GuillaumeGomez deleted the const-rustc_const_unstable branch August 10, 2020 19:08
@cuviper cuviper added this to the 1.47.0 milestone May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CStr::from_bytes_with_nul_unchecked() incorrectly listed as const in docs
6 participants