Skip to content
2 changes: 0 additions & 2 deletions src/exe_format/pe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ pub enum Error {
SecurityDirInsideImage,
#[error("UnexpectedOverlayPresent")]
UnexpectedOverlayPresent,
#[error("InsufficientSpace")]
InsufficientSpace,
}

/// Windows PE Binary manipulation for codesigning standalone executables
Expand Down
4 changes: 2 additions & 2 deletions src/react_compiler/DESIGN.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,9 @@ Node allocation uses the thread-local store (`Expr::init`, `Stmt::alloc`) so
nodes land in the parser's arena. `Binding` and slice/string copies need an
explicit `&Arena` (the `Codegen` context carries one).

New symbols (`$`, `t0`, `c`, `_c`) are minted via the `SymbolHost` trait
New symbols (`$`, `t0`, `c`, `_c`) are minted via the `Host` trait
implemented by the parser's `P`; the import of `react/compiler-runtime` is
registered via `SymbolHost::add_import_record`.
registered via `Host::add_import_record`.

### Bail-out semantics

Expand Down
2 changes: 0 additions & 2 deletions src/react_compiler/hir/environment_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ pub struct EnvironmentConfig {
pub enable_use_keyed_state: bool,
pub validate_no_set_state_in_effects: bool,
pub validate_no_derived_computations_in_effects: bool,
pub validate_no_derived_computations_in_effects_exp: bool,
pub validate_no_jsx_in_try_statements: bool,
pub validate_static_components: bool,
pub validate_no_capitalized_calls: Option<Vec<String>>,
Expand Down Expand Up @@ -142,7 +141,6 @@ impl Default for EnvironmentConfig {
enable_use_keyed_state: false,
validate_no_set_state_in_effects: false,
validate_no_derived_computations_in_effects: false,
validate_no_derived_computations_in_effects_exp: false,
validate_no_jsx_in_try_statements: false,
validate_static_components: false,
validate_no_capitalized_calls: None,
Expand Down
11 changes: 2 additions & 9 deletions src/react_compiler/hir/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,8 @@ pub use reactive::*;
/// buffer's `deallocate` is a no-op. Nonetheless, HIR types must NOT own
/// global-heap allocations (`String`, `Box<T>`, `Vec<T>`): the arena bulk-
/// frees on reset without walking elements, so any nested global allocation
/// leaks per parse. Use [`StoreStr`] / [`HirBox`] / [`HirVec`] instead.
/// leaks per parse. Use [`StoreStr`] / [`HirVec`] instead.
Comment thread
robobun marked this conversation as resolved.
pub type HirVec<T> = bun_alloc::AstVec<T>;
/// Arena-backed `Box<T>`. See [`HirVec`] for the leak rationale.
pub type HirBox<T> = bun_alloc::AstBox<T>;
pub use bun_alloc::AstAlloc;
/// Arena-owned (or `'static`) byte string. Copy; no Drop. See [`HirVec`].
pub use bun_ast::StoreStr;
Expand Down Expand Up @@ -1478,7 +1476,7 @@ impl NonLocalBinding {
// =============================================================================

/// The recursive `Box<Type>` fields here intentionally use the global
/// allocator, NOT [`HirBox`]: `Type` values are constructed and held by the
/// allocator, NOT the AST arena: `Type` values are constructed and held by the
/// process-lifetime [`ShapeRegistry`](crate::hir::object_shape::ShapeRegistry),
/// which outlives the per-file AST arena, so an arena-backed box would dangle
/// after `Store::reset()`. The leak hazard described on [`HirVec`] does not
Expand Down Expand Up @@ -1720,11 +1718,6 @@ pub fn is_ref_or_ref_value(ty: &Type) -> bool {
is_use_ref_type(ty) || is_ref_value_type(ty)
}

/// Returns true if the type is a useState result (BuiltInUseState).
pub fn is_use_state_type(ty: &Type) -> bool {
matches!(ty, Type::Object { shape_id: Some(id) } if *id == object_shape::BUILT_IN_USE_STATE_ID)
}

/// Returns true if the type is a setState function (BuiltInSetState).
pub fn is_set_state_type(ty: &Type) -> bool {
matches!(ty, Type::Function { shape_id: Some(id), .. } if *id == object_shape::BUILT_IN_SET_STATE_ID)
Expand Down
2 changes: 1 addition & 1 deletion src/react_compiler/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ pub mod program;
pub use compile_result::{CompileDiagnostic, CompileOutput};
pub use options::ReactCompilerOptions;
pub use program::{
CompileResult, Host, JsxImportKind, PendingCompile, ReactCompilerState, SymbolHost,
CompileResult, Host, JsxImportKind, PendingCompile, ReactCompilerState,
collect_import_bindings, finish, has_module_scope_opt_out, maybe_compile_pending,
};
7 changes: 0 additions & 7 deletions src/react_compiler/program.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,6 @@ pub trait Host {
fn add_import_record(&mut self, path: &[u8], kind: ImportKind) -> (u32, Ref);
}

// Back-compat alias for the parser hook written against the previous API.
pub use Host as SymbolHost;

// -----------------------------------------------------------------------
// Constants
// -----------------------------------------------------------------------
Expand Down Expand Up @@ -501,10 +498,6 @@ pub(crate) fn parse_fixture_pragmas(source: &[u8], opts: &mut ReactCompilerOptio
b"validateNoDerivedComputationsInEffects" => {
env_bool!(validate_no_derived_computations_in_effects, val)
}
Comment thread
robobun marked this conversation as resolved.
b"validateNoDerivedComputationsInEffectsExp"
| b"validateNoDerivedComputationsInEffects_exp" => {
env_bool!(validate_no_derived_computations_in_effects_exp, val)
}
b"validateNoJsxInTryStatements" | b"validateNoJSXInTryStatements" => {
env_bool!(validate_no_jsx_in_try_statements, val)
}
Expand Down
Loading