# \[Pre-RFC\] Improved compiler diagnostics

**URL:** <https://internals.rust-lang.org/t/pre-rfc-improved-compiler-diagnostics/2304>\
**Category:** internals\
**Created:** [June 28, 2015, 8:23am UTC](https://internals.rust-lang.org/t/pre-rfc-improved-compiler-diagnostics/2304 "2015-06-28T08:23:08Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![llogiq](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/llogiq/32/13692_2.png) [@llogiq](https://internals.rust-lang.org/u/llogiq)\
**Post date:** [June 28, 2015, 8:23am UTC](https://internals.rust-lang.org/t/pre-rfc-improved-compiler-diagnostics/2304/1 "2015-06-28T08:23:08Z")

</div>

A big problem, especially for newcomers, is missing trait impls. While rustc’s error messages are usually very helpful, the messages about missing trait impls are precise but fail to give actionable suggestions on how to best rectify the issue – which of course is impossible in the general case.

However, for many types, there _is_ a known standard way to get a specific trait, and the type could be equipped with meta-information that may be used to augment the error messages.

Imagine having a ReadOnlyFile type with a `#[suggest(missing="Write" msg="To get a writeable file, use _.writeable() on the File object right after creation.")] attribute, whose`msg` would show up in the error message.

What do you folks think? What other situations could warrant specialized suggestions based on meta-information?

---

<div class="post-metadata">

**Author:** ![Manishearth](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/manishearth/32/50_2.png) [@Manishearth](https://internals.rust-lang.org/u/Manishearth)\
**Post date:** [June 28, 2015, 12:12pm UTC](https://internals.rust-lang.org/t/pre-rfc-improved-compiler-diagnostics/2304/2 "2015-06-28T12:12:05Z")

</div>

Don’t we already have [https://github.com/rust-lang/rust/pull/20889](https://github.com/rust-lang/rust/pull/20889)?

A more general version of that would be nice though.

---

<div class="post-metadata">

**Author:** ![llogiq](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/llogiq/32/13692_2.png) [@llogiq](https://internals.rust-lang.org/u/llogiq)\
**Post date:** [June 28, 2015, 5:15pm UTC](https://internals.rust-lang.org/t/pre-rfc-improved-compiler-diagnostics/2304/3 "2015-06-28T17:15:24Z")

</div>

Ah, I had missed that. This feature appears to be underused and perhaps under-advertised.

---

<div class="post-metadata">

**Author:** ![llogiq](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/llogiq/32/13692_2.png) [@llogiq](https://internals.rust-lang.org/u/llogiq)\
**Post date:** [March 25, 2019, 8:24am UTC](https://internals.rust-lang.org/t/pre-rfc-improved-compiler-diagnostics/2304/4 "2019-03-25T08:24:46Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
