mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 06:11:35 +00:00
Add TyBuilder::unit() and TyExt::is_unit()
This commit is contained in:
parent
b15152c430
commit
b0fe3d929f
7 changed files with 39 additions and 25 deletions
|
@ -15,7 +15,7 @@ use crate::{
|
|||
MissingPatFields, RemoveThisSemicolon,
|
||||
},
|
||||
utils::variant_data,
|
||||
AdtId, InferenceResult, Interner, Ty, TyKind,
|
||||
AdtId, InferenceResult, Interner, TyExt, TyKind,
|
||||
};
|
||||
|
||||
pub(crate) use hir_def::{
|
||||
|
@ -423,7 +423,7 @@ impl<'a, 'b> ExprValidator<'a, 'b> {
|
|||
None => return,
|
||||
};
|
||||
|
||||
if mismatch.actual != Ty::unit() || mismatch.expected != *possible_tail_ty {
|
||||
if !mismatch.actual.is_unit() || mismatch.expected != *possible_tail_ty {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue