Skip to content

Commit cd64ff9

Browse files
committed
rustc_typeck: fix binops needing more type informations to coerce.
1 parent 3725cab commit cd64ff9

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/librustc_typeck/check/op.rs

+2
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,8 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
411411
match method {
412412
Some(ok) => {
413413
let method = self.register_infer_ok_obligations(ok);
414+
self.select_obligations_where_possible();
415+
414416
let method_ty = method.ty;
415417

416418
// HACK(eddyb) Fully qualified path to work around a resolve bug.

src/test/run-pass/coerce-overloaded-autoderef.rs

+4
Original file line numberDiff line numberDiff line change
@@ -68,4 +68,8 @@ fn use_vec_ref(v: &Vec<u8>) {
6868
use_slice(&&&mut &&&v);
6969
}
7070

71+
fn use_op_rhs(s: &mut String) {
72+
*s += {&String::from(" ")};
73+
}
74+
7175
pub fn main() {}

0 commit comments

Comments
 (0)