Skip to content

Commit c54c013

Browse files
committed
---
yaml --- r: 172542 b: refs/heads/auto c: 02d0a8b h: refs/heads/master v: v3
1 parent 2272130 commit c54c013

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1010
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1111
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1212
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
13-
refs/heads/auto: ad7e33efee023822bd63fa6f942c25582ef12a1e
13+
refs/heads/auto: 02d0a8bbcf0a64339e4279c4ddb4841189ba5069
1414
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1515
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1616
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/src/doc/reference.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2117,6 +2117,13 @@ macro scope.
21172117
destructors from being run twice. Destructors might be run multiple times on
21182118
the same object with this attribute.
21192119
- `doc` - Doc comments such as `/// foo` are equivalent to `#[doc = "foo"]`.
2120+
- `rustc_on_unimplemented` - Write a custom note to be shown along with the error
2121+
when the trait is found to be unimplemented on a type.
2122+
You may use format arguments like `{T}`, `{A}` to correspond to the
2123+
types at the point of use corresponding to the type parameters of the
2124+
trait of the same name. `{Self}` will be replaced with the type that is supposed
2125+
to implement the trait but doesn't. To use this, the `on_unimplemented` feature gate
2126+
must be enabled.
21202127

21212128
### Conditional compilation
21222129

branches/auto/src/test/compile-fail/on-unimplemented-bad-anno.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ trait BadAnnotation1 {}
2929
//~^ ERROR there is no type parameter C on trait BadAnnotation2
3030
trait BadAnnotation2<A,B> {}
3131

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

3336
pub fn main() {
3437
}

0 commit comments

Comments
 (0)