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
Guide: comments #15374
Guide: comments #15374
Conversation
| return | ||
| Now that we have some functions, it's a good idea to learn about comments. | ||
| Comments are notes that you leave to other programmers to help explain things | ||
| about your code. The compiler ignores them. |
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.
It doesn't ignore doc comments entirely...
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.
(e.g. it can and will complain about
fn foo() {
let a = 0u;
/// descriptive comment
let b = 1u;
}because doc comments can only be attached to items.)
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.
That's fair. Do you think this is too detailed a point to put into an introduction?
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.
"the compiler mostly ignores them"?
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.
|
Added in the 'mostly. |
I'm leaving off `rustdoc` usage because it won't work unless this is a `pub fn`, and I want to talk about public/private in the context of modules. I'm also not mentioning `//!` because it is exclusively used to provide the overview of a module.
I'm leaving off
rustdocusage because it won't work unless this is apub fn, and I want to talk about public/private in the context of modules. I'm also not mentioning//!because it is exclusively used to provide the overview of a module.