-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
It is currently not possible to tell if a function or method is a const fn
by reading documentation, as rustdoc does not retain the const
keyword in const fn
declarations
#76478
Comments
Currently, in nightly std: |
This should work fine, yeah. The only case in which rustdoc will (deliberately) omit the |
Hmmm, it's possible this is only a problem with struct member methods, and possibly not in all scenarios? I should have taken a closer look at other documentation first I guess. That said, for example, in my crate's documentation here, the very first method shown, (specifically, |
Can you provide a minimal reproduction for this to show up? |
Sure, I'll put one together later today when I have access to my normal dev setup. |
Just opened a new issue, as I narrowed it down to a very specific cause that consistently reproduces the problem. |
Basically, a function written for example like this:
is currently documented like this:
pub fn add(a: i32, b: i32) -> i32
but it would be nice if was instead documented like this:
pub const fn add(a: i32, b: i32) -> i32
The text was updated successfully, but these errors were encountered: