rustc_builtin_macros::util

Function get_single_expr_from_tts

Source
pub(crate) fn get_single_expr_from_tts(
    cx: &mut ExtCtxt<'_>,
    span: Span,
    tts: TokenStream,
    name: &str,
) -> ExpandResult<Result<P<Expr>, ErrorGuaranteed>, ()>
Expand description

Interpreting tts as a comma-separated sequence of expressions, expect exactly one expression, or emit an error and return Err.