Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Manishearth committed Jan 11, 2015
1 parent ad7e33e commit 02d0a8b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/doc/reference.md
Expand Up @@ -2117,6 +2117,13 @@ macro scope.
destructors from being run twice. Destructors might be run multiple times on
the same object with this attribute.
- `doc` - Doc comments such as `/// foo` are equivalent to `#[doc = "foo"]`.
- `rustc_on_unimplemented` - Write a custom note to be shown along with the error
when the trait is found to be unimplemented on a type.
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.

### Conditional compilation

Expand Down
3 changes: 3 additions & 0 deletions src/test/compile-fail/on-unimplemented-bad-anno.rs
Expand Up @@ -29,6 +29,9 @@ trait BadAnnotation1 {}
//~^ ERROR there is no type parameter C on trait BadAnnotation2
trait BadAnnotation2<A,B> {}

#[rustc_on_unimplemented = "Unimplemented trait error on `{Self}` with params `<{A},{B},{}>`"]
//~^ only named substitution parameters are allowed
trait BadAnnotation3<A,B> {}

pub fn main() {
}

7 comments on commit 02d0a8b

@bors
Copy link
Contributor

@bors bors commented on 02d0a8b Jan 12, 2015

Choose a reason for hiding this comment

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

saw approval from nikomatsakis
at Manishearth@02d0a8b

@bors
Copy link
Contributor

@bors bors commented on 02d0a8b Jan 12, 2015

Choose a reason for hiding this comment

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

merging Manishearth/rust/trait-error = 02d0a8b into auto

@bors
Copy link
Contributor

@bors bors commented on 02d0a8b Jan 12, 2015

Choose a reason for hiding this comment

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

status: {"merge_sha": "0aec4db1c09574da2f30e3844de6d252d79d4939"}

@bors
Copy link
Contributor

@bors bors commented on 02d0a8b Jan 12, 2015

Choose a reason for hiding this comment

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

Manishearth/rust/trait-error = 02d0a8b merged ok, testing candidate = 0aec4db

@bors
Copy link
Contributor

@bors bors commented on 02d0a8b Jan 12, 2015

Choose a reason for hiding this comment

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

fast-forwarding master to auto = 0aec4db

@bors
Copy link
Contributor

@bors bors commented on 02d0a8b Jan 12, 2015

Choose a reason for hiding this comment

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

fast-forwarding master to auto = 0aec4db

Please sign in to comment.