-
Notifications
You must be signed in to change notification settings - Fork 69
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
Add missing docs for the vm module #1021
Conversation
src/vm/object_model.rs
Outdated
pub struct $spec_name(MetadataSpec); | ||
impl $spec_name { | ||
#[doc="The number of bits (in log2) that are needed for the spec."] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since /// xxxx
is a syntax sugar for #[doc="xxxx"]
at the language level, we can simply use ///
in macro expansion, too. You can verify whether it produces documentation by executing cargo doc
.
See: https://doc.rust-lang.org/reference/comments.html#doc-comments
#[doc="The number of bits (in log2) that are needed for the spec."] | |
/// The number of bits (in log2) that are needed for the spec. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah. It works fine. I have changed most #[doc]
to ///
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This PR is a step towards #309.
HeaderMetadata.bit_offset
(related discussion: https://mmtk.zulipchat.com/#narrow/stream/315620-Porting/topic/ScalaNative.2FMMTK/near/398587245).define_vm_metadata_spec!
to allow adding docs for the generated types.vm
module.Please feel free to make edits to the PR if there is any issue.