]> git.lizzy.rs Git - rust.git/commit
Make use of a binary operator's RHS type for LHS inference
authorEdward Wang <edward.yu.wang@gmail.com>
Sat, 31 Jan 2015 18:49:12 +0000 (02:49 +0800)
committerEdward Wang <edward.yu.wang@gmail.com>
Sat, 31 Jan 2015 20:06:06 +0000 (04:06 +0800)
commit1935bbd91321b4ebb61b21a300f43234a0be6433
treecc5c68966939f30f9de76ae5a77d453fcb9318c1
parent474b324eda10440d6568ef872a7307d38e7de95b
Make use of a binary operator's RHS type for LHS inference

For "symmetric" binary operators, meaning the types of two side must be
equal, if the type of LHS doesn't know yet but RHS does, use that as an
hint to infer LHS' type.

Closes #21634
src/librustc_typeck/check/mod.rs
src/libsyntax/ast_util.rs
src/test/run-pass/issue-21634.rs [new file with mode: 0644]