diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-02-14 14:50:49 +1100 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-02-15 09:35:11 +1100 |
| commit | d2aa1beed775e09a7f79f3a7761feece92572bf1 (patch) | |
| tree | 1b074777b936eeda6f425adfb24b687e54109fcc | |
| parent | b3b9f31a869326bcd623c84fd230777f397847f3 (diff) | |
| download | rust-d2aa1beed775e09a7f79f3a7761feece92572bf1.tar.gz rust-d2aa1beed775e09a7f79f3a7761feece92572bf1.zip | |
Add an `ErrorGuaranteed` to `ast::TyKind::Err`.
This makes it more like `hir::TyKind::Err`, and avoids a `span_delayed_bug` call in `LoweringContext::lower_ty_direct`. It also requires adding `ast::TyKind::Dummy`, now that `ast::TyKind::Err` can't be used for that purpose in the absence of an error emission. There are a couple of cases that aren't as neat as I would have liked, marked with `FIXME` comments.
| -rw-r--r-- | clippy_utils/src/ast_utils.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clippy_utils/src/ast_utils.rs b/clippy_utils/src/ast_utils.rs index adc35bd82ae..0467a8a6570 100644 --- a/clippy_utils/src/ast_utils.rs +++ b/clippy_utils/src/ast_utils.rs @@ -690,7 +690,7 @@ pub fn eq_ty(l: &Ty, r: &Ty) -> bool { match (&l.kind, &r.kind) { (Paren(l), _) => eq_ty(l, r), (_, Paren(r)) => eq_ty(l, r), - (Never, Never) | (Infer, Infer) | (ImplicitSelf, ImplicitSelf) | (Err, Err) | (CVarArgs, CVarArgs) => true, + (Never, Never) | (Infer, Infer) | (ImplicitSelf, ImplicitSelf) | (Err(_), Err(_)) | (CVarArgs, CVarArgs) => true, (Slice(l), Slice(r)) => eq_ty(l, r), (Array(le, ls), Array(re, rs)) => eq_ty(le, re) && eq_expr(&ls.value, &rs.value), (Ptr(l), Ptr(r)) => l.mutbl == r.mutbl && eq_ty(&l.ty, &r.ty), |
