Add ability to attach custom #[on_unimplemented] error messages for unimplemented traits#20889
Add ability to attach custom #[on_unimplemented] error messages for unimplemented traits#20889bors merged 7 commits intorust-lang:masterfrom
Conversation
|
👯 |
6665642 to
6f0419f
Compare
|
Awesome :] This should be very useful. |
6f0419f to
6cde8cf
Compare
|
Cool! |
|
looks better now, I think we should have an @nikomatsakis your call now :) |
There was a problem hiding this comment.
This pair of nested matchs can be if let Some(ref i) = item.value_str() { ... }.
|
Yay! I wonder if we need to have a definition-site verification as well as the use-site behaviour, as it stands one will only get validation that the E.g. AFAICT, this will compile fine in isolation #[on_unimplemented = "foo {X}, {Y}, {unclosed"]
pub trait Foo {} |
6cde8cf to
c671926
Compare
|
@huonw fixed the other issues |
c671926 to
de683c4
Compare
|
It's great to see this! But I think the error message should still mention the specific trait ( |
|
@P1start It is done manually, a |
|
Oh, wait, I see, you want a placeholder for the trait name. I guess that can be done manually (or I can add a |
…nimplemented traits (fixes rust-lang#20783)
82295a3 to
dc0de42
Compare
|
@huon I made it a note, and added a lint/test. |
There was a problem hiding this comment.
This is probably best run after the main error message, just in case the span_errs inside it are triggered, so that the output has a slightly more sensible order.
f0e6e8d to
ad7e33e
Compare
There was a problem hiding this comment.
Maybe add a test with an illegal thing, like {}?
2f5767f to
02d0a8b
Compare
Heuristic sensing parenthesis completion of fields
fixes #20783
r? @nikomatsakis