]> git.lizzy.rs Git - rust.git/commitdiff
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)
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

1  2 
src/librustc/traits/select.rs

Simple merge