Skip to content

Commit d2aa1be

Browse files
committed
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.
1 parent b3b9f31 commit d2aa1be

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clippy_utils/src/ast_utils.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -690,7 +690,7 @@ pub fn eq_ty(l: &Ty, r: &Ty) -> bool {
690690
match (&l.kind, &r.kind) {
691691
(Paren(l), _) => eq_ty(l, r),
692692
(_, Paren(r)) => eq_ty(l, r),
693-
(Never, Never) | (Infer, Infer) | (ImplicitSelf, ImplicitSelf) | (Err, Err) | (CVarArgs, CVarArgs) => true,
693+
(Never, Never) | (Infer, Infer) | (ImplicitSelf, ImplicitSelf) | (Err(_), Err(_)) | (CVarArgs, CVarArgs) => true,
694694
(Slice(l), Slice(r)) => eq_ty(l, r),
695695
(Array(le, ls), Array(re, rs)) => eq_ty(le, re) && eq_expr(&ls.value, &rs.value),
696696
(Ptr(l), Ptr(r)) => l.mutbl == r.mutbl && eq_ty(&l.ty, &r.ty),

0 commit comments

Comments
 (0)