mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 12:54:58 +00:00
Add Expr::Underscore
This commit is contained in:
parent
e10799536a
commit
c1c867506b
3 changed files with 9 additions and 1 deletions
|
@ -775,6 +775,12 @@ impl<'a> InferenceContext<'a> {
|
|||
},
|
||||
},
|
||||
Expr::MacroStmts { tail } => self.infer_expr_inner(*tail, expected),
|
||||
Expr::Underscore => {
|
||||
// Underscore expressions may only appear in assignee expressions,
|
||||
// which are handled by `infer_assignee_expr()`, so any underscore
|
||||
// expression reaching this branch is an error.
|
||||
self.err_ty()
|
||||
}
|
||||
};
|
||||
// use a new type variable if we got unknown here
|
||||
let ty = self.insert_type_vars_shallow(ty);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue