Skip to content
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

Merged
merged 1 commit into from Jul 9, 2014
Merged

Guide: comments #15374

merged 1 commit into from Jul 9, 2014

Conversation

steveklabnik
Copy link
Member

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.

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.
Copy link
Member

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...

Copy link
Member

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.)

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's fair. Do you think this is too detailed a point to put into an introduction?

Copy link
Member

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"?

Copy link
Member Author

Choose a reason for hiding this comment

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

👍

@steveklabnik
Copy link
Member Author

Added in the 'mostly.

bors added a commit that referenced this pull request Jul 9, 2014
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.
@bors bors closed this Jul 9, 2014
@bors bors merged commit 654a19b into rust-lang:master Jul 9, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants