about summary refs log tree commit diff
path: root/src/libstd/sync
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-03-01 01:51:35 -0800
committerbors <bors@rust-lang.org>2014-03-01 01:51:35 -0800
commitd60e43d9e9470107b3c1ebbd5dbd69a6a080f143 (patch)
tree46308c35e0a27a1b52318a0a1b48a9685fa26819 /src/libstd/sync
parentcb498cc40d78f8a9bce42b116abb3f4dd8d03335 (diff)
parenta1749413928cc820326cc194cdabb870b724d301 (diff)
downloadrust-d60e43d9e9470107b3c1ebbd5dbd69a6a080f143.tar.gz
rust-d60e43d9e9470107b3c1ebbd5dbd69a6a080f143.zip
auto merge of #12638 : luqmana/rust/op-no-ref, r=alexcrichton
From my comment on #11450:

The reason for the ICE is because for operators `rustc` does a little bit of magic. Notice that while you implement the `Mul` trait for some type `&T` (i.e a reference to some T), you can simply do `Vec2 {..} * 2.0f32`. That is, `2.0f32` is `f32` and not `&f32`. This works because `rustc` will automatically take a reference. So what's happening is that with `foo * T`, the compiler is expecting the `mul` method to take some `&U` and then it can compare to make sure `T == U` (or more specifically that `T` coerces to `U`). But in this case, the argument of the `mul` method is not a reference and hence the "no ref" error.

I don't think we should ICE in this case since we do catch the mismatched trait/impl method and hence provide a better error message that way.

Fixes #11450
Diffstat (limited to 'src/libstd/sync')
0 files changed, 0 insertions, 0 deletions