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

Attributes on functions #387

Merged
merged 2 commits into from
Sep 2, 2018
Merged

Conversation

Havvy
Copy link
Contributor

@Havvy Havvy commented Aug 3, 2018

This is blocked on #381 and #382 for correct links.

  1. The main task of this PR is to show which attributes are allowed on functions.
  2. I renamed the "must_use Attribute" section to must_use to match the "derive" section further on in the page.
  3. Updated links to the cfg attribute to the new conditional compilation page. Probably should have done this when moving cfg to its own page. But doing it here where I'm adding a new link to it.

Copy link
Member

@steveklabnik steveklabnik left a comment

Choose a reason for hiding this comment

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

LGTM, though still blocked

@Havvy Havvy added the New Content Missing features or aspects of language not currently documented. label Aug 20, 2018
@Havvy Havvy requested a review from matthewjasper September 1, 2018 20:09
Copy link
Contributor

@matthewjasper matthewjasper left a comment

Choose a reason for hiding this comment

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

A couple of suggestions, but I'm OK with this as is.


Inner [attributes] on the function's block apply to the function item as a whole.
Functions allow for [outer attributes][attributes] and for [inner
attributes][attributes] where inner attributes are allowed on its [block].
Copy link
Contributor

Choose a reason for hiding this comment

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

Make this two sentences?
"allowed on" => "written inside"?


For example, this function will only be available while running tests.
For example of an inner attribute on a function, this function will only be
available while running tests.
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe this is a result of reading this in raw markdown, but I wasn't expecting a code example after "For example of...". Perhaps "This example shows an ..., the function ..." would be clearer?

@Havvy
Copy link
Contributor Author

Havvy commented Sep 2, 2018

Both are good calls. I've improved the sentence flow around both.

@matthewjasper
Copy link
Contributor

Thanks!

@matthewjasper matthewjasper merged commit a35793c into rust-lang:master Sep 2, 2018
@Havvy Havvy deleted the attr-on-fns branch September 2, 2018 10:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
New Content Missing features or aspects of language not currently documented.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants