Constants (`const`) are evaluated at compile time and inlined at every usage point, while static variables (`static`) represent a fixed, persistent physical memory location.
const MAX_PACKET_SIZE: usize = 1024 * 64; // Inlined everywhere
static ENGINE_BANNER: &'static str = "RustViz Systems v1.85";
fn main() {
println!("{}", ENGINE_BANNER);
println!("Maximum payload: {} bytes", MAX_PACKET_SIZE);
}`const` definitions must be known at compile time and have explicit type annotations. They do not have a dedicated memory address; the compiler copies the constant bytes directly into instruction streams.
`static` variables, in contrast, occupy a specific global memory address for the entire duration of the process. Every reference to a static points to the exact same RAM location.
`const` items disappear into machine instructions (immediate operands). `static` items reside in the `.data` or `.rodata` sections of the compiled ELF/Mach-O/PE executable, mapped into memory when the OS loader launches the process.
// .rodata section in binary:
// 0x00401000: 'R' 'u' 's' 't' 'V' 'i' 'z' ... (ENGINE_BANNER)
// Immediate instruction:
// mov eax, 65536 ; MAX_PACKET_SIZE inlined directly into CPU opcode