diff options
| author | teymour-aldridge <teymour.aldridge@icloud.com> | 2021-04-18 20:38:23 +0100 |
|---|---|---|
| committer | teymour-aldridge <teymour.aldridge@icloud.com> | 2021-04-18 20:38:23 +0100 |
| commit | 567de4a20268432d8ea27befea3091af9ba38fcd (patch) | |
| tree | e7871c5fce0c894182e40fe84fc9ff3259a2acc4 /compiler | |
| parent | d7c338641466d54bf8d4b2eae5d6865483e1d3f4 (diff) | |
| download | rust-567de4a20268432d8ea27befea3091af9ba38fcd.tar.gz rust-567de4a20268432d8ea27befea3091af9ba38fcd.zip | |
Improve an error message.
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs b/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs index 15a3d3ddd8d..c3bb3fffb82 100644 --- a/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs +++ b/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs @@ -503,14 +503,14 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> { let unit_obligation = obligation.with(predicate.without_const().to_predicate(tcx)); if self.predicate_may_hold(&unit_obligation) { + err.note("this trait is implemented for `()`."); err.note( - "the trait is implemented for `()`. \ - Possibly this error has been caused by changes to \ - Rust's type-inference algorithm (see issue #48950 \ - <https://github.com/rust-lang/rust/issues/48950> \ - for more information). Consider whether you meant to use \ - the type `()` here instead.", + "this error might have been caused by changes to \ + Rust's type-inference algorithm (see issue #48950 \ + <https://github.com/rust-lang/rust/issues/48950> \ + for more information).", ); + err.help("did you intend to use the type `()` here instead?"); } } |
