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/semantic_analysis/ast_node/modes.rs
sway-core/src/semantic_analysis/ast_node/modes.rs
use crate::{decl_engine::DeclId, language::ty::TyAbiDecl}; #[derive(Clone, PartialEq, Eq, Default, Debug)] pub enum AbiMode { ImplAbiFn(sway_types::Ident, Option<DeclId<TyAbiDecl>>), #[default] NonAbi, } #[derive(Clone, Copy, PartialEq, Eq, Default, Debug)] pub enum ConstShadowingMode { Allow, Seq...
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/ast_node/mode.rs
sway-core/src/semantic_analysis/ast_node/mode.rs
#[derive(Clone, PartialEq, Eq, Default)] pub enum Mode { ImplAbiFn(sway_types::Ident), #[default] NonAbi, }
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/ast_node/code_block.rs
sway-core/src/semantic_analysis/ast_node/code_block.rs
use super::*; use crate::language::{ parsed::CodeBlock, ty::{self, TyAstNodeContent, TyCodeBlock}, }; impl ty::TyCodeBlock { pub(crate) fn collect( handler: &Handler, engines: &Engines, ctx: &mut SymbolCollectionContext, code_block: &CodeBlock, ) -> Result<(), ErrorEmitt...
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/ast_node/declaration/struct.rs
sway-core/src/semantic_analysis/ast_node/declaration/struct.rs
use crate::{ decl_engine::parsed_id::ParsedDeclId, language::{parsed::*, ty, CallPath}, semantic_analysis::*, type_system::*, Engines, }; use ast_elements::type_parameter::GenericTypeParameter; use sway_error::{ error::CompileError, handler::{ErrorEmitted, Handler}, }; use symbol_collection_...
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/ast_node/declaration/variable.rs
sway-core/src/semantic_analysis/ast_node/declaration/variable.rs
use crate::{ decl_engine::parsed_id::ParsedDeclId, language::{ parsed::*, ty::{self, TyExpression, TyVariableDecl}, }, semantic_analysis::*, type_system::*, Engines, }; use namespace::ResolvedDeclaration; use sway_error::handler::{ErrorEmitted, Handler}; use sway_types::Spanned; ...
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/ast_node/declaration/declaration.rs
sway-core/src/semantic_analysis/ast_node/declaration/declaration.rs
use ast_elements::type_argument::GenericTypeArgument; use sway_error::{ error::CompileError, handler::{ErrorEmitted, Handler}, }; use sway_types::{Ident, Named, Spanned}; use crate::{ decl_engine::{DeclEngineGet, DeclEngineInsert, DeclRef, ReplaceFunctionImplementingType}, language::{ parsed::{...
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/ast_node/declaration/supertrait.rs
sway-core/src/semantic_analysis/ast_node/declaration/supertrait.rs
use std::collections::BTreeMap; use sway_error::error::CompileError; use sway_error::handler::{ErrorEmitted, Handler}; use sway_types::{Span, Spanned}; use crate::EnforceTypeArguments; use crate::{ language::{parsed, ty}, semantic_analysis::TypeCheckContext, TypeId, }; #[derive(Clone, PartialEq, Eq)] 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/semantic_analysis/ast_node/declaration/trait.rs
sway-core/src/semantic_analysis/ast_node/declaration/trait.rs
use std::collections::{BTreeMap, HashMap, HashSet}; use ast_elements::type_parameter::GenericTypeParameter; use parsed_id::ParsedDeclId; use sway_error::{ error::CompileError, handler::{ErrorEmitted, Handler}, warning::{CompileWarning, Warning}, }; use sway_types::{style::is_upper_camel_case, Ident, Named,...
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/ast_node/declaration/abi.rs
sway-core/src/semantic_analysis/ast_node/declaration/abi.rs
use std::collections::{HashMap, HashSet}; use sway_error::error::CompileError; use sway_types::{Ident, Named, Span, Spanned}; use crate::{ ast_elements::type_parameter::GenericTypeParameter, decl_engine::{ parsed_id::ParsedDeclId, DeclEngineGetParsedDeclId, DeclEngineInsert, DeclEngineInsertArc, ...
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/ast_node/declaration/function.rs
sway-core/src/semantic_analysis/ast_node/declaration/function.rs
mod function_parameter; use crate::{ decl_engine::{ parsed_id::ParsedDeclId, DeclEngineInsert as _, DeclId, DeclRefFunction, ParsedDeclEngineGet as _, }, language::{ parsed::*, ty::{self, ConstGenericDecl, TyCodeBlock, TyConstGenericDecl, TyDecl, TyFunctionDecl}, Cal...
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/ast_node/declaration/storage.rs
sway-core/src/semantic_analysis/ast_node/declaration/storage.rs
use std::collections::HashMap; use crate::{ decl_engine::parsed_id::ParsedDeclId, fuel_prelude::fuel_tx::StorageSlot, ir_generation::{ const_eval::compile_constant_expression_to_constant, storage::serialize_to_storage_slots, }, language::{ parsed::StorageDeclaration, ty::{se...
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/ast_node/declaration/configurable.rs
sway-core/src/semantic_analysis/ast_node/declaration/configurable.rs
use std::collections::VecDeque; use sway_error::{ error::CompileError, handler::{ErrorEmitted, Handler}, warning::{CompileWarning, Warning}, }; use sway_types::{style::is_screaming_snake_case, Spanned}; use symbol_collection_context::SymbolCollectionContext; use crate::{ ast_elements::{type_argument::...
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/ast_node/declaration/impl_trait.rs
sway-core/src/semantic_analysis/ast_node/declaration/impl_trait.rs
#![allow(clippy::mutable_key_type)] use std::{ collections::{BTreeMap, HashMap, HashSet}, sync::Arc, vec, }; use ast_elements::type_parameter::GenericTypeParameter; use itertools::Itertools; use sway_error::{ error::{CompileError, InterfaceName}, handler::{ErrorEmitted, Handler}, warning::{Comp...
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/declaration/mod.rs
sway-core/src/semantic_analysis/ast_node/declaration/mod.rs
mod abi; pub mod auto_impl; mod configurable; mod constant; #[allow(clippy::module_inception)] mod declaration; mod r#enum; mod function; mod impl_trait; mod storage; mod r#struct; mod supertrait; mod r#trait; mod trait_fn; mod trait_type; mod type_alias; mod variable; pub(crate) use supertrait::*;
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/ast_node/declaration/constant.rs
sway-core/src/semantic_analysis/ast_node/declaration/constant.rs
use sway_error::{ handler::{ErrorEmitted, Handler}, warning::{CompileWarning, Warning}, }; use sway_types::{style::is_screaming_snake_case, Spanned}; use symbol_collection_context::SymbolCollectionContext; use crate::{ decl_engine::parsed_id::ParsedDeclId, language::{ parsed::{self, *}, ...
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/ast_node/declaration/trait_fn.rs
sway-core/src/semantic_analysis/ast_node/declaration/trait_fn.rs
use sway_types::Spanned; use crate::{ decl_engine::{parsed_id::ParsedDeclId, DeclId}, language::{ parsed::{self, Declaration, TraitFn}, ty, CallPath, Visibility, }, semantic_analysis::symbol_collection_context::SymbolCollectionContext, Engines, }; use sway_error::handler::{ErrorEmit...
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/ast_node/declaration/type_alias.rs
sway-core/src/semantic_analysis/ast_node/declaration/type_alias.rs
use crate::{ decl_engine::parsed_id::ParsedDeclId, language::{ parsed::{Declaration, TypeAliasDeclaration}, ty::TyTypeAliasDecl, }, semantic_analysis::{ symbol_collection_context::SymbolCollectionContext, TypeCheckFinalization, TypeCheckFinalizationContext, }, Eng...
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/ast_node/declaration/enum.rs
sway-core/src/semantic_analysis/ast_node/declaration/enum.rs
use crate::{ decl_engine::parsed_id::ParsedDeclId, language::{parsed::*, ty, CallPath}, semantic_analysis::*, type_system::*, Engines, }; use ast_elements::type_parameter::GenericTypeParameter; use sway_error::handler::{ErrorEmitted, Handler}; use sway_types::Spanned; use symbol_collection_context::...
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/ast_node/declaration/trait_type.rs
sway-core/src/semantic_analysis/ast_node/declaration/trait_type.rs
use sway_error::{ error::CompileError, handler::{ErrorEmitted, Handler}, }; use sway_types::{Span, Spanned}; use crate::{ decl_engine::parsed_id::ParsedDeclId, language::{ parsed::{self, Declaration, TraitTypeDeclaration}, ty::{self, TyTraitType}, }, semantic_analysis::{ ...
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/ast_node/declaration/auto_impl/debug.rs
sway-core/src/semantic_analysis/ast_node/declaration/auto_impl/debug.rs
use sway_error::handler::Handler; use sway_types::{BaseIdent, Named, Spanned}; use crate::{ decl_engine::DeclEngineGet, language::ty::{self, TyAstNode, TyDecl, TyEnumDecl, TyStructDecl}, Engines, TypeParameter, }; #[derive(Default)] pub struct DebugAutoImplInfo {} pub type DebugAutoImplContext<'a, 'b> = ...
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/ast_node/declaration/auto_impl/mod.rs
sway-core/src/semantic_analysis/ast_node/declaration/auto_impl/mod.rs
//! This module contains common infrastructure for generating and parsing auto-generated code. pub mod abi_encoding; pub mod debug; pub mod marker_traits; use std::ops::Deref; use crate::{ ast_elements::type_argument::GenericTypeArgument, build_config::DbgGeneration, engine_threading::SpannedWithEngines, ...
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/ast_node/declaration/auto_impl/marker_traits.rs
sway-core/src/semantic_analysis/ast_node/declaration/auto_impl/marker_traits.rs
use crate::{ language::ty::{self, TyAstNode}, Engines, }; use sway_types::{Named, Spanned}; #[derive(Default)] pub struct MarkerTraitsAutoImplInfo {} pub type MarkerTraitsAutoImplContext<'a, 'b> = super::AutoImplContext<'a, 'b, MarkerTraitsAutoImplInfo>; impl<'a, 'b> MarkerTraitsAutoImplContext<'a, 'b> 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/semantic_analysis/ast_node/declaration/auto_impl/abi_encoding.rs
sway-core/src/semantic_analysis/ast_node/declaration/auto_impl/abi_encoding.rs
use crate::{ asm_generation::fuel::compiler_constants::MISMATCHED_SELECTOR_REVERT_CODE, decl_engine::{DeclEngineGet, DeclId}, language::{ parsed::FunctionDeclarationKind, ty::{self, TyAstNode, TyDecl, TyEnumDecl, TyFunctionDecl, TyStructDecl}, Purity, }, Engines, TypeInfo, 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/semantic_analysis/ast_node/declaration/function/function_parameter.rs
sway-core/src/semantic_analysis/ast_node/declaration/function/function_parameter.rs
use crate::{ language::{parsed::FunctionParameter, ty}, semantic_analysis::TypeCheckContext, type_system::*, }; use sway_error::{ error::CompileError, handler::{ErrorEmitted, Handler}, }; use sway_types::Spanned; impl ty::TyFunctionParameter { pub(crate) fn type_check( handler: &Handle...
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/ast_node/expression/intrinsic_function.rs
sway-core/src/semantic_analysis/ast_node/expression/intrinsic_function.rs
use ast_elements::type_argument::GenericTypeArgument; use sway_ast::intrinsics::Intrinsic; use sway_error::{ error::CompileError, handler::{ErrorEmitted, Handler}, }; use sway_types::Span; use sway_types::{integer_bits::IntegerBits, Spanned}; use crate::{ engine_threading::*, language::{ parsed...
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/expression/typed_expression.rs
sway-core/src/semantic_analysis/ast_node/expression/typed_expression.rs
mod constant_expression; mod enum_instantiation; mod function_application; mod if_expression; mod lazy_operator; mod method_application; mod struct_field_access; mod struct_instantiation; mod tuple_index_access; mod unsafe_downcast; use self::constant_expression::instantiate_constant_expression; pub(crate) use self::...
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/expression/mod.rs
sway-core/src/semantic_analysis/ast_node/expression/mod.rs
mod intrinsic_function; mod match_expression; pub mod typed_expression; pub(crate) use match_expression::*;
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/ast_node/expression/typed_expression/tuple_index_access.rs
sway-core/src/semantic_analysis/ast_node/expression/typed_expression/tuple_index_access.rs
use sway_error::handler::{ErrorEmitted, Handler}; use sway_types::Span; use crate::{language::ty, CompileError, Engines, TypeInfo}; pub(crate) fn instantiate_tuple_index_access( handler: &Handler, engines: &Engines, parent: ty::TyExpression, index: usize, index_span: Span, span: Span, ) -> Res...
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/ast_node/expression/typed_expression/lazy_operator.rs
sway-core/src/semantic_analysis/ast_node/expression/typed_expression/lazy_operator.rs
use sway_types::Span; use crate::{ language::{ty, LazyOp}, type_system::TypeId, }; pub(crate) fn instantiate_lazy_operator( op: LazyOp, lhs: ty::TyExpression, rhs: ty::TyExpression, return_type: TypeId, span: Span, ) -> ty::TyExpression { ty::TyExpression { expression: ty::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/semantic_analysis/ast_node/expression/typed_expression/method_application.rs
sway-core/src/semantic_analysis/ast_node/expression/typed_expression/method_application.rs
use crate::{ decl_engine::{ engine::{DeclEngineGet, DeclEngineGetParsedDeclId, DeclEngineReplace}, DeclEngineInsert, DeclRefFunction, ReplaceDecls, UpdateConstantExpression, }, language::{ parsed::*, ty::{self, TyDecl, TyExpression, TyFunctionSig}, *, }, seman...
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/expression/typed_expression/unsafe_downcast.rs
sway-core/src/semantic_analysis/ast_node/expression/typed_expression/unsafe_downcast.rs
use sway_types::Span; use crate::language::ty; /// Returns an [ty::TyExpressionVariant::UnsafeDowncast] expression that /// downcasts the expression `exp`, resulting in enum variant `variant`, /// to its underlying type. /// The expression `exp` **must** result in an enum variant `variant`. /// E.g., for `let a = MyE...
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/ast_node/expression/typed_expression/struct_instantiation.rs
sway-core/src/semantic_analysis/ast_node/expression/typed_expression/struct_instantiation.rs
use std::collections::BTreeSet; use itertools::Itertools; use sway_error::{ error::{CompileError, StructFieldUsageContext}, handler::{ErrorEmitted, Handler}, }; use sway_types::{Ident, Span, Spanned}; use crate::{ decl_engine::DeclRefStruct, language::{ parsed::*, ty::{self, StructAcce...
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/ast_node/expression/typed_expression/enum_instantiation.rs
sway-core/src/semantic_analysis/ast_node/expression/typed_expression/enum_instantiation.rs
use crate::{ decl_engine::DeclRefEnum, language::{parsed::*, ty, CallPath}, semantic_analysis::*, type_system::*, }; use sway_error::{ error::CompileError, handler::{ErrorEmitted, Handler}, }; use sway_types::{Ident, Spanned}; const UNIFY_ENUM_VARIANT_HELP_TEXT: &str = "Enum instantiator 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/semantic_analysis/ast_node/expression/typed_expression/constant_expression.rs
sway-core/src/semantic_analysis/ast_node/expression/typed_expression/constant_expression.rs
use sway_types::Spanned; use crate::{ decl_engine::DeclRefConstant, language::{ty, CallPath}, semantic_analysis::TypeCheckContext, TypeBinding, }; pub(crate) fn instantiate_constant_expression( ctx: TypeCheckContext, const_ref: DeclRefConstant, call_path_binding: TypeBinding<CallPath>, ) -...
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/ast_node/expression/typed_expression/struct_field_access.rs
sway-core/src/semantic_analysis/ast_node/expression/typed_expression/struct_field_access.rs
use sway_error::{ error::{CompileError, StructFieldUsageContext}, handler::{ErrorEmitted, Handler}, }; use sway_types::{Ident, Span, Spanned}; use crate::{ language::ty::{self, StructAccessInfo}, Engines, Namespace, TypeInfo, }; pub(crate) fn instantiate_struct_field_access( handler: &Handler, ...
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/ast_node/expression/typed_expression/function_application.rs
sway-core/src/semantic_analysis/ast_node/expression/typed_expression/function_application.rs
use crate::{ decl_engine::{ engine::DeclEngineGetParsedDeclId, DeclEngineInsert, DeclRefFunction, ReplaceDecls, }, language::{ ty::{self, TyFunctionDecl, TyFunctionSig}, *, }, semantic_analysis::{ast_node::*, TypeCheckContext}, }; use ast_elements::type_parameter::GenericType...
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/ast_node/expression/typed_expression/if_expression.rs
sway-core/src/semantic_analysis/ast_node/expression/typed_expression/if_expression.rs
use sway_error::{ error::CompileError, handler::{ErrorEmitted, Handler}, type_error::TypeError, }; use sway_types::Span; use crate::{language::ty, semantic_analysis::TypeCheckContext, type_system::*}; pub(crate) fn instantiate_if_expression( handler: &Handler, ctx: TypeCheckContext, condition:...
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/ast_node/expression/match_expression/mod.rs
sway-core/src/semantic_analysis/ast_node/expression/match_expression/mod.rs
mod analysis; mod typed; pub(crate) use analysis::*;
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/ast_node/expression/match_expression/analysis/reachable_report.rs
sway-core/src/semantic_analysis/ast_node/expression/match_expression/analysis/reachable_report.rs
use crate::language::ty; pub(crate) struct ReachableReport { pub(crate) reachable: bool, pub(crate) scrutinee: ty::TyScrutinee, } impl ReachableReport { pub(super) fn new(reachable: bool, scrutinee: ty::TyScrutinee) -> ReachableReport { ReachableReport { reachable, scrutine...
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/ast_node/expression/match_expression/analysis/range.rs
sway-core/src/semantic_analysis/ast_node/expression/match_expression/analysis/range.rs
use std::{ cmp::Ordering, fmt::{self, Write}, ops::Sub, }; use crate::CompileError; use itertools::Itertools; use sway_error::handler::{ErrorEmitted, Handler}; use sway_types::Span; pub(crate) trait MyMath<T> { fn global_max() -> T; fn global_min() -> T; fn incr(&self) -> T; fn decr(&self...
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/ast_node/expression/match_expression/analysis/pattern.rs
sway-core/src/semantic_analysis/ast_node/expression/match_expression/analysis/pattern.rs
use std::{cmp::Ordering, fmt}; use std::fmt::Write; use sway_error::error::CompileError; use sway_error::handler::{ErrorEmitted, Handler}; use sway_types::Span; use crate::decl_engine::DeclEngine; use crate::{language::ty, language::Literal, TypeInfo}; use super::{patstack::PatStack, range::Range}; /// A `Pattern` ...
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/ast_node/expression/match_expression/analysis/match_pattern_variables.rs
sway-core/src/semantic_analysis/ast_node/expression/match_expression/analysis/match_pattern_variables.rs
use indexmap::IndexMap; use sway_types::{Ident, Span, Spanned}; use crate::language::ty::{self, TyScrutinee}; /// First tuple field is `true` if the variable represented with [Span] is a struct field, otherwise `false`. pub(crate) type MatchVariable = (bool, Span); pub(crate) struct MatchVariableDuplicate { 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/semantic_analysis/ast_node/expression/match_expression/analysis/witness_report.rs
sway-core/src/semantic_analysis/ast_node/expression/match_expression/analysis/witness_report.rs
use std::fmt; use itertools::Itertools; use sway_error::handler::{ErrorEmitted, Handler}; use sway_types::Span; use crate::CompileError; use super::{patstack::PatStack, pattern::Pattern}; /// A `WitnessReport` is a report of the witnesses to a `Pattern` being useful /// and is used in the match expression exhaustiv...
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/ast_node/expression/match_expression/analysis/patstack.rs
sway-core/src/semantic_analysis/ast_node/expression/match_expression/analysis/patstack.rs
use std::{cmp::Ordering, fmt, slice::Iter, vec::IntoIter}; use itertools::Itertools; use sway_error::handler::{ErrorEmitted, Handler}; use sway_types::Span; use crate::CompileError; use super::pattern::Pattern; /// A `PatStack` is a `Vec<Pattern>` that is implemented with special methods /// particular to the match...
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/ast_node/expression/match_expression/analysis/constructor_factory.rs
sway-core/src/semantic_analysis/ast_node/expression/match_expression/analysis/constructor_factory.rs
use std::collections::HashSet; use sway_error::{ error::CompileError, handler::{ErrorEmitted, Handler}, }; use sway_types::{Ident, Span}; use crate::{decl_engine::DeclEngine, language::ty, type_system::TypeId, Engines, TypeInfo}; use super::{ patstack::PatStack, pattern::{EnumPattern, Pattern, Struct...
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/ast_node/expression/match_expression/analysis/mod.rs
sway-core/src/semantic_analysis/ast_node/expression/match_expression/analysis/mod.rs
mod constructor_factory; mod match_pattern_variables; mod matrix; mod patstack; mod pattern; mod range; mod reachable_report; mod usefulness; mod witness_report; pub(crate) use match_pattern_variables::{ collect_duplicate_match_pattern_variables, collect_match_pattern_variables, }; pub(in crate::semantic_analysis:...
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/ast_node/expression/match_expression/analysis/usefulness.rs
sway-core/src/semantic_analysis/ast_node/expression/match_expression/analysis/usefulness.rs
use sway_error::{ error::CompileError, handler::{ErrorEmitted, Handler}, }; use sway_types::Span; use crate::{language::ty, type_system::TypeId, Engines}; use super::{ constructor_factory::ConstructorFactory, matrix::Matrix, patstack::PatStack, pattern::Pattern, reachable_report::ReachableReport, witn...
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/ast_node/expression/match_expression/analysis/matrix.rs
sway-core/src/semantic_analysis/ast_node/expression/match_expression/analysis/matrix.rs
use sway_error::handler::{ErrorEmitted, Handler}; use sway_types::Span; use crate::CompileError; use super::patstack::PatStack; /// A `Matrix` is a `Vec<PatStack>` that is implemented with special methods /// particular to the match exhaustivity algorithm. /// /// The number of rows of the `Matrix` is equal to the n...
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/ast_node/expression/match_expression/typed/typed_match_branch.rs
sway-core/src/semantic_analysis/ast_node/expression/match_expression/typed/typed_match_branch.rs
use ast_node::expression::match_expression::typed::matcher::{ReqDeclNode, ReqOrVarDecl}; use indexmap::IndexSet; use itertools::{multiunzip, Itertools}; use sway_error::{ error::{CompileError, ShadowingSource}, handler::{ErrorEmitted, Handler}, }; use sway_types::{Ident, Span, Spanned}; use crate::{ compil...
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/expression/match_expression/typed/typed_scrutinee.rs
sway-core/src/semantic_analysis/ast_node/expression/match_expression/typed/typed_scrutinee.rs
use std::collections::BTreeMap; use ast_elements::{type_argument::GenericTypeArgument, type_parameter::GenericTypeParameter}; use itertools::Itertools; use sway_error::{ error::{CompileError, StructFieldUsageContext}, handler::{ErrorEmitted, Handler}, }; use sway_types::{Ident, Span, Spanned}; use crate::{ ...
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/ast_node/expression/match_expression/typed/mod.rs
sway-core/src/semantic_analysis/ast_node/expression/match_expression/typed/mod.rs
//! This module type checks `match` expressions and desugars `match` expressions to `if` expressions. //! The desugaring does not provides any kind of optimizations. It provides a structure that //! can later on be used for code analysis by reusing the existing analysis available for `if` expressions. //! The optimizat...
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/ast_node/expression/match_expression/typed/typed_match_expression.rs
sway-core/src/semantic_analysis/ast_node/expression/match_expression/typed/typed_match_expression.rs
use crate::{ compiler_generated::INVALID_DESUGARED_MATCHED_EXPRESSION_SIGNAL, language::{ parsed::*, ty::{self, TyExpression}, }, semantic_analysis::{ ast_node::expression::typed_expression::instantiate_if_expression, expression::match_expression::typed::instantiate::Inst...
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/ast_node/expression/match_expression/typed/matcher.rs
sway-core/src/semantic_analysis/ast_node/expression/match_expression/typed/matcher.rs
use indexmap::IndexMap; use crate::{ language::{ ty::{self, TyConstantDecl}, CallPath, Literal, }, semantic_analysis::{ ast_node::expression::typed_expression::{ instantiate_enum_unsafe_downcast, instantiate_struct_field_access, instantiate_tuple_index_access...
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/ast_node/expression/match_expression/typed/instantiate.rs
sway-core/src/semantic_analysis/ast_node/expression/match_expression/typed/instantiate.rs
use sway_error::handler::{ErrorEmitted, Handler}; use sway_types::{Ident, Span}; use crate::{ language::{ty, LazyOp, Literal}, semantic_analysis::{ typed_expression::{instantiate_lazy_operator, instantiate_tuple_index_access}, TypeCheckContext, }, Engines, TypeId, }; /// Simplifies ins...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/asm_generation/asm_builder.rs
sway-core/src/asm_generation/asm_builder.rs
use super::FinalizedAsm; use crate::{asm_lang::Label, BuildConfig}; use sway_error::handler::{ErrorEmitted, Handler}; use sway_ir::{ConfigContent, Function}; pub trait AsmBuilder { fn func_to_labels(&mut self, func: &Function) -> (Label, Label); fn compile_configurable(&mut self, config: &ConfigContent); 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/asm_generation/abi.rs
sway-core/src/asm_generation/abi.rs
use super::EvmAbiResult; #[allow(clippy::large_enum_variant)] #[derive(Clone, Debug)] pub enum ProgramABI { Fuel(fuel_abi_types::abi::program::ProgramABI), Evm(EvmAbiResult), MidenVM(()), }
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/asm_generation/finalized_asm.rs
sway-core/src/asm_generation/finalized_asm.rs
use super::instruction_set::InstructionSet; use super::{ fuel::{checks, data_section::DataSection}, ProgramABI, ProgramKind, }; use crate::asm_generation::fuel::data_section::{Datum, Entry, EntryName}; use crate::asm_lang::allocated_ops::{AllocatedInstruction, AllocatedOp, FuelAsmData}; use crate::decl_engine::...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/asm_generation/instruction_set.rs
sway-core/src/asm_generation/instruction_set.rs
use crate::asm_lang::allocated_ops::AllocatedOp; use std::fmt; /// An [InstructionSet] is produced by allocating registers on an [AbstractInstructionSet]. #[derive(Clone)] pub enum InstructionSet { Fuel { ops: Vec<AllocatedOp> }, Evm { ops: Vec<etk_asm::ops::AbstractOp> }, } impl fmt::Display for InstructionS...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/asm_generation/from_ir.rs
sway-core/src/asm_generation/from_ir.rs
use super::{ asm_builder::AsmBuilder, evm::EvmAsmBuilder, finalized_asm::{check_invalid_opcodes, FinalizedAsm}, fuel::{ data_section::{DataId, DataSection}, fuel_asm_builder::FuelAsmBuilder, register_sequencer::RegisterSequencer, }, }; use crate::{asm_generation::ProgramKind,...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/asm_generation/mod.rs
sway-core/src/asm_generation/mod.rs
pub mod abi; pub use abi::*; pub mod asm_builder; pub mod evm; pub use evm::*; pub mod from_ir; pub mod fuel; pub mod instruction_set; mod finalized_asm; pub use finalized_asm::*; pub use fuel::data_section::{Datum, Entry}; #[derive(Clone, Copy, Debug, Eq, PartialEq)] pub enum ProgramKind { Contract, Library,...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/asm_generation/evm/mod.rs
sway-core/src/asm_generation/evm/mod.rs
mod evm_asm_builder; pub use evm_asm_builder::*;
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/asm_generation/evm/evm_asm_builder.rs
sway-core/src/asm_generation/evm/evm_asm_builder.rs
use crate::{ asm_generation::{ asm_builder::AsmBuilder, from_ir::StateAccessType, fuel::data_section::DataSection, instruction_set::InstructionSet, FinalizedAsm, ProgramABI, ProgramKind, }, asm_lang::Label, metadata::MetadataManager, }; use etk_asm::{asm::Assembler, ops::*}; use etk_ops:...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/asm_generation/fuel/abstract_instruction_set.rs
sway-core/src/asm_generation/fuel/abstract_instruction_set.rs
use sway_error::error::CompileError; use crate::asm_lang::{allocated_ops::AllocatedOp, Op, RealizedOp}; use std::fmt; use super::{ allocated_abstract_instruction_set::AllocatedAbstractInstructionSet, register_allocator, }; /// An [AbstractInstructionSet] is a set of instructions that use entirely virtual regist...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/asm_generation/fuel/allocated_abstract_instruction_set.rs
sway-core/src/asm_generation/fuel/allocated_abstract_instruction_set.rs
use crate::{ asm_generation::fuel::data_section::EntryName, asm_lang::{ allocated_ops::{AllocatedInstruction, AllocatedRegister}, AllocatedAbstractOp, ConstantRegister, ControlFlowOp, JumpType, Label, RealizedOp, VirtualImmediate12, VirtualImmediate18, VirtualImmediate24, }, }; use ...
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_generation/fuel/data_section.rs
sway-core/src/asm_generation/fuel/data_section.rs
use rustc_hash::FxHashMap; use sway_ir::{ size_bytes_round_up_to_word_alignment, ConstantContent, ConstantValue, Context, Padding, }; use std::fmt; #[derive(Clone, Debug, PartialEq, Eq, serde::Serialize)] pub enum EntryName { NonConfigurable, Configurable(String), } impl fmt::Display for EntryName { ...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/asm_generation/fuel/register_allocator.rs
sway-core/src/asm_generation/fuel/register_allocator.rs
use crate::{ asm_generation::fuel::{analyses::liveness_analysis, compiler_constants}, asm_lang::{ allocated_ops::AllocatedRegister, virtual_register::*, AllocatedAbstractOp, Op, VirtualImmediate12, VirtualImmediate18, VirtualImmediate24, VirtualOp, }, }; use either::Either; use indexmap::In...
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_generation/fuel/functions.rs
sway-core/src/asm_generation/fuel/functions.rs
use crate::{ asm_generation::{ from_ir::*, fuel::{ compiler_constants::{self, TWELVE_BITS}, data_section::Entry, fuel_asm_builder::FuelAsmBuilder, }, ProgramKind, }, asm_lang::{ virtual_register::{self, *}, JumpType, Op, Org...
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_generation/fuel/checks.rs
sway-core/src/asm_generation/fuel/checks.rs
//! Various checks and heuristics that are naively run on sequences of opcodes. //! //! This is _not_ the place for optimization passes. use sway_error::{ error::CompileError, handler::{ErrorEmitted, Handler}, }; use sway_types::Span; use crate::asm_lang::allocated_ops::{AllocatedInstruction, AllocatedOp}; //...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/asm_generation/fuel/mod.rs
sway-core/src/asm_generation/fuel/mod.rs
pub(crate) mod compiler_constants; pub(crate) mod data_section; pub(crate) mod register_allocator; pub(super) mod abstract_instruction_set; pub(super) mod allocated_abstract_instruction_set; pub(super) mod checks; pub(super) mod fuel_asm_builder; pub(super) mod programs; pub(super) mod register_sequencer; mod analyse...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/asm_generation/fuel/analyses.rs
sway-core/src/asm_generation/fuel/analyses.rs
use std::collections::{BTreeSet, HashMap}; use either::Either; use indexmap::IndexSet; use sway_types::FxIndexSet; use crate::asm_lang::{ControlFlowOp, Label, Op, VirtualRegister}; /// Given a list of instructions `ops` of a program, do liveness analysis for the full program. /// /// A virtual registers is live at 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/asm_generation/fuel/fuel_asm_builder.rs
sway-core/src/asm_generation/fuel/fuel_asm_builder.rs
use super::{ data_section::EntryName, globals_section::GlobalsSection, programs::{AbstractEntry, AbstractProgram}, }; use crate::{ asm_generation::{ asm_builder::AsmBuilder, from_ir::{StateAccessType, Storage}, fuel::{ abstract_instruction_set::AbstractInstructionSet,...
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_generation/fuel/globals_section.rs
sway-core/src/asm_generation/fuel/globals_section.rs
pub struct GlobalContent { pub name: String, pub size_in_bytes: u64, pub offset_in_bytes: u64, } #[derive(Default)] pub struct GlobalsSection { entries: Vec<GlobalContent>, current_offset_in_bytes: u64, } impl GlobalsSection { pub fn insert(&mut self, name: &str, size_in_bytes: u64) { ...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/asm_generation/fuel/register_sequencer.rs
sway-core/src/asm_generation/fuel/register_sequencer.rs
use crate::asm_lang::{Label, VirtualRegister}; /// The [RegisterSequencer] is basically an iterator over integers -- it distributes unique ids in /// the form of integers while ASM is being generated to ensure a monotonically increasing unique /// register Id for every virtual register that is used. #[derive(Clone, Cop...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/asm_generation/fuel/compiler_constants.rs
sway-core/src/asm_generation/fuel/compiler_constants.rs
/// The total number of registers available and the number of registers available for the compiler /// to use. Registers reserved by the compiler are contained within these. const NUM_TOTAL_REGISTERS: u8 = 64; const NUM_FREE_REGISTERS: u8 = 48; /// This is the number of registers reserved by the compiler. Adjust 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/asm_generation/fuel/programs.rs
sway-core/src/asm_generation/fuel/programs.rs
mod r#abstract; mod allocated; mod r#final; pub(crate) use allocated::AllocatedProgram; pub(crate) use r#abstract::{AbstractEntry, AbstractProgram}; pub(crate) use r#final::FinalProgram; pub(crate) type SelectorOpt = Option<[u8; 4]>; pub(crate) type FnName = String; pub(crate) type ImmOffset = u64;
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/asm_generation/fuel/programs/allocated.rs
sway-core/src/asm_generation/fuel/programs/allocated.rs
use super::{FinalProgram, FnName, SelectorOpt}; use crate::{ asm_generation::{ fuel::{ allocated_abstract_instruction_set::AllocatedAbstractInstructionSet, data_section::DataSection, }, ProgramKind, }, asm_lang::Label, decl_engine::DeclRefFunction, }; //...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/asm_generation/fuel/programs/final.rs
sway-core/src/asm_generation/fuel/programs/final.rs
use crate::{ asm_generation::{ fuel::data_section::DataSection, instruction_set::InstructionSet, ProgramKind, }, asm_lang::allocated_ops::AllocatedOp, decl_engine::DeclRefFunction, FinalizedAsm, FinalizedEntry, }; use super::{FnName, ImmOffset, SelectorOpt}; /// A [FinalProgram] represents...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/asm_generation/fuel/programs/abstract.rs
sway-core/src/asm_generation/fuel/programs/abstract.rs
use super::{AllocatedProgram, FnName, SelectorOpt}; use crate::{ asm_generation::{ fuel::{ abstract_instruction_set::AbstractInstructionSet, allocated_abstract_instruction_set::AllocatedAbstractInstructionSet, compiler_constants, data_section::{DataSection, 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/asm_generation/fuel/optimizations/misc.rs
sway-core/src/asm_generation/fuel/optimizations/misc.rs
use super::super::abstract_instruction_set::AbstractInstructionSet; use crate::asm_lang::{JumpType, Op, OrganizationalOp, VirtualOp, VirtualRegister}; use std::collections::HashSet; use either::Either; impl AbstractInstructionSet { /// Removes any jumps to the subsequent line. pub(crate) fn remove_sequentia...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/asm_generation/fuel/optimizations/const_indexed_aggregates.rs
sway-core/src/asm_generation/fuel/optimizations/const_indexed_aggregates.rs
use rustc_hash::FxHashMap; use crate::{ asm_generation::fuel::compiler_constants, asm_lang::{VirtualImmediate12, VirtualOp, VirtualRegister}, }; use super::super::{abstract_instruction_set::AbstractInstructionSet, data_section::DataSection}; impl AbstractInstructionSet { // Aggregates that are const inde...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/asm_generation/fuel/optimizations/reachability.rs
sway-core/src/asm_generation/fuel/optimizations/reachability.rs
use std::collections::{BTreeSet, HashMap}; use either::Either; use rustc_hash::FxHashSet; use crate::asm_lang::{ControlFlowOp, JumpType, Label}; use super::super::{abstract_instruction_set::AbstractInstructionSet, analyses::liveness_analysis}; impl AbstractInstructionSet { pub(crate) fn dce(mut self) -> Abstrac...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/asm_generation/fuel/optimizations/verify.rs
sway-core/src/asm_generation/fuel/optimizations/verify.rs
use std::collections::HashSet; use sway_error::error::CompileError; use sway_types::Span; use crate::{ asm_generation::fuel::abstract_instruction_set::AbstractInstructionSet, asm_lang::VirtualRegister, }; impl AbstractInstructionSet { // At the moment the only verification we do is to make sure used regi...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/sway-core/src/asm_generation/fuel/optimizations/mod.rs
sway-core/src/asm_generation/fuel/optimizations/mod.rs
mod const_indexed_aggregates; mod constant_propagate; mod misc; mod reachability; mod verify; use std::cmp::Ordering; use super::abstract_instruction_set::AbstractInstructionSet; use crate::OptLevel; use super::data_section::DataSection; /// Maximum number of optimization rounds to perform in release build. 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/asm_generation/fuel/optimizations/constant_propagate.rs
sway-core/src/asm_generation/fuel/optimizations/constant_propagate.rs
use std::collections::hash_map::Entry; use either::Either; use rustc_hash::FxHashMap; use crate::asm_lang::{ ConstantRegister, ControlFlowOp, JumpType, Label, Op, VirtualOp, VirtualRegister, }; use super::super::abstract_instruction_set::AbstractInstructionSet; #[derive(Clone, Debug, PartialEq, Eq)] enum KnownR...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-migrate/src/lib.rs
forc-plugins/forc-migrate/src/lib.rs
pub mod cli; #[macro_use] mod migrations; mod matching; mod modifying; mod visiting; use std::fmt::Display; use std::io::{self, Write}; /// Returns a single error string formed of the `error` and `instructions`. /// The returned string is formatted to be used as an error message in the [anyhow::bail] macro. fn instru...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-migrate/src/main.rs
forc-plugins/forc-migrate/src/main.rs
use anyhow::Result; fn main() -> Result<()> { forc_migrate::cli::run_cli() }
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-migrate/src/visiting/mod.rs
forc-plugins/forc-migrate/src/visiting/mod.rs
//! This module contains common API for visiting elements in lexed and typed trees. #![allow(dead_code)] use anyhow::{bail, Ok, Result}; use itertools::Itertools; use std::sync::Arc; use duplicate::duplicate_item; use sway_ast::{ assignable::ElementAccess, expr::{LoopControlFlow, ReassignmentOp, Reassignment...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
true
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-migrate/src/migrations/try_from_bytes_for_b256.rs
forc-plugins/forc-migrate/src/migrations/try_from_bytes_for_b256.rs
#![allow(dead_code)] use crate::{ migrations::{MutProgramInfo, Occurrence}, modifying::*, visiting::{ InvalidateTypedElement, LexedFnCallInfoMut, LexedMethodCallInfoMut, ProgramVisitorMut, TreesVisitorMut, TyFnCallInfo, TyMethodCallInfo, VisitingContext, }, }; use anyhow::{bail, Ok, Res...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-migrate/src/migrations/partial_eq.rs
forc-plugins/forc-migrate/src/migrations/partial_eq.rs
#![allow(dead_code)] #![allow(deprecated)] use std::vec; use crate::{ internal_error, matching::{ item_impl, lexed_match, lexed_match_mut, literal, ty_match, with_name_mut, LexedLocateAnnotatedMut, LexedLocateAsAnnotatedMut, }, migrations::{ visit_all_modules, visit_all_modules...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-migrate/src/migrations/merge_core_std.rs
forc-plugins/forc-migrate/src/migrations/merge_core_std.rs
#![allow(dead_code)] use std::{sync::Arc, vec}; use crate::{ migrations::{InteractionResponse, MutProgramInfo, Occurrence}, print_single_choice_menu, visiting::{ InvalidateTypedElement, LexedFnCallInfo, LexedFnCallInfoMut, ProgramVisitor, ProgramVisitorMut, TreesVisitor, TreesVisitorMut, V...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-migrate/src/migrations/storage_domains.rs
forc-plugins/forc-migrate/src/migrations/storage_domains.rs
#![allow(dead_code)] use std::collections::HashSet; use super::{ContinueMigrationProcess, MigrationStep, MigrationStepKind, MutProgramInfo}; use crate::{ internal_error, matching::{ lexed_match_mut, lexed_storage_field, ty_match, ty_storage_field::{with_in_keyword, without_in_keyword}, ...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-migrate/src/migrations/references.rs
forc-plugins/forc-migrate/src/migrations/references.rs
#![allow(deprecated)] use std::vec; use crate::migrations::{visit_all_modules_mut, MutProgramInfo, Occurrence}; use anyhow::{Ok, Result}; use itertools::Itertools; use sway_ast::{ keywords::{AmpersandToken, Keyword, MutToken, Token}, Module, }; use sway_core::{language::ty::TyModule, Engines}; use sway_types:...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-migrate/src/migrations/error_type.rs
forc-plugins/forc-migrate/src/migrations/error_type.rs
#![allow(deprecated)] use std::{sync::Arc, vec}; use crate::{ internal_error, migrations::{MutProgramInfo, Occurrence}, modifying::*, visiting::*, }; use anyhow::{bail, Ok, Result}; use sway_ast::{ assignable::ElementAccess, expr, Assignable, Expr, ItemFn, ItemStruct, StatementLet, }; use sway_cor...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-migrate/src/migrations/new_hashing.rs
forc-plugins/forc-migrate/src/migrations/new_hashing.rs
#![allow(dead_code)] use std::collections::HashSet; use super::{MigrationStep, MigrationStepKind}; use crate::{ migrations::{DryRun, Occurrence, ProgramInfo}, visiting::{ InvalidateTypedElement, LexedFnCallInfo, ProgramVisitor, TreesVisitor, TyFnCallInfo, VisitingContext, }, }; use anyhow:...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-migrate/src/migrations/mod.rs
forc-plugins/forc-migrate/src/migrations/mod.rs
//! This module contains common API for defining and implementing individual //! [MigrationStep]s. //! //! Migration steps are defined in the submodules. Every submodule has the name //! of the corresponding breaking change Sway feature and contains all the //! migration steps needed to migrate to that feature. //! //!...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-migrate/src/migrations/demo.rs
forc-plugins/forc-migrate/src/migrations/demo.rs
//! This module contains demo migrations used for learning and testing the migration tool. #![allow(deprecated)] use std::vec; use crate::{ internal_error, matching::{lexed_match, lexed_match_mut, with_name, with_name_mut}, migrations::{visit_all_modules_mut, MutProgramInfo, Occurrence}, modifying::*...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-migrate/src/matching/typed_tree.rs
forc-plugins/forc-migrate/src/matching/typed_tree.rs
//! This module contains helper functions for matching elements within a typed program. use super::{any, TyElementsMatcher, TyElementsMatcherDeep, TyLocate}; use sway_ast::StorageField; use sway_core::{ decl_engine::id::DeclId, language::ty::{ TyAstNodeContent, TyDecl, TyImplSelfOrTrait, TyModule, TyPr...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-migrate/src/matching/mod.rs
forc-plugins/forc-migrate/src/matching/mod.rs
#![allow(dead_code)] //! This module contains common API for matching elements //! within a lexed or a typed tree. //! //! A typical migration will search for certain elements in the //! lexed or typed tree and modify them within the lexed tree. //! //! In the long term we want to have advanced infrastructure for both ...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-migrate/src/matching/lexed_tree.rs
forc-plugins/forc-migrate/src/matching/lexed_tree.rs
//! This module contains helper functions for matching elements within a mutable or immutable lexed tree. //! Functions are grouped in two submodules, [self::matchers] and [self::matchers_mut]. Both modules //! contain the same functions, that differ only in the mutability of their arguments and returned types. use su...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-migrate/src/cli/mod.rs
forc-plugins/forc-migrate/src/cli/mod.rs
//! The command line interface for `forc migrate`. mod commands; mod shared; use anyhow::Result; use clap::{Parser, Subcommand}; use forc_tracing::{init_tracing_subscriber, LevelFilter, TracingSubscriberOptions}; use self::commands::{check, run, show}; use check::Command as CheckCommand; use run::Command as RunComma...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false