diff options
author | Philip Herron <philip.herron@embecosm.com> | 2021-11-15 18:31:38 +0000 |
---|---|---|
committer | Philip Herron <philip.herron@embecosm.com> | 2021-11-16 15:10:48 +0000 |
commit | 6d1333ef46cba6ed9e1ace817f9cc649b7f7a1df (patch) | |
tree | 55051cad7f474f411d79ca1e86cc23d63138716d | |
parent | 04a49acfa3caa7a85a1a9edd24d69da0ad575ad5 (diff) | |
download | gcc-6d1333ef46cba6ed9e1ace817f9cc649b7f7a1df.zip gcc-6d1333ef46cba6ed9e1ace817f9cc649b7f7a1df.tar.gz gcc-6d1333ef46cba6ed9e1ace817f9cc649b7f7a1df.tar.bz2 |
LazyBooleanExpr does not need a nullptr check
-rw-r--r-- | gcc/rust/typecheck/rust-hir-type-check-expr.h | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/gcc/rust/typecheck/rust-hir-type-check-expr.h b/gcc/rust/typecheck/rust-hir-type-check-expr.h index 642bde2..99696ae 100644 --- a/gcc/rust/typecheck/rust-hir-type-check-expr.h +++ b/gcc/rust/typecheck/rust-hir-type-check-expr.h @@ -774,17 +774,15 @@ public: // we expect the lhs and rhs must be bools at this point TyTy::BoolType elhs (expr.get_mappings ().get_hirid ()); lhs = elhs.unify (lhs); - if (lhs == nullptr || lhs->get_kind () == TyTy::TypeKind::ERROR) + if (lhs->get_kind () == TyTy::TypeKind::ERROR) return; TyTy::BoolType rlhs (expr.get_mappings ().get_hirid ()); rhs = elhs.unify (rhs); - if (lhs == nullptr || lhs->get_kind () == TyTy::TypeKind::ERROR) + if (lhs->get_kind () == TyTy::TypeKind::ERROR) return; infered = lhs->unify (rhs); - infered->append_reference (lhs->get_ref ()); - infered->append_reference (rhs->get_ref ()); } void visit (HIR::NegationExpr &expr) override |