about summary refs log tree commit diff
path: root/src/libstd/sync
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2015-03-30 14:25:48 +0000
committerbors <bors@rust-lang.org>2015-03-30 14:25:48 +0000
commit9de34a84bb300bab1bf0227f577331620cd60511 (patch)
tree6b1519a5381ecfe0d59e7d9b785c0934e096606d /src/libstd/sync
parent14192d6df5cc714e5c9a3ca70b08f2514d977be2 (diff)
parent7595c25ef93bb18b5f96805daee4d1890f5b6a6b (diff)
downloadrust-9de34a84bb300bab1bf0227f577331620cd60511.tar.gz
rust-9de34a84bb300bab1bf0227f577331620cd60511.zip
Auto merge of #23673 - nikomatsakis:issue-23319-binops-ng-5, r=pnkfelix
The current binary operator code assumed that if the LHS was a scalar (`i32` etc), then the RHS had to match. This is not true with multidispatch. This PR generalizes the existing code to (primarily) use the traits -- this also allows us to defer the precise type-checking when the types aren't fully known. The one caveat is the unstable SIMD types, which don't fit in with the current traits -- in that case, the LHS type must be known to be SIMD ahead of time.

There is one semi-hacky bit in that during writeback, for builtin operators, if the types resolve to scalars (i32 etc) then we clear the method override. This is because we know what the semantics are and it is more efficient to generate the code directly. It also ensures that we can use these overloaded operators in constants and so forth.

cc @japaric
cc @aturon 

Fixes #23319 (and others).
Diffstat (limited to 'src/libstd/sync')
0 files changed, 0 insertions, 0 deletions