]> git.lizzy.rs Git - rust.git/commitdiff
rustc_typeck: fix binops needing more type informations to coerce.
authorEduard-Mihai Burtescu <edy.burt@gmail.com>
Sun, 16 Apr 2017 03:25:18 +0000 (06:25 +0300)
committerEduard-Mihai Burtescu <edy.burt@gmail.com>
Sun, 16 Apr 2017 03:25:18 +0000 (06:25 +0300)
src/librustc_typeck/check/op.rs
src/test/run-pass/coerce-overloaded-autoderef.rs

index 5b174aaf8953b34d9a1c0d77f85f0617e8054fb7..42296006b79d189c834ab26eb1f019042db97b84 100644 (file)
@@ -411,6 +411,8 @@ fn lookup_op_method(&self,
         match method {
             Some(ok) => {
                 let method = self.register_infer_ok_obligations(ok);
+                self.select_obligations_where_possible();
+
                 let method_ty = method.ty;
 
                 // HACK(eddyb) Fully qualified path to work around a resolve bug.
index a053311a0403e43bf1a3c9a056a51e739270f963..091e29dd18a6b68a70c0c74a67625adf6a57c70d 100644 (file)
@@ -68,4 +68,8 @@ fn use_vec_ref(v: &Vec<u8>) {
     use_slice(&&&mut &&&v);
 }
 
+fn use_op_rhs(s: &mut String) {
+    *s += {&String::from(" ")};
+}
+
 pub fn main() {}