Expand description
The procedural macro front end for cinrs.
Deliberately a thin shim: everything interesting lives in cinrs-core,
which is built on proc-macro2 and can therefore be tested without a
procedural macro context.
§The nightly feature
cinrs-core never touches proc_macro, so the one thing it cannot do by
itself is build a span that points inside a string literal —
proc_macro::Literal::subspan is unstable on every channel, and
proc-macro2 does not expose it. With the nightly feature this crate
turns on #![feature(proc_macro_span)] and hands the front end a
Subspan hook that does exactly that, so a c99! { r#"…"# } body reports
its errors on the offending C token rather than on the whole literal with
the position spelled out in the message. Everything else is unchanged, and
without the feature — or wherever subspan declines to answer, as under
rust-analyzer — the stable behaviour comes back on its own.
Macros§
- c11
- Compiles a C11 translation unit written inside Rust.
- c17
- Compiles a C17 translation unit written inside Rust.
- c23
- Compiles a C23 translation unit written inside Rust.
- c89
- Compiles a C89 (C90) translation unit written inside Rust.
- c90
- Compiles a C90 translation unit written inside Rust.
- c99
- Compiles a C99 translation unit written inside Rust.
- gnu11
- Compiles a C11 translation unit with the GNU extensions switched on.
- gnu17
- Compiles a C17 translation unit with the GNU extensions switched on.
- gnu23
- Compiles a C23 translation unit with the GNU extensions switched on.
- gnu89
- Compiles a C89 translation unit with the GNU extensions switched on.
- gnu99
- Compiles a C99 translation unit with the GNU extensions switched on.
- include_
c11 - Compiles the C11 file at
path; seeinclude_c99!andc11!. - include_
c17 - Compiles the C17 file at
path; seeinclude_c99!andc17!. - include_
c23 - Compiles the C23 file at
path; seeinclude_c99!andc23!. - include_
c89 - Compiles the C89 (C90) file at
path. - include_
c90 - Compiles the C90 file at
path; seeinclude_c99!andc90!. - include_
c99 - Compiles the C99 file at
path— one translation unit, exactly as if its text had been written insidec99!. - include_
gnu11 - Compiles the C11 file at
pathwith the GNU extensions switched on; seeinclude_c99!andgnu11!. - include_
gnu17 - Compiles the C17 file at
pathwith the GNU extensions switched on; seeinclude_c99!andgnu17!. - include_
gnu23 - Compiles the C23 file at
pathwith the GNU extensions switched on; seeinclude_c99!andgnu23!. - include_
gnu89 - Compiles the C89 file at
pathwith the GNU extensions switched on; seeinclude_c99!andgnu89!. - include_
gnu99 - Compiles the C99 file at
pathwith the GNU extensions switched on; seeinclude_c99!andgnu99!.