Function syntax::ext::base::expr_to_spanned_string[][src]

pub fn expr_to_spanned_string(
    cx: &mut ExtCtxt,
    expr: P<Expr>,
    err_msg: &str
) -> Option<Spanned<(Symbol, StrStyle)>>
🔬 This is a nightly-only experimental API. (rustc_private)

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

Extract a string literal from the macro expanded version of expr, emitting err_msg if expr is not a string literal. This does not stop compilation on error, merely emits a non-fatal error and returns None.