Skip to main content

Module tautology

Module tautology 

Source

Re-exportsยง

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; ๐Ÿ”’

Structsยง

Comparison ๐Ÿ”’
Range ๐Ÿ”’

Staticsยง

TYPE_BASED_TAUTOLOGY

Functionsยง

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).

Type Aliasesยง

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).