DioxusLabs/dioxus · error · syn::Error

attribute path is not `deprecated`

Error message

attribute path is not `deprecated`

What it means

Error "attribute path is not `deprecated`" thrown in DioxusLabs/dioxus.

Source

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

    let ty_formatted = ty_unformatted.replace(' ', "");

    ty_formatted.to_string()
}

/// Represents the `#[deprecated]` attribute.
///
/// You can use the [`DeprecatedAttribute::from_meta`] function to try to parse an attribute to this struct.
#[derive(Default)]
pub struct DeprecatedAttribute {
    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()),

View on GitHub (pinned to 393d190a80)

When it happens

Trigger: Thrown at packages/core-macro/src/utils.rs:48 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/9e2da5607fe48118. Report an issue: GitHub.