mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 22:01:37 +00:00
collapsible_if
This commit is contained in:
parent
3409645c3f
commit
b5eca5f2fc
7 changed files with 47 additions and 51 deletions
|
@ -1842,10 +1842,10 @@ impl Evaluator<'_> {
|
|||
}
|
||||
}
|
||||
let layout = self.layout(ty);
|
||||
if self.assert_placeholder_ty_is_unused {
|
||||
if matches!(layout, Err(MirEvalError::LayoutError(LayoutError::HasPlaceholder, _))) {
|
||||
return Ok(Some((0, 1)));
|
||||
}
|
||||
if self.assert_placeholder_ty_is_unused
|
||||
&& matches!(layout, Err(MirEvalError::LayoutError(LayoutError::HasPlaceholder, _)))
|
||||
{
|
||||
return Ok(Some((0, 1)));
|
||||
}
|
||||
let layout = layout?;
|
||||
Ok(layout
|
||||
|
|
|
@ -948,10 +948,11 @@ impl<'ctx> MirLowerCtx<'ctx> {
|
|||
// for binary operator, and use without adjust to simplify our conditions.
|
||||
let lhs_ty = self.expr_ty_without_adjust(*lhs);
|
||||
let rhs_ty = self.expr_ty_without_adjust(*rhs);
|
||||
if matches!(op, BinaryOp::CmpOp(syntax::ast::CmpOp::Eq { .. })) {
|
||||
if lhs_ty.as_raw_ptr().is_some() && rhs_ty.as_raw_ptr().is_some() {
|
||||
break 'b true;
|
||||
}
|
||||
if matches!(op, BinaryOp::CmpOp(syntax::ast::CmpOp::Eq { .. }))
|
||||
&& lhs_ty.as_raw_ptr().is_some()
|
||||
&& rhs_ty.as_raw_ptr().is_some()
|
||||
{
|
||||
break 'b true;
|
||||
}
|
||||
let builtin_inequal_impls = matches!(
|
||||
op,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue