about summary refs log tree commit diff
path: root/tests/rustdoc-js-std/parser-errors.js
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-01-17 12:39:53 +0000
committerbors <bors@rust-lang.org>2023-01-17 12:39:53 +0000
commit492b3deba7527ca4e0b5fbed2551891b905507b8 (patch)
tree244719c55d4d4cdbe11941264632b836d45cd021 /tests/rustdoc-js-std/parser-errors.js
parentfa874627f0adcd5a834b116c7a475b56611317c6 (diff)
parentc53064fb58ac170dbd93b9529d78fc324c1dae9f (diff)
downloadrust-492b3deba7527ca4e0b5fbed2551891b905507b8.tar.gz
rust-492b3deba7527ca4e0b5fbed2551891b905507b8.zip
Auto merge of #13971 - lowr:fix/more-precise-builtin-binop-types, r=Veykril
fix: more precise binop inference

While inferring binary operator expressions, Rust puts some extra constraints on the types of the operands for better inference. Relevant part in rustc is [this](https://github.com/rust-lang/rust/blob/159ba8a92c9e2fa4121f106176309521f4af87e9/compiler/rustc_hir_typeck/src/op.rs#L128-L152).

There are two things we currently fail to consider:
- we should enforce them only when both lhs and rhs type are builtin types that are applicable to the binop
- lhs and rhs types may be single reference to applicable builtin types

This PR basically ports [`enforce_builtin_binop_types()`](https://github.com/rust-lang/rust/blob/159ba8a92c9e2fa4121f106176309521f4af87e9/compiler/rustc_hir_typeck/src/op.rs#L159) and [`is_builtin_binop()`](https://github.com/rust-lang/rust/blob/159ba8a92c9e2fa4121f106176309521f4af87e9/compiler/rustc_hir_typeck/src/op.rs#LL927) to our inference context.
Diffstat (limited to 'tests/rustdoc-js-std/parser-errors.js')
0 files changed, 0 insertions, 0 deletions