Skip to main content

Module literal_instead_of_constant

Module literal_instead_of_constant 

Source

Re-exportsยง

use super::LiteralInsteadOfConstant; ๐Ÿ”’
use crate::linter::LateLintPass; ๐Ÿ”’
use crate::linter::LintContext; ๐Ÿ”’
use crate::sol::Severity; ๐Ÿ”’
use crate::sol::SolLint; ๐Ÿ”’
use alloy_primitives::Address; ๐Ÿ”’
use alloy_primitives::U256; ๐Ÿ”’
use solar::ast::LitKind; ๐Ÿ”’
use solar::ast::StrKind; ๐Ÿ”’
use solar::ast::UnOpKind; ๐Ÿ”’
use solar::interface::Span; ๐Ÿ”’
use solar::sema::Gcx; ๐Ÿ”’
use solar::sema::hir; ๐Ÿ”’
use solar::sema::hir::Expr; ๐Ÿ”’
use solar::sema::hir::ExprKind; ๐Ÿ”’
use solar::sema::hir::Hir; ๐Ÿ”’
use solar::sema::hir::Lit; ๐Ÿ”’
use solar::sema::hir::Stmt; ๐Ÿ”’
use solar::sema::hir::StmtKind; ๐Ÿ”’
use solar::sema::hir::Visit; ๐Ÿ”’
use solar::sema::ty::TyKind; ๐Ÿ”’
use std::collections::HashMap; ๐Ÿ”’
use std::convert::Infallible; ๐Ÿ”’
use std::ops::ControlFlow; ๐Ÿ”’

Structsยง

LiteralCollector ๐Ÿ”’
Collects the grouping-relevant literals of a subtree: numbers above 2, address literals and hex string literals. A bare literal indexing an array-like value or bounding a slice stays out as positional, matching Aderyn; a mapping key counts, it is configuration data.

Enumsยง

LiteralValue ๐Ÿ”’
The semantic value of a literal, the grouping key: two spellings of the same number (100, 0x64, 1e2) or the same unit-scaled amount (1 ether, 1e18) are one value. A numeric literal under a value-changing unary operator denotes a DISTINCT constant, so -5 and ~5 never group with the bare 5.

Staticsยง

LITERAL_INSTEAD_OF_CONSTANT

Functionsยง

is_lit ๐Ÿ”’