The Rust runtime - The Rust Reference (original) (raw)
The Rust Reference
The Rust runtime
This section documents features that define some aspects of the Rust runtime.
The global_allocator attribute
The globalallocator
attribute is used on a static item implementing theGlobalAlloc trait to set the global allocator.
The windows_subsystem attribute
The windowssubsystem
attribute may be applied at the crate level to set the subsystem when linking on a Windows target.
It uses the MetaNameValueStr syntax to specify the subsystem with a value of eitherconsole
or windows
.
This attribute is ignored on non-Windows targets, and for non-bin
crate types.
The “console” subsystem is the default. If a console process is run from an existing console then it will be attached to that console, otherwise a new console window will be created.
The “windows” subsystem is commonly used by GUI applications that do not want to display a console window on startup. It will run detached from any existing console.
#![allow(unused)]
#![windows_subsystem = "windows"]
fn main() {
}