File tree Expand file tree Collapse file tree 3 files changed +11
-1
lines changed Expand file tree Collapse file tree 3 files changed +11
-1
lines changed Original file line number Diff line number Diff line change 2
2
refs/heads/master: 170c4399e614fe599c3d41306b3429ca8b3b68c6
3
3
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4
4
refs/heads/snap-stage3: 5b3cd3900ceda838f5798c30ab96ceb41f962534
5
- refs/heads/try: ad7e33efee023822bd63fa6f942c25582ef12a1e
5
+ refs/heads/try: 02d0a8bbcf0a64339e4279c4ddb4841189ba5069
6
6
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
7
7
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
8
8
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
Original file line number Diff line number Diff line change @@ -2117,6 +2117,13 @@ macro scope.
2117
2117
destructors from being run twice. Destructors might be run multiple times on
2118
2118
the same object with this attribute.
2119
2119
- ` 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.
2120
2127
2121
2128
### Conditional compilation
2122
2129
Original file line number Diff line number Diff line change @@ -29,6 +29,9 @@ trait BadAnnotation1 {}
29
29
//~^ ERROR there is no type parameter C on trait BadAnnotation2
30
30
trait BadAnnotation2 < A , B > { }
31
31
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 > { }
32
35
33
36
pub fn main ( ) {
34
37
}
You can’t perform that action at this time.
0 commit comments