mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-26 11:59:49 +00:00
Implement type inference for more binary operators
Mostly just for primitive numeric types such as u32 and f64. Not yet a general solution using trait resolution.
This commit is contained in:
parent
3238c06a5a
commit
7b0eaef580
4 changed files with 84 additions and 49 deletions
|
@ -549,7 +549,7 @@ pub enum BinOp {
|
|||
/// The `&=` operator for assignment after bitwise AND
|
||||
BitAndAssign,
|
||||
/// The `^=` operator for assignment after bitwise XOR
|
||||
BitXorAssin,
|
||||
BitXorAssign,
|
||||
}
|
||||
|
||||
impl<'a> BinExpr<'a> {
|
||||
|
@ -586,7 +586,7 @@ impl<'a> BinExpr<'a> {
|
|||
MINUSEQ => Some(BinOp::SubAssign),
|
||||
PIPEEQ => Some(BinOp::BitOrAssign),
|
||||
AMPEQ => Some(BinOp::BitAndAssign),
|
||||
CARETEQ => Some(BinOp::BitXorAssin),
|
||||
CARETEQ => Some(BinOp::BitXorAssign),
|
||||
_ => None,
|
||||
})
|
||||
.next()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue