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

Update description of rustc_on_unimplemented #76

Merged
merged 1 commit into from
Jul 14, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Update description of rustc_on_unimplemented
Add description of new feature: substitute `{TraitName}` with full path
for the trait.
  • Loading branch information
estebank committed Jul 5, 2017
commit e65e732742127dec3313af7d1fa5ee06914752e7
6 changes: 4 additions & 2 deletions src/attributes.md
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,10 @@ macro scope.
You may use format arguments like `{T}`, `{A}` to correspond to the
types at the point of use corresponding to the type parameters of the
trait of the same name. `{Self}` will be replaced with the type that is supposed
to implement the trait but doesn't. To use this, the `on_unimplemented` feature gate
must be enabled.
to implement the trait but doesn't. You can also use the trait's name which will
be replaced with the full path for the trait, for example for the trait `Foo` in
module `Bar`, `{Foo}` can be used and will show up as `Bar::Foo`.
To use this, the `on_unimplemented` feature gate must be enabled.
- `must_use` - on structs and enums, will warn if a value of this type isn't used or
assigned to a variable. You may also include an optional message by using
`#[must_use = "message"]` which will be given alongside the warning.
Expand Down