Skip to main content

prelude

Attribute Macro prelude 

Source
#[prelude]
Expand description

#[preprocessor::prelude] — Crate-level attribute macro for automatic dependency resolution.

Scans the crate for op! macro usages, identifies unqualified paths (like Local), resolves them to their full crate paths (like chrono::Local) based on use statements, and rewrites the op! calls to use these full paths. This allows op! to work without requiring fully qualified paths inside the macro invocation.

§Example

#![preprocessor::prelude]

fn main() {
    // Works even without `use chrono::Local;` if `Local` is imported elsewhere
    let time = preprocessor::op!(Local::now().to_string());
}