Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upTracking issue for `on_unimplemented` feature #29628
Comments
aturon
added
T-lang
B-unstable
labels
Nov 5, 2015
This comment has been minimized.
This comment has been minimized.
|
I think this would be 'private' to rustc. |
This comment has been minimized.
This comment has been minimized.
|
@seanmonstar You may well be right, although it may be a useful feature for tailoring error messages around complicated user-space trait setups as well. |
This comment has been minimized.
This comment has been minimized.
|
As someone creating a library with complicated user-space trait setups, this would be an enormously useful feature. However I did notice an issue while using it, due to blanket impls. When adding this line, I would expect this compile fail test to contain "collections::string::String cannot be used in an expression of type yaqb::types::Serial". However, it doesn't even mention the annotated trait, since due to this blanket impl, it doesn't even mention the annotated trait (and therefore doesn't include my note). Only the one that would satisfy the constraints of that blanket impl. (This is likely another manifestation of #28894). Also worth noting that it's impossible to test these w/ compile-fail at the moment, but that's tangential to this feature. |
This comment has been minimized.
This comment has been minimized.
|
Is it possible to improve the default diagnostics, without an opt-in feature? |
Ms2ger
referenced this issue
May 1, 2017
Open
Tracking: Unstable Rust feature gates used by Servo #5286
This comment has been minimized.
This comment has been minimized.
|
Triage: no real change. apparently servo uses this. |
Mark-Simulacrum
added
the
C-tracking-issue
label
Jul 22, 2017
This comment has been minimized.
This comment has been minimized.
|
Update: I’m moving usage of nice to have but not really required (optimizations, compiler diagnostics like this, …) unstable features in Servo behind an optional Cargo feature flag. |
This comment has been minimized.
This comment has been minimized.
|
I would like to see an RFC for getting custom errors a la https://ghc.haskell.org/trac/ghc/wiki/Proposal/CustomTypeErrors in Rust. |
aturon commentedNov 5, 2015
The
on_unimplementedfeature provides the#[rustc_on_unimplemented]attribute, which allows trait definitions to add specialized notes to error messages when an implementation was expected but not found.