Skip to content

rust: kernel: clean rustdoc warnings #412

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

Merged
merged 1 commit into from
Jul 2, 2021

Conversation

ojeda
Copy link
Member

@ojeda ojeda commented Jul 2, 2021

@ksquirrel

This comment has been minimized.

@wedsonaf
Copy link

wedsonaf commented Jul 2, 2021

#410 introduces another one of these.

@ksquirrel
Copy link
Member

Review of 4b832b45b818:

  • ✔️ Commit 4b832b4: Looks fine!

@ojeda
Copy link
Member Author

ojeda commented Jul 2, 2021

Thanks for the heads up -- merged #410 and fixed here.

@@ -12,7 +12,7 @@ use core::{mem::ManuallyDrop, ops::Deref};
///
/// # Invariants
///
/// The pointer [`File::ptr`] is non-null and valid. Its reference count is also non-zero.
/// The pointer `File::ptr` is non-null and valid. Its reference count is also non-zero.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can use File.ptr as link.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That works, but the link appears still as "[File.ptr]" i.e. it is still broken because it points to a private field. :-(

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The other day we were discussing whether the invariants should be public or hide them, or whether we wanted to have private fields shown. Not sure what we will do.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Of course. It is private. Maybe say "The inner pointer" as you can't see the ptr field in the docs?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that is another option, definitely.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Of course. It is private. Maybe say "The inner pointer" as you can't see the ptr field in the docs?

That is sort of I what I did for rbtrees: https://github.com/Rust-for-Linux/linux/pull/400/files#diff-0cb585b4b0d3d30535d603fd0ae07753fcd5a180b13d8f9f06164093c4551722R40

@ojeda ojeda merged commit fc4c293 into Rust-for-Linux:rust Jul 2, 2021
@ojeda ojeda deleted the fix-doc-warn branch July 2, 2021 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants