]> git.lizzy.rs Git - rust.git/commit
try to recover the non-matching types in projection errors
authorAriel Ben-Yehuda <ariel.byd@gmail.com>
Wed, 20 Jul 2016 23:13:14 +0000 (02:13 +0300)
committerAriel Ben-Yehuda <ariel.byd@gmail.com>
Fri, 22 Jul 2016 11:32:56 +0000 (14:32 +0300)
commitf3ee99bd4d9d282c33127449073c521f29b07c21
tree5628ddb3c510048143500c5228f93e3cb64c3e82
parent712c5cadbbb460a0b313a2fbcdaa9d6e10a25b6b
try to recover the non-matching types in projection errors

The type equation in projection takes place under a binder and a snapshot, which
we can't easily take types out of. Instead, when encountering a projection error,
try to re-do the projection and find the type error then.

This fails to produce a sane type error when the failure was a "leak_check" failure.
I can't think of a sane way to show *these*, so I just left them use the old crappy
representation, and added a test to make sure we don't break them.
src/librustc/traits/error_reporting.rs
src/test/compile-fail/associated-types/higher-ranked-projection.rs [new file with mode: 0644]
src/test/compile-fail/issue-31173.rs