-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Function signature of resource_equals
differs from implementation in docs
#8898
Comments
To note: it has the correct signature in the sub-crate's documentation: https://docs.rs/bevy_ecs/latest/bevy_ecs/schedule/common_conditions/fn.resource_equals.html And it also happens on main, and for other conditions in the common_conditions module. any_with_components appears with a weird unnecessary line break in bevy_ecs: https://docs.rs/bevy_ecs/latest/bevy_ecs/schedule/common_conditions/fn.any_with_component.html but not in bevy: https://docs.rs/bevy/latest/bevy/ecs/schedule/common_conditions/fn.any_with_component.html , traits are not always at the same place (in where or not), PartialEq to PartialEq<T>, ... Probably more a problem with rustdoc, but we can maybe get around it. Edit: Possibly related issue for rustdoc: rust-lang/rust#44306 |
This is definitely the fault of
|
@fmease thanks a lot for the confirmation! Any idea why there's a line break in any_with_components doc? |
Ah, that doesn't look ideal. I've just checked and it's because rustdoc measures & and adds up the length of the function name, the arguments and the return type, realizes it's bigger than 80 bytes and thus inserts some line breaks inside the argument list. pub fn any_with_component<T: Component>(
) -> impl FnMut(Query<'_, '_, (), With<T>>) -> bool + Clone ^ Would you be fine with this output or would you rather have rustdoc output |
I am fine with this output, I'll ask other people on Bevy's discord just in case. |
Ah, I've just noticed that this regressed in rust-lang/rust#109011 meaning that before that it used to be rendered just like I proposed. |
…slim-arg-list, r=camelid rustdoc: get rid of extra line when line-wrapping fn decls with empty arg list Fixes bevyengine/bevy#8898 (comment): ![Screenshot 2023-06-24 at 23-42-53 any_with_component in bevy_ecs schedule common_conditions - Rust](https://github.com/rust-lang/rust/assets/14913065/4646eba6-b186-4d78-96d9-aad716a4ef5d) It now prints as shown below (which conforms to the style guide): ```rs pub fn any_with_component<T: Component>( ) -> impl FnMut(Query<'_, '_, (), With<T>>) -> bool + Clone ``` The bug was introduced in rust-lang#109011.
How can Bevy's documentation be improved?
In the latest version of bevys docs, the signature of
resource_equals
seems to be buggy.I was looking into how the common run conditions were implemented and was a bit confused when I saw this
I needed to check the bevy repos code to verify that the returned closure returns a
bool
.I don't know how to fix it yet though, but I'll see what I can do!
The text was updated successfully, but these errors were encountered: