]> git.lizzy.rs Git - rust.git/commit
Auto merge of #43880 - arielb1:noninvasive-probe, r=nikomatsakis
authorbors <bors@rust-lang.org>
Wed, 30 Aug 2017 05:30:28 +0000 (05:30 +0000)
committerbors <bors@rust-lang.org>
Wed, 30 Aug 2017 05:30:28 +0000 (05:30 +0000)
commitb58e31ac03d3f338385593496426534ad5a150a7
tree6f5e3876d4d80f3ce558e7d73f5f1296d48d901a
parentc2f9cc4a3bf8917e6cd9f31e3a2e9baa8c15e8f1
parent15f6540ec02a6e1c556f0a915c494d8a45ea9338
Auto merge of #43880 - arielb1:noninvasive-probe, r=nikomatsakis

Remove the trait selection impl in method::probe

This removes the hacky trait selection reimplementation in `method::probe`, which occasionally comes and causes problems.

There are 2 issues I've found with this approach:
1. The older implementation sometimes had a "guess" type from an impl, which allowed subtyping to work. This is why I needed to make a change in `libtest`: there's an `impl<A> Clone for fn(A)` and we're calling `<for<'a> fn(&'a T) as Clone>::clone`. The older implementation would do a subtyping between the impl type and the trait type, so it would do the check for `<fn(A) as Clone>::clone`, and confirmation would continue with the subtyping. The newer implementation directly passes `<for<'a> fn(&'a T) as Clone>::clone` to selection, which fails. I'm not sure how big of a problem that would be in reality, especially after #43690 would remove the `Clone` problem, but I still want a crater run to avoid breaking the world.
2. The older implementation "looked into" impls to display error messages. I'm not sure that's an advantage - it looked exactly 1 level deep.

r? @eddyb
src/librustc/traits/select.rs