DioxusLabs/dioxus · error · syn::Error

literal in `deprecated` value must be a string

Error message

literal in `deprecated` value must be a string

What it means

Error "literal in `deprecated` value must be a string" thrown in DioxusLabs/dioxus.

Source

Thrown at packages/core-macro/src/utils.rs:58

    pub since: Option<String>,
    pub note: Option<String>,
}

impl DeprecatedAttribute {
    /// Returns `None` if the given attribute was not a valid form of the `#[deprecated]` attribute.
    pub fn from_meta(meta: &Meta) -> syn::Result<Self> {
        if meta.path() != &parse_quote!(deprecated) {
            return Err(syn::Error::new(
                meta.span(),
                "attribute path is not `deprecated`",
            ));
        }

        match &meta {
            Meta::Path(_) => Ok(Self::default()),
            Meta::NameValue(name_value) => {
                let Expr::Lit(expr_lit) = &name_value.value else {
                    return Err(syn::Error::new(
                        name_value.span(),
                        "literal in `deprecated` value must be a string",
                    ));
                };

                Ok(Self {
                    since: None,
                    note: lit_to_string(expr_lit.lit.clone()).map(|s| s.trim().to_string()),
                })
            }
            Meta::List(list) => {
                let parsed = list.parse_args::<DeprecatedAttributeArgsParser>()?;

                Ok(Self {
                    since: parsed.since.map(|s| s.trim().to_string()),
                    note: parsed.note.map(|s| s.trim().to_string()),
                })
            }

View on GitHub (pinned to 393d190a80)

When it happens

Trigger: Thrown at packages/core-macro/src/utils.rs:58 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of DioxusLabs/dioxus@393d190a80 (2026-08-16). Data as JSON: /api/errors/5e209cc34c550bea. Report an issue: GitHub.