Skip to main content Module tautology Copy item path Source use super::TypeBasedTautology ; ๐ use crate::linter::LateLintPass ; ๐ use crate::linter::LintContext ; ๐ use crate::sol::Severity ; ๐ use crate::sol::SolLint ; ๐ use crate::sol::analysis::cast_type ; ๐ use alloy_primitives::U256; ๐ use solar::ast::BinOpKind; ๐ use solar::ast::LitKind; ๐ use solar::ast::UnOpKind; ๐ use solar::sema::Gcx; ๐ use solar::sema::hir::ElementaryType; ๐ use solar::sema::hir::Expr; ๐ use solar::sema::hir::ExprKind; ๐ use solar::sema::hir::VariableId; ๐ use solar::sema::ty::TyKind; ๐ use std::cmp::Ordering ; ๐ Comparison ๐ Range ๐ TYPE_BASED_TAUTOLOGY cmp ๐ comparison_of ๐ A comparison of one resolved integer variable (possibly cast) against a constant. comparison_operand_of ๐ The variable an operand compares, the casts applied to it and the range its values span. elem_type_of ๐ The elementary type selected by the type checker. integer_bounds ๐ is_boundary_composition ๐ True when two comparisons over the same operand together cover its whole range. is_tautology ๐ True if x <op> val has the same truth value for every x in range. lit_value_of ๐ A numeric literal or negated numeric literal. split_comparison ๐ A relational/equality comparison between an operand and a constant, normalized to
operand <op> const (the operator is flipped when the constant is on the left). Const ๐ A signed integer constant as (is_negative, magnitude), matching how solar stores negated
literals (-128 is Unary(Neg, Lit(128))). Zero is always (false, 0).