sun::support::Config
struct · Source (opens in a new tab)
struct sun::support::ConfigCompile-time configuration for Sun language behavior.
Modify these settings to enable/disable experimental features.
Public Fields
- AUTO_DEINIT_CLASSES
- DUMP_IR_ON_JIT
- FORBID_REF_FIELDS_IN_CLASSES
- FORBID_REF_RETURNS
- REQUIRE_REF_FOR_COMPOUND_PARAMS
- STRICT_MUTATION_CHECKING
- TREAT_ALL_BORROWS_AS_MUTABLE
AUTO_DEINIT_CLASSES
public · variable · static · Source (opens in a new tab)
bool sun::support::Config::AUTO_DEINIT_CLASSES = trueIf true, class instances have deinit() called automatically at scope exit.
DUMP_IR_ON_JIT
public · variable · static · Source (opens in a new tab)
bool sun::support::Config::DUMP_IR_ON_JIT = trueIf true, dump generated LLVM IR to stdout during JIT execution.
FORBID_REF_FIELDS_IN_CLASSES
public · variable · static · Source (opens in a new tab)
bool sun::support::Config::FORBID_REF_FIELDS_IN_CLASSES = falseIf true, reference types (ref T) cannot be stored in class fields.
Sun allows them, with tracking: constructing a class that stores refs takes a loan on every by-ref constructor argument, and such a value cannot be returned from the function that built it.
FORBID_REF_RETURNS
public · variable · static · Source (opens in a new tab)
bool sun::support::Config::FORBID_REF_RETURNS = falseIf true, functions cannot return reference types (ref T).
Returning references without lifetimes risks dangling references.
REQUIRE_REF_FOR_COMPOUND_PARAMS
public · variable · static · Source (opens in a new tab)
bool sun::support::Config::REQUIRE_REF_FOR_COMPOUND_PARAMS = falseIf true, compound types (classes, interfaces) cannot be passed by value to functions - they must use ref T or pointer types.
If false, compound types are passed by value with move semantics.
STRICT_MUTATION_CHECKING
public · variable · static · Source (opens in a new tab)
bool sun::support::Config::STRICT_MUTATION_CHECKING = trueIf true, disallow mutating a variable while it has active borrows (Rust-style strict checking).
Assigning to a borrowed compound value drops the storage every live borrow points into, so this must stay on.
TREAT_ALL_BORROWS_AS_MUTABLE
public · variable · static · Source (opens in a new tab)
bool sun::support::Config::TREAT_ALL_BORROWS_AS_MUTABLE = trueSimplification: treat all refs as mutable borrows.
When true, shared (immutable) borrows are not distinguished from mutable.