]> git.lizzy.rs Git - rust.git/commit
auto merge of #18121 : nikomatsakis/rust/method-call-use-trait-matching-infrastructur...
authorbors <bors@rust-lang.org>
Wed, 22 Oct 2014 00:22:04 +0000 (00:22 +0000)
committerbors <bors@rust-lang.org>
Wed, 22 Oct 2014 00:22:04 +0000 (00:22 +0000)
commit3d2cf60631502567007ea652f8ef299d907ee2c3
tree7a65e1e976689d56faaa783ae54218cdf4ebffa4
parent2130f2221600f03129df95f3611444468806b237
parentb066d09be8454d735972e056d6b978cf48a85009
auto merge of #18121 : nikomatsakis/rust/method-call-use-trait-matching-infrastructure-2, r=pcwalton

Convert trait method dispatch to use new trait matching machinery.

This fixes about 90% of #17918. What remains to be done is to make inherent dispatch work with conditional dispatch as well. I plan to do this in a future patch by generalizing the "method match" code slightly to work for inherent impls as well (the basic algorithm is precisely the same).

Fixes #17178.

This is a [breaking-change] for two reasons:

1. The old code was a bit broken. I found various minor cases, particularly around operators, where the old code incorrectly matched, but an extra `*` or other change is now required. (See commit e8cef25 ("Correct case where the old version of method lookup...") for examples.)
2. The old code didn't type check calls against the method signature from the *trait* but rather the *impl*. The two can be different in subtle ways. This makes the new method dispatch both more liberal and more conservative than the original. (See commit 8308332 ("The new method lookup mechanism typechecks...") for examples.)

r? @pcwalton since he's been reviewing most of this series of changes
f? @nick29581 for commit 39df55f ("Permit DST types to unify like other types")
cc @aturon as this relates to library stabilization