Skip to content

Commit 3292716

Browse files
committed
---
yaml --- r: 182015 b: refs/heads/beta c: 02d0a8b h: refs/heads/master i: 182013: e6b6376 182011: 1f5b0d2 182007: 91ffe4b 181999: 3238af2 181983: e89ed66 181951: 24b0a5b 181887: 578dd2b 181759: ca5d770 v: v3
1 parent f90c3b0 commit 3292716

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
@@ -31,7 +31,7 @@ refs/heads/automation-fail: 1bf06495443584539b958873e04cc2f864ab10e4
3131
refs/heads/issue-18208-method-dispatch-3-quick-reject: 2009f85b9f99dedcec4404418eda9ddba90258a2
3232
refs/heads/batch: b7fd822592a4fb577552d93010c4a4e14f314346
3333
refs/heads/building: 126db549b038c84269a1e4fe46f051b2c15d6970
34-
refs/heads/beta: ad7e33efee023822bd63fa6f942c25582ef12a1e
34+
refs/heads/beta: 02d0a8bbcf0a64339e4279c4ddb4841189ba5069
3535
refs/heads/windistfix: 7608dbad651f02e837ed05eef3d74a6662a6e928
3636
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
3737
refs/heads/tmp: eb836bf767aa1d8d4cba488a9091cde3c0ab4b2f

branches/beta/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/beta/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)