diff options
| author | bors <bors@rust-lang.org> | 2014-11-05 22:31:44 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-11-05 22:31:44 +0000 |
| commit | 63c4f22f2bf9f1c070311cdc08c6ceb279434733 (patch) | |
| tree | 7815bb12ca160450170b49198e111f71f6818f2e /src/libsyntax/diagnostics/plugin.rs | |
| parent | 5c1fd5f8b7351085765217b198c6d5a8c0026b74 (diff) | |
| parent | 81c00e66f564ca67c391a5f24f2ad43189245d75 (diff) | |
| download | rust-63c4f22f2bf9f1c070311cdc08c6ceb279434733.tar.gz rust-63c4f22f2bf9f1c070311cdc08c6ceb279434733.zip | |
auto merge of #18486 : nikomatsakis/rust/operator-dispatch, r=pcwalton
This branch cleans up overloaded operator resolution so that it is strictly based on the traits in `ops`, rather than going through the normal method lookup mechanism. It also adds full support for autoderef to overloaded index (whereas before autoderef only worked for non-overloaded index) as well as for the slicing operators. This is a [breaking-change]: in the past, we were accepting combinations of operands that were not intended to be accepted. For example, it was possible to compare a fixed-length array and a slice, or apply the `!` operator to a `&int`. See the first two commits in this pull-request for examples. One downside of this change is that comparing fixed-length arrays doesn't always work as smoothly as it did before. Before this, comparisons sometimes worked due to various coercions to slices. I've added impls for `Eq`, `Ord`, etc for fixed-lengths arrays up to and including length 32, but if the array is longer than that you'll need to either newtype the array or convert to slices. Note that this plays better with deriving in any case than the previous scheme. Fixes #4920. Fixes #16821. Fixes #15757. cc @alexcrichton cc @aturon
Diffstat (limited to 'src/libsyntax/diagnostics/plugin.rs')
0 files changed, 0 insertions, 0 deletions
