repo
stringlengths
6
65
file_url
stringlengths
81
311
file_path
stringlengths
6
227
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 15:31:58
2026-01-04 20:25:31
truncated
bool
2 classes
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/asm_lang/allocated_ops.rs
sway-core/src/asm_lang/allocated_ops.rs
//! This module contains abstracted versions of bytecode primitives that the compiler uses to //! ensure correctness and safety. //! //! These ops are different from [VirtualOp]s in that they contain allocated registers, i.e. at //! most 48 free registers plus reserved registers. These ops can be safely directly conver...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
true
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/asm_lang/mod.rs
sway-core/src/asm_lang/mod.rs
//! This module contains things that I need from the VM to build that we will eventually import //! from the VM when it is ready. //! Basically this is copy-pasted until things are public and it can be properly imported. //! //! Only things needed for opcode serialization and generation are included here. #![allow(dead...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
true
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/asm_lang/virtual_register.rs
sway-core/src/asm_lang/virtual_register.rs
use crate::fuel_prelude::fuel_asm; use std::fmt; /// Represents virtual registers that have yet to be allocated. /// Note that only the Virtual variant will be allocated, and the Constant variant refers to /// reserved registers. #[derive(Hash, PartialEq, Eq, PartialOrd, Ord, Debug, Clone)] pub enum VirtualRegister { ...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/language/visibility.rs
sway-core/src/language/visibility.rs
use serde::{Deserialize, Serialize}; #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)] pub enum Visibility { Private, Public, } impl Visibility { pub fn is_public(&self) -> bool { matches!(self, &Visibility::Public) } pub fn is_private(&self) -> bool { !sel...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/language/asm.rs
sway-core/src/language/asm.rs
use serde::{Deserialize, Serialize}; use std::hash::{Hash, Hasher}; use sway_types::{BaseIdent, Ident, Span}; #[derive(Debug, Clone, Eq, Serialize, Deserialize)] pub struct AsmOp { pub(crate) op_name: Ident, pub(crate) op_args: Vec<Ident>, pub(crate) span: Span, pub(crate) immediate: Option<Ident>, } ...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/language/module.rs
sway-core/src/language/module.rs
use sway_types::Ident; /// The name used within a module to refer to one of its submodules. /// /// If an alias was given to the `mod`, this will be the alias. If not, this is the submodule's /// library name. pub type ModName = Ident; pub trait HasModule<T> where T: HasSubmodules<Self>, Self: Sized, { //...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/language/lazy_op.rs
sway-core/src/language/lazy_op.rs
use serde::{Deserialize, Serialize}; #[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] pub enum LazyOp { And, Or, }
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/language/trace.rs
sway-core/src/language/trace.rs
/// The trace of a function suggests to the compiler whether or not a function should be backtraced. #[derive(Clone, Debug, Copy, PartialEq, Eq, Hash)] pub enum Trace { Always, Never, }
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/language/inline.rs
sway-core/src/language/inline.rs
/// The inline of a function suggests to the compiler whether or not a function should be inlined. #[derive(Clone, Debug, Copy, PartialEq, Eq, Hash)] pub enum Inline { Always, Never, }
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/language/literal.rs
sway-core/src/language/literal.rs
use crate::{type_system::*, Engines}; use serde::{Deserialize, Serialize}; use std::{ fmt, hash::{Hash, Hasher}, num::{IntErrorKind, ParseIntError}, }; use sway_error::error::CompileError; use sway_types::{integer_bits::IntegerBits, span, u256::U256}; #[derive(Debug, Clone, Eq, Serialize, Deserialize)] pub...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/language/mod.rs
sway-core/src/language/mod.rs
mod asm; mod call_path; mod inline; mod lazy_op; pub mod lexed; mod literal; mod module; pub mod parsed; pub mod programs; mod purity; mod trace; pub mod ty; mod visibility; pub use asm::*; pub use call_path::*; pub use inline::*; pub use lazy_op::*; pub use literal::*; pub use module::*; pub use programs::*; pub use ...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/language/call_path.rs
sway-core/src/language/call_path.rs
use crate::{ engine_threading::{ DebugWithEngines, DisplayWithEngines, EqWithEngines, HashWithEngines, OrdWithEngines, OrdWithEnginesContext, PartialEqWithEngines, PartialEqWithEnginesContext, }, parsed::QualifiedPathType, Engines, GenericArgument, Ident, Namespace, }; use serde::{Deseri...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/language/programs.rs
sway-core/src/language/programs.rs
use std::sync::Arc; use super::{lexed::LexedProgram, parsed::ParseProgram, ty::TyProgram}; use crate::semantic_analysis::program::TypeCheckFailed; use sway_utils::PerformanceData; /// Contains the lexed, parsed, typed compilation stages of a program, as well /// as compilation metrics. #[derive(Clone, Debug)] pub str...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/language/purity.rs
sway-core/src/language/purity.rs
use serde::{Deserialize, Serialize}; use sway_ast::attribute::{STORAGE_READ_ARG_NAME, STORAGE_WRITE_ARG_NAME}; /// The purity of a function is related to its access of contract storage. If a function accesses /// or could potentially access contract storage, it is [Purity::Impure]. If a function does not utilize any ...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/language/parsed/declaration.rs
sway-core/src/language/parsed/declaration.rs
mod abi; mod configurable; mod const_generic; mod constant; mod r#enum; pub mod function; mod impl_trait; mod storage; mod r#struct; mod r#trait; mod type_alias; mod variable; use std::fmt; pub use abi::*; pub use configurable::*; pub use const_generic::*; pub use constant::*; pub use function::*; pub use impl_trait:...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/language/parsed/program.rs
sway-core/src/language/parsed/program.rs
use strum::EnumString; use crate::Engines; use super::ParseModule; /// A parsed, but not yet type-checked, Sway program. /// /// Includes all modules in the form of a `ParseModule` tree accessed via the `root`. #[derive(Debug, Clone)] pub struct ParseProgram { pub kind: TreeType, pub root: ParseModule, } //...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/language/parsed/module.rs
sway-core/src/language/parsed/module.rs
use crate::{ language::{HasModule, HasSubmodules, ModName, Visibility}, transform, }; use super::ParseTree; use sway_types::Span; pub type ModuleHash = u64; pub type ModuleEvaluationOrder = Vec<ModName>; /// A module and its submodules in the form of a tree. #[derive(Debug, Clone)] pub struct ParseModule { ...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/language/parsed/mod.rs
sway-core/src/language/parsed/mod.rs
//! Contains all the code related to parsing Sway source code. mod code_block; pub mod declaration; mod expression; mod include_statement; mod module; mod program; mod use_statement; pub use code_block::*; pub use declaration::*; pub use expression::*; pub use include_statement::IncludeStatement; pub use module::{Modu...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/language/parsed/include_statement.rs
sway-core/src/language/parsed/include_statement.rs
use sway_types::{span::Span, Ident}; use crate::language::Visibility; #[derive(Clone, Debug, PartialEq)] pub struct IncludeStatement { // this span may be used for errors in the future, although it is not right now. pub span: Span, pub mod_name: Ident, pub visibility: Visibility, }
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/language/parsed/use_statement.rs
sway-core/src/language/parsed/use_statement.rs
use crate::{language::Visibility, parsed::Span}; use serde::{Deserialize, Serialize}; use sway_types::ident::Ident; #[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)] pub enum ImportType { Star, SelfImport(Span), Item(Ident), } /// A [UseStatement] is a statement that imports something f...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/language/parsed/code_block.rs
sway-core/src/language/parsed/code_block.rs
use crate::{ engine_threading::{EqWithEngines, PartialEqWithEngines, PartialEqWithEnginesContext}, language::parsed::AstNode, }; use sway_types::{span::Span, Spanned}; #[derive(Debug, Clone)] pub struct CodeBlock { pub contents: Vec<AstNode>, pub(crate) whole_block_span: Span, } impl EqWithEngines fo...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/language/parsed/declaration/struct.rs
sway-core/src/language/parsed/declaration/struct.rs
use crate::{ ast_elements::type_argument::GenericTypeArgument, engine_threading::{EqWithEngines, PartialEqWithEngines, PartialEqWithEnginesContext}, language::Visibility, transform, type_system::TypeParameter, }; use sway_types::{ident::Ident, span::Span, Named, Spanned}; #[derive(Debug, Clone)] pu...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/language/parsed/declaration/variable.rs
sway-core/src/language/parsed/declaration/variable.rs
use sway_types::{Named, Spanned}; use crate::{ ast_elements::type_argument::GenericTypeArgument, engine_threading::{EqWithEngines, PartialEqWithEngines, PartialEqWithEnginesContext}, language::parsed::Expression, Ident, }; #[derive(Debug, Clone)] pub struct VariableDeclaration { pub name: Ident, ...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/language/parsed/declaration/trait.rs
sway-core/src/language/parsed/declaration/trait.rs
use super::{ConstantDeclaration, FunctionDeclaration, FunctionParameter}; use crate::{ ast_elements::type_argument::GenericTypeArgument, decl_engine::{parsed_id::ParsedDeclId, DeclRefTrait}, engine_threading::*, language::*, transform, type_system::*, }; use serde::{Deserialize, Serialize}; use ...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/language/parsed/declaration/abi.rs
sway-core/src/language/parsed/declaration/abi.rs
use crate::{ decl_engine::parsed_id::ParsedDeclId, engine_threading::{EqWithEngines, PartialEqWithEngines, PartialEqWithEnginesContext}, transform, }; use super::{FunctionDeclaration, Supertrait, TraitItem}; use sway_types::{ident::Ident, span::Span, Named, Spanned}; /// An `abi` declaration, which decla...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/language/parsed/declaration/function.rs
sway-core/src/language/parsed/declaration/function.rs
use crate::{ ast_elements::type_argument::GenericTypeArgument, engine_threading::*, language::{parsed::*, *}, transform::{self, AttributeKind}, type_system::*, }; use sway_types::{ident::Ident, span::Span, Named, Spanned}; #[derive(Debug, Clone)] pub enum FunctionDeclarationKind { Default, ...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/language/parsed/declaration/storage.rs
sway-core/src/language/parsed/declaration/storage.rs
use crate::{ engine_threading::{EqWithEngines, PartialEqWithEngines, PartialEqWithEnginesContext}, language::parsed::Expression, transform, type_system::*, }; use sway_types::{ident::Ident, span::Span, Spanned}; #[derive(Debug, Clone)] /// A declaration of contract storage. Only valid within contract c...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/language/parsed/declaration/configurable.rs
sway-core/src/language/parsed/declaration/configurable.rs
use crate::{ engine_threading::DebugWithEngines, language::{parsed::Expression, Visibility}, transform, Engines, GenericTypeArgument, }; use sway_types::{Ident, Named, Span, Spanned}; #[derive(Debug, Clone)] pub struct ConfigurableDeclaration { pub name: Ident, pub attributes: transform::Attributes...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/language/parsed/declaration/impl_trait.rs
sway-core/src/language/parsed/declaration/impl_trait.rs
use super::{ConstantDeclaration, FunctionDeclaration, TraitTypeDeclaration}; use crate::{ decl_engine::{parsed_id::ParsedDeclId, ParsedInterfaceDeclId}, engine_threading::{ DebugWithEngines, EqWithEngines, PartialEqWithEngines, PartialEqWithEnginesContext, }, language::CallPath, type_system:...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/language/parsed/declaration/const_generic.rs
sway-core/src/language/parsed/declaration/const_generic.rs
use crate::TypeId; use sway_types::{Ident, Span}; #[derive(Debug, Clone)] pub struct ConstGenericDeclaration { pub name: Ident, pub ty: TypeId, pub span: Span, } impl ConstGenericDeclaration { pub fn span(&self) -> Span { self.span.clone() } }
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/language/parsed/declaration/constant.rs
sway-core/src/language/parsed/declaration/constant.rs
use crate::{ engine_threading::{ DebugWithEngines, EqWithEngines, PartialEqWithEngines, PartialEqWithEnginesContext, }, language::{parsed::Expression, Visibility}, transform, Engines, GenericTypeArgument, }; use sway_types::{Ident, Named, Span, Spanned}; #[derive(Debug, Clone)] pub struct Const...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/language/parsed/declaration/type_alias.rs
sway-core/src/language/parsed/declaration/type_alias.rs
use crate::{ ast_elements::type_argument::GenericTypeArgument, engine_threading::{EqWithEngines, PartialEqWithEngines, PartialEqWithEnginesContext}, language::Visibility, transform, }; use sway_types::{ident::Ident, span::Span, Named, Spanned}; #[derive(Debug, Clone)] pub struct TypeAliasDeclaration {...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/language/parsed/declaration/enum.rs
sway-core/src/language/parsed/declaration/enum.rs
use crate::{ ast_elements::type_argument::GenericTypeArgument, engine_threading::{EqWithEngines, PartialEqWithEngines, PartialEqWithEnginesContext}, language::Visibility, transform, type_system::*, }; use sway_types::{ident::Ident, span::Span, Named, Spanned}; #[derive(Debug, Clone)] pub struct Enu...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/language/parsed/expression/asm.rs
sway-core/src/language/parsed/expression/asm.rs
use super::Expression; use crate::{ engine_threading::{EqWithEngines, PartialEqWithEngines, PartialEqWithEnginesContext}, language::{AsmOp, AsmRegister}, TypeInfo, }; use sway_types::{ident::Ident, span::Span}; #[derive(Debug, Clone)] pub struct AsmExpression { pub registers: Vec<AsmRegisterDeclaration...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/language/parsed/expression/method_name.rs
sway-core/src/language/parsed/expression/method_name.rs
use crate::engine_threading::{EqWithEngines, PartialEqWithEngines, PartialEqWithEnginesContext}; use crate::language::CallPath; use crate::type_system::TypeBinding; use crate::{GenericArgument, Ident, TypeId, TypeInfo}; #[allow(clippy::large_enum_variant)] #[derive(Debug, Clone)] pub enum MethodName { /// Represen...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/language/parsed/expression/scrutinee.rs
sway-core/src/language/parsed/expression/scrutinee.rs
use crate::{ engine_threading::{EqWithEngines, PartialEqWithEngines, PartialEqWithEnginesContext}, language::{CallPath, Literal}, TypeInfo, }; use sway_error::handler::ErrorEmitted; use sway_types::{ident::Ident, span::Span, Spanned}; /// A [Scrutinee] is on the left-hand-side of a pattern, and dictates w...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/language/parsed/expression/match_branch.rs
sway-core/src/language/parsed/expression/match_branch.rs
use crate::engine_threading::{EqWithEngines, PartialEqWithEngines, PartialEqWithEnginesContext}; use super::{Expression, Scrutinee}; use sway_types::span; #[derive(Debug, Clone)] pub struct MatchBranch { pub scrutinee: Scrutinee, pub result: Expression, pub(crate) span: span::Span, } impl EqWithEngines f...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/language/parsed/expression/mod.rs
sway-core/src/language/parsed/expression/mod.rs
use crate::{ decl_engine::parsed_id::ParsedDeclId, engine_threading::{ DebugWithEngines, DisplayWithEngines, EqWithEngines, HashWithEngines, OrdWithEngines, OrdWithEnginesContext, PartialEqWithEngines, PartialEqWithEnginesContext, }, language::{parsed::CodeBlock, *}, type_system::Typ...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/language/lexed/program.rs
sway-core/src/language/lexed/program.rs
use super::LexedModule; use crate::language::parsed::TreeType; /// A lexed, but not yet parsed or type-checked, Sway program. /// /// Includes all modules in the form of a [LexedModule] tree accessed via the `root`. #[derive(Debug, Clone)] pub struct LexedProgram { pub kind: TreeType, pub root: LexedModule, } ...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/language/lexed/mod.rs
sway-core/src/language/lexed/mod.rs
mod program; use crate::language::ModName; pub use program::LexedProgram; use sway_ast::{attribute::Annotated, Module}; use super::{HasModule, HasSubmodules}; /// A module and its submodules in the form of a tree. #[derive(Debug, Clone)] pub struct LexedModule { /// The content of this module in the form of a [M...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/language/ty/program.rs
sway-core/src/language/ty/program.rs
use std::sync::Arc; use crate::{ decl_engine::*, fuel_prelude::fuel_tx::StorageSlot, language::{parsed, ty::*, Purity, Visibility}, namespace::{check_impls_for_overlap, check_orphan_rules_for_impls, TraitMap}, semantic_analysis::namespace, transform::AllowDeprecatedState, type_system::*, ...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/language/ty/module.rs
sway-core/src/language/ty/module.rs
use std::sync::Arc; use sway_error::handler::{ErrorEmitted, Handler}; use sway_types::Span; use crate::{ decl_engine::{DeclEngine, DeclEngineGet, DeclId, DeclRef, DeclRefFunction}, language::{ty::*, HasModule, HasSubmodules, ModName}, transform::{self, AllowDeprecatedState}, Engines, }; #[derive(Clon...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/language/ty/variable_mutability.rs
sway-core/src/language/ty/variable_mutability.rs
use crate::language::Visibility; use serde::{Deserialize, Serialize}; #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, Default, Serialize, Deserialize)] pub enum VariableMutability { // mutable Mutable, // referenceable + mutable RefMutable, // immutable #[default] Immutable, } impl Varia...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/language/ty/mod.rs
sway-core/src/language/ty/mod.rs
mod ast_node; mod code_block; mod declaration; mod expression; mod module; mod program; mod side_effect; mod variable_mutability; pub use ast_node::*; pub use code_block::*; pub use declaration::*; pub use expression::*; pub use module::*; pub use program::*; pub use side_effect::*; pub use variable_mutability::*;
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/language/ty/code_block.rs
sway-core/src/language/ty/code_block.rs
use crate::{ decl_engine::*, engine_threading::*, language::ty::*, semantic_analysis::TypeCheckContext, transform::AllowDeprecatedState, type_system::*, }; use serde::{Deserialize, Serialize}; use std::hash::Hasher; use sway_error::handler::{ErrorEmitted, Handler}; use sway_types::Span; #[derive(Clone, Debug, ...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/language/ty/ast_node.rs
sway-core/src/language/ty/ast_node.rs
use crate::{ decl_engine::*, engine_threading::*, language::ty::*, semantic_analysis::{ TypeCheckAnalysis, TypeCheckAnalysisContext, TypeCheckContext, TypeCheckFinalization, TypeCheckFinalizationContext, }, transform::{AllowDeprecatedState, AttributeKind}, type_system::*, ...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/language/ty/side_effect/mod.rs
sway-core/src/language/ty/side_effect/mod.rs
mod include_statement; #[allow(clippy::module_inception)] mod side_effect; mod use_statement; pub use include_statement::*; pub use side_effect::*; pub use use_statement::*;
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/language/ty/side_effect/include_statement.rs
sway-core/src/language/ty/side_effect/include_statement.rs
use crate::language::Visibility; use serde::{Deserialize, Serialize}; use sway_types::{ident::Ident, Span, Spanned}; #[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] pub struct TyIncludeStatement { pub span: Span, pub visibility: Visibility, pub mod_name: Ident, } impl Spanned for TyIn...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/language/ty/side_effect/use_statement.rs
sway-core/src/language/ty/side_effect/use_statement.rs
use crate::language::parsed; use serde::{Deserialize, Serialize}; use sway_types::{ident::Ident, Span, Spanned}; #[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] pub struct TyUseStatement { pub call_path: Vec<Ident>, pub span: Span, pub import_type: parsed::ImportType, // If `is_rel...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/language/ty/side_effect/side_effect.rs
sway-core/src/language/ty/side_effect/side_effect.rs
use super::{TyIncludeStatement, TyUseStatement}; use serde::{Deserialize, Serialize}; #[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] pub struct TySideEffect { pub side_effect: TySideEffectVariant, } #[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] pub enum TySideEffectVar...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/language/ty/declaration/struct.rs
sway-core/src/language/ty/declaration/struct.rs
use crate::{ ast_elements::type_argument::GenericTypeArgument, decl_engine::MaterializeConstGenerics, engine_threading::*, error::module_can_be_changed, has_changes, language::{ parsed::StructDeclaration, ty::TyDeclParsedType, CallPath, CallPathType, Visibility, }, transform, ...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/language/ty/declaration/variable.rs
sway-core/src/language/ty/declaration/variable.rs
use crate::{ ast_elements::type_argument::GenericTypeArgument, engine_threading::*, language::{parsed::VariableDeclaration, ty::*}, type_system::*, }; use serde::{Deserialize, Serialize}; use std::hash::{Hash, Hasher}; use sway_types::{Ident, Named, Spanned}; #[derive(Clone, Debug, Serialize, Deseriali...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/language/ty/declaration/declaration.rs
sway-core/src/language/ty/declaration/declaration.rs
use crate::{ decl_engine::*, engine_threading::*, language::{parsed::Declaration, ty::*, Visibility}, type_system::*, types::*, }; use serde::{Deserialize, Serialize}; use std::{ fmt, hash::{Hash, Hasher}, }; use sway_error::{ error::CompileError, handler::{ErrorEmitted, Handler}, }...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
true
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/language/ty/declaration/trait.rs
sway-core/src/language/ty/declaration/trait.rs
use crate::{ decl_engine::{ DeclEngineReplace, DeclRefConstant, DeclRefFunction, DeclRefTraitFn, DeclRefTraitType, MaterializeConstGenerics, ReplaceFunctionImplementingType, }, engine_threading::*, has_changes, language::{ parsed::{self, TraitDeclaration}, ty::{TyDecl...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/language/ty/declaration/abi.rs
sway-core/src/language/ty/declaration/abi.rs
use super::{TyDeclParsedType, TyTraitInterfaceItem, TyTraitItem}; use crate::{ decl_engine::DeclEngineGet as _, engine_threading::*, language::parsed::{self, AbiDeclaration}, transform, type_system::*, }; use serde::{Deserialize, Serialize}; use std::hash::{Hash, Hasher}; use sway_error::{ error...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/language/ty/declaration/function.rs
sway-core/src/language/ty/declaration/function.rs
use crate::{ ast_elements::type_argument::GenericTypeArgument, decl_engine::*, engine_threading::*, has_changes, language::{ parsed::{self, FunctionDeclaration, FunctionDeclarationKind}, ty::*, CallPath, Inline, Purity, Trace, Visibility, }, semantic_analysis::TypeChe...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
true
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/language/ty/declaration/storage.rs
sway-core/src/language/ty/declaration/storage.rs
use crate::{ engine_threading::*, ir_generation::storage::get_storage_key_string, language::parsed::StorageDeclaration, transform::{self}, ty::*, type_system::*, Namespace, }; use serde::{Deserialize, Serialize}; use std::hash::{Hash, Hasher}; use sway_error::{ error::{CompileError, Stru...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/language/ty/declaration/configurable.rs
sway-core/src/language/ty/declaration/configurable.rs
use crate::{ decl_engine::{DeclId, DeclMapping, DeclRef, ReplaceDecls}, engine_threading::*, has_changes, language::{parsed::ConfigurableDeclaration, ty::*, CallPath, Visibility}, semantic_analysis::TypeCheckContext, transform, type_system::*, }; use serde::{Deserialize, Serialize}; use std:...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/language/ty/declaration/impl_trait.rs
sway-core/src/language/ty/declaration/impl_trait.rs
use super::{TyAbiDecl, TyDeclParsedType, TyTraitDecl, TyTraitItem}; use crate::{ decl_engine::{DeclId, DeclRefMixedInterface, InterfaceDeclId}, engine_threading::*, has_changes, language::{parsed::ImplSelfOrTrait, CallPath}, type_system::*, }; use serde::{Deserialize, Serialize}; use std::{ fmt:...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/language/ty/declaration/const_generic.rs
sway-core/src/language/ty/declaration/const_generic.rs
use crate::{ decl_engine::MaterializeConstGenerics, engine_threading::HashWithEngines, has_changes, language::{parsed::ConstGenericDeclaration, ty::TyExpression, CallPath}, semantic_analysis::{TypeCheckAnalysis, TypeCheckAnalysisContext}, Engines, HasChanges, SubstTypes, TypeId, }; use serde::{D...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/language/ty/declaration/mod.rs
sway-core/src/language/ty/declaration/mod.rs
mod abi; mod configurable; mod const_generic; mod constant; #[allow(clippy::module_inception)] mod declaration; mod r#enum; mod function; mod impl_trait; mod storage; mod r#struct; mod r#trait; mod trait_fn; mod trait_type; mod type_alias; mod variable; pub use abi::*; pub use configurable::*; pub use const_generic::*...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/language/ty/declaration/constant.rs
sway-core/src/language/ty/declaration/constant.rs
use crate::{ decl_engine::{DeclMapping, MaterializeConstGenerics, ReplaceDecls}, engine_threading::*, has_changes, language::{parsed::ConstantDeclaration, ty::*, CallPath, Visibility}, semantic_analysis::TypeCheckContext, transform, type_system::*, }; use serde::{Deserialize, Serialize}; use...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/language/ty/declaration/trait_fn.rs
sway-core/src/language/ty/declaration/trait_fn.rs
use std::{ fmt, hash::{Hash, Hasher}, }; use monomorphization::MonomorphizeHelper; use sway_error::handler::Handler; use sway_types::{Ident, Named, Span, Spanned}; use crate::{ ast_elements::type_argument::GenericTypeArgument, engine_threading::*, has_changes, language::{parsed::TraitFn, ty::*...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/language/ty/declaration/type_alias.rs
sway-core/src/language/ty/declaration/type_alias.rs
use crate::{ ast_elements::type_argument::GenericTypeArgument, engine_threading::*, language::{parsed::TypeAliasDeclaration, ty::TyDeclParsedType, CallPath, Visibility}, transform, type_system::*, }; use serde::{Deserialize, Serialize}; use std::hash::{Hash, Hasher}; use sway_types::{Ident, Named, S...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/language/ty/declaration/enum.rs
sway-core/src/language/ty/declaration/enum.rs
use crate::{ ast_elements::type_argument::GenericTypeArgument, decl_engine::MaterializeConstGenerics, engine_threading::*, has_changes, language::{parsed::EnumDeclaration, ty::TyDeclParsedType, CallPath, Visibility}, transform, type_system::*, }; use ast_elements::type_parameter::ConstGeneri...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/language/ty/declaration/trait_type.rs
sway-core/src/language/ty/declaration/trait_type.rs
use crate::{ engine_threading::*, has_changes, language::parsed::TraitTypeDeclaration, language::ty::TyDeclParsedType, transform, type_system::*, }; use serde::{Deserialize, Serialize}; use std::{ fmt, hash::{Hash, Hasher}, }; use sway_error::handler::Handler; use sway_types::{Ident, Named, Span, Spanne...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/language/ty/expression/intrinsic_function.rs
sway-core/src/language/ty/expression/intrinsic_function.rs
use crate::{engine_threading::*, has_changes, language::ty::*, type_system::*, types::*}; use itertools::Itertools; use serde::{Deserialize, Serialize}; use std::{ fmt, hash::{Hash, Hasher}, }; use sway_ast::Intrinsic; use sway_error::handler::{ErrorEmitted, Handler}; use sway_types::{Span, Spanned}; #[derive(...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/language/ty/expression/struct_exp_field.rs
sway-core/src/language/ty/expression/struct_exp_field.rs
use crate::{ decl_engine::*, engine_threading::*, language::ty::*, semantic_analysis::{TypeCheckContext, TypeCheckFinalization, TypeCheckFinalizationContext}, type_system::*, }; use serde::{Deserialize, Serialize}; use std::hash::{Hash, Hasher}; use sway_error::handler::{ErrorEmitted, Handler}; use ...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/language/ty/expression/contract.rs
sway-core/src/language/ty/expression/contract.rs
use crate::language::ty::*; use serde::{Deserialize, Serialize}; #[derive(Clone, Debug, Serialize, Deserialize)] pub struct ContractCallParams { // This is none in encoding V1 pub(crate) func_selector: Option<[u8; 4]>, pub(crate) contract_address: Box<TyExpression>, pub(crate) contract_caller: Box<TyEx...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/language/ty/expression/asm.rs
sway-core/src/language/ty/expression/asm.rs
use crate::{engine_threading::*, language::ty::*, type_system::*}; use serde::{Deserialize, Serialize}; use std::hash::{Hash, Hasher}; use sway_types::Ident; #[derive(Clone, Debug, Serialize, Deserialize)] pub struct TyAsmRegisterDeclaration { pub initializer: Option<TyExpression>, pub(crate) name: Ident, } i...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/language/ty/expression/scrutinee.rs
sway-core/src/language/ty/expression/scrutinee.rs
use crate::{ decl_engine::{DeclRefEnum, DeclRefStruct}, language::{ty::*, *}, type_system::*, }; use serde::{Deserialize, Serialize}; use sway_types::{Ident, Span}; #[derive(Debug, Clone, Serialize, Deserialize)] pub struct TyScrutinee { pub variant: TyScrutineeVariant, pub type_id: TypeId, pub...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/language/ty/expression/match_expression.rs
sway-core/src/language/ty/expression/match_expression.rs
use sway_types::{Ident, Span}; use crate::{language::ty::*, type_system::*}; /// [TyExpression] of type bool that contains the condition to be used /// in the desugared if expression or `None` if the match arm is /// a catch-all arm without condition. /// E.g., a condition might look like: /// `__matched_value_1.x ==...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/language/ty/expression/storage.rs
sway-core/src/language/ty/expression/storage.rs
use super::TyExpression; use crate::{engine_threading::*, type_system::TypeId}; use serde::{Deserialize, Serialize}; use std::hash::{Hash, Hasher}; use sway_types::{Ident, Span, Spanned}; /// Describes the full storage access including all the subfields #[derive(Clone, Debug, Serialize, Deserialize)] pub struct TyStor...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/language/ty/expression/expression.rs
sway-core/src/language/ty/expression/expression.rs
use crate::{ decl_engine::*, engine_threading::*, has_changes, language::{ty::*, Literal}, semantic_analysis::{ TypeCheckAnalysis, TypeCheckAnalysisContext, TypeCheckContext, TypeCheckFinalization, TypeCheckFinalizationContext, }, transform::{AllowDeprecatedState, Attributes}...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
true
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/language/ty/expression/mod.rs
sway-core/src/language/ty/expression/mod.rs
mod asm; mod contract; #[allow(clippy::module_inception)] mod expression; mod expression_variant; mod intrinsic_function; mod match_expression; mod reassignment; mod scrutinee; mod storage; mod struct_exp_field; pub use asm::*; pub use contract::*; pub use expression::*; pub use expression_variant::*; pub use intrinsi...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/language/ty/expression/expression_variant.rs
sway-core/src/language/ty/expression/expression_variant.rs
use crate::{ decl_engine::*, engine_threading::*, has_changes, language::{ty::*, *}, semantic_analysis::{ TyNodeDepGraphEdge, TyNodeDepGraphEdgeInfo, TypeCheckAnalysis, TypeCheckAnalysisContext, TypeCheckContext, TypeCheckFinalization, TypeCheckFinalizationContext, }, type_sy...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
true
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/language/ty/expression/reassignment.rs
sway-core/src/language/ty/expression/reassignment.rs
use crate::{ decl_engine::*, engine_threading::*, has_changes, language::ty::*, semantic_analysis::{ TypeCheckAnalysis, TypeCheckAnalysisContext, TypeCheckContext, TypeCheckFinalization, TypeCheckFinalizationContext, }, type_system::*, }; use serde::{Deserialize, Serialize}; ...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/semantic_analysis/type_check_context.rs
sway-core/src/semantic_analysis/type_check_context.rs
#![allow(clippy::mutable_key_type)] use std::collections::BTreeMap; use crate::{ decl_engine::{DeclEngineGet, MaterializeConstGenerics}, engine_threading::*, language::{ parsed::TreeType, ty::{self, TyDecl, TyExpression}, CallPath, QualifiedCallPath, Visibility, }, monomorph...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
true
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/semantic_analysis/type_check_finalization.rs
sway-core/src/semantic_analysis/type_check_finalization.rs
//! This module handles the process of iterating through the typed AST and finishing the type //! checking step, for type checking steps that need to look at information that was computed //! from the initial type checked tree. use sway_error::handler::{ErrorEmitted, Handler}; use crate::Engines; use super::TypeChec...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/semantic_analysis/symbol_resolve.rs
sway-core/src/semantic_analysis/symbol_resolve.rs
use sway_error::{error::CompileError, handler::Handler}; use crate::{ ast_elements::{binding::SymbolResolveTypeBinding, type_argument::GenericTypeArgument}, decl_engine::{parsed_engine::ParsedDeclEngineReplace, parsed_id::ParsedDeclId}, language::{ parsed::{ AbiDeclaration, ArrayExpress...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/semantic_analysis/cei_pattern_analysis.rs
sway-core/src/semantic_analysis/cei_pattern_analysis.rs
// CEI stands for "Checks, Effects, Interactions". We check that no storage writes // (effects) occur after calling external contracts (interaction) and issue warnings // if it's the case. // See this [blog post](https://fravoll.github.io/solidity-patterns/checks_effects_interactions.html) // for more detail on vulner...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/semantic_analysis/method_lookup.rs
sway-core/src/semantic_analysis/method_lookup.rs
use std::collections::{BTreeMap, HashSet}; use itertools::Itertools; use sway_error::{ error::CompileError, handler::{ErrorEmitted, Handler}, }; use sway_types::{span::Span, Ident, Spanned}; use crate::{ decl_engine::DeclRefFunction, language::{ parsed::MethodName, ty::{self, TyFuncti...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
true
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/semantic_analysis/program.rs
sway-core/src/semantic_analysis/program.rs
use std::sync::Arc; use crate::{ language::{ parsed::ParseProgram, ty::{self, TyModule, TyProgram}, }, metadata::MetadataManager, semantic_analysis::{ namespace::{self, Package}, TypeCheckContext, }, BuildConfig, Engines, }; use sway_error::handler::{ErrorEmitted...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/semantic_analysis/symbol_resolve_context.rs
sway-core/src/semantic_analysis/symbol_resolve_context.rs
use crate::{ engine_threading::*, language::{CallPath, Visibility}, namespace::ResolvedDeclaration, semantic_analysis::{ast_node::ConstShadowingMode, Namespace}, type_system::TypeId, }; use sway_error::handler::{ErrorEmitted, Handler}; use sway_types::{span::Span, Ident}; use super::{ symbol_co...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/semantic_analysis/coins_analysis.rs
sway-core/src/semantic_analysis/coins_analysis.rs
use sway_error::handler::Handler; use crate::language::ty; use super::TypeCheckContext; // This analysis checks if an expression is known statically to evaluate // to a non-zero value at runtime. // It's intended to be used in the payability analysis to check if a non-payable // method gets called with a non-zero am...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/semantic_analysis/module.rs
sway-core/src/semantic_analysis/module.rs
use std::{ collections::{HashMap, HashSet}, fmt::Display, fs, sync::Arc, }; use graph_cycles::Cycles; use indexmap::IndexMap; use itertools::Itertools; use sway_error::{ error::CompileError, handler::{ErrorEmitted, Handler}, warning::{CompileWarning, Warning}, }; use sway_types::{BaseIdent,...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
true
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/semantic_analysis/symbol_collection_context.rs
sway-core/src/semantic_analysis/symbol_collection_context.rs
use crate::{ language::{parsed::Declaration, Visibility}, namespace::{LexicalScopeId, ModulePath, ResolvedDeclaration}, semantic_analysis::Namespace, Engines, }; use sway_error::handler::{ErrorEmitted, Handler}; use sway_types::{span::Span, Ident}; use super::{namespace::Items, ConstShadowingMode, Gene...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/semantic_analysis/type_check_analysis.rs
sway-core/src/semantic_analysis/type_check_analysis.rs
//! This module handles the process of iterating through the typed AST and doing an analysis. //! At the moment, we compute a dependency graph between typed nodes. use std::collections::{HashMap, HashSet}; use std::fmt::Display; use std::fs; use petgraph::stable_graph::NodeIndex; use petgraph::Graph; use sway_error::...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/semantic_analysis/node_dependencies.rs
sway-core/src/semantic_analysis/node_dependencies.rs
use crate::{ ast_elements::type_argument::GenericTypeArgument, decl_engine::ParsedDeclEngineGet, language::{parsed::*, CallPath}, type_system::*, Engines, }; use hashbrown::{HashMap, HashSet}; use std::{ hash::{DefaultHasher, Hash, Hasher}, iter::FromIterator, }; use sway_error::error::Compi...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
true
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/semantic_analysis/type_resolve.rs
sway-core/src/semantic_analysis/type_resolve.rs
use sway_error::{ error::CompileError, handler::{ErrorEmitted, Handler}, }; use sway_types::{Ident, Span, Spanned}; use crate::{ ast_elements::type_parameter::{ConstGenericExpr, ConstGenericExprTyDecl}, language::{ ty::{self, TyDecl, TyTraitItem}, CallPath, CallPathType, QualifiedCallPa...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/semantic_analysis/namespace/module.rs
sway-core/src/semantic_analysis/namespace/module.rs
use crate::{ engine_threading::Engines, language::{ ty::{self}, Visibility, }, Ident, TypeId, }; use super::{ lexical_scope::{Items, LexicalScope, ResolvedFunctionDecl}, LexicalScopeId, ModuleName, ModulePath, ModulePathBuf, ResolvedDeclaration, ResolvedTraitImplItem, TraitM...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/semantic_analysis/namespace/contract_helpers.rs
sway-core/src/semantic_analysis/namespace/contract_helpers.rs
use sway_ast::ItemConst; use sway_error::{ error::CompileError, handler::{ErrorEmitted, Handler}, }; use sway_parse::{lex, Parser}; use sway_types::{constants::CONTRACT_ID, ProgramId, Spanned}; use crate::{ build_config::DbgGeneration, language::{ parsed::{AstNode, AstNodeContent, Declaration, ...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/semantic_analysis/namespace/trait_coherence.rs
sway-core/src/semantic_analysis/namespace/trait_coherence.rs
use std::{ cell::Cell, collections::{HashMap, HashSet}, }; use sway_error::{ error::CompileError, handler::{ErrorEmitted, Handler}, }; use sway_types::Spanned; use crate::{ engine_threading::{GetCallPathWithEngines, PartialEqWithEngines, PartialEqWithEnginesContext}, language::CallPath, En...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/semantic_analysis/namespace/mod.rs
sway-core/src/semantic_analysis/namespace/mod.rs
mod contract_helpers; mod lexical_scope; mod module; #[allow(clippy::module_inception)] mod namespace; mod package; mod resolved_declaration; mod trait_coherence; mod trait_map; pub use contract_helpers::*; pub use lexical_scope::{Items, LexicalScope, LexicalScopeId, LexicalScopePath}; pub use module::module_not_found...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/semantic_analysis/namespace/trait_map.rs
sway-core/src/semantic_analysis/namespace/trait_map.rs
use std::{ cmp::Ordering, collections::{BTreeMap, BTreeSet, HashMap, HashSet}, fmt, hash::{DefaultHasher, Hash, Hasher}, sync::Arc, }; use sway_error::{ error::CompileError, handler::{ErrorEmitted, Handler}, }; use sway_types::{integer_bits::IntegerBits, BaseIdent, Ident, Span, Spanned}; u...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
true
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/semantic_analysis/namespace/package.rs
sway-core/src/semantic_analysis/namespace/package.rs
use super::{module::Module, Ident, ModuleName}; use crate::language::Visibility; use rustc_hash::FxHasher; use std::hash::BuildHasherDefault; use sway_types::{span::Span, ProgramId}; /// A representation of the bindings in a package. The package's module structure can be accessed /// via the root module. /// /// This ...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/semantic_analysis/namespace/namespace.rs
sway-core/src/semantic_analysis/namespace/namespace.rs
use crate::{ decl_engine::DeclRef, language::{parsed::*, Visibility}, ty::{self, TyDecl}, Engines, Ident, }; use super::{ module::Module, package::Package, trait_map::TraitMap, ModuleName, ModulePath, ModulePathBuf, ResolvedDeclaration, }; use rustc_hash::FxHasher; use std::hash::BuildHasherDe...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
true
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/semantic_analysis/namespace/resolved_declaration.rs
sway-core/src/semantic_analysis/namespace/resolved_declaration.rs
use std::fmt; use crate::{ decl_engine::DeclEngine, engine_threading::*, language::{ parsed::*, ty::{self, EnumDecl, StructDecl, TyDecl}, Visibility, }, TypeId, }; use sway_error::handler::{ErrorEmitted, Handler}; #[derive(Clone, Debug)] pub enum ResolvedDeclaration { P...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/semantic_analysis/namespace/lexical_scope.rs
sway-core/src/semantic_analysis/namespace/lexical_scope.rs
use crate::{ decl_engine::{parsed_engine::ParsedDeclEngineGet, parsed_id::ParsedDeclId, *}, engine_threading::{Engines, PartialEqWithEngines, PartialEqWithEnginesContext}, language::{ parsed::{Declaration, FunctionDeclaration}, ty::{self, TyDecl, TyStorageDecl}, Visibility, }, ...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
true
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/semantic_analysis/ast_node/mod.rs
sway-core/src/semantic_analysis/ast_node/mod.rs
pub mod code_block; pub mod declaration; pub mod expression; pub mod modes; pub(crate) use expression::*; pub(crate) use modes::*; use crate::{ language::{parsed::*, ty}, semantic_analysis::*, type_system::*, Engines, Ident, }; use sway_error::{ handler::{ErrorEmitted, Handler}, warning::{Com...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false