DioxusLabs/dioxus · error
Expected identifier pattern
Error message
Expected identifier pattern
What it means
A function argument pattern in an extern block of the FFI bridge macro is not a plain identifier (e.g. it uses destructuring or a wildcard). FFI declarations need named arguments so bindings can be generated.
Solutions
- Use a plain identifier as the binding pattern, e.g. `name: String`, instead of a destructuring or wildcard pattern.
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at packages/manganis/manganis-macro/src/ffi.rs:207 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of DioxusLabs/dioxus@24f6a829df (2026-08-23).
Data as JSON: /api/errors/bca23e71ef3c2e02.
Report an issue: GitHub.
Appendix: source
Thrown at packages/manganis/manganis-macro/src/ffi.rs:207
pub name: Ident,
pub receiver: Option<Ident>, // The type name if first arg is `this: &TypeName`
pub args: Vec<ForeignArg>,
pub return_type: ForeignType,
}
impl ForeignFunctionDecl {
fn from_foreign_fn(func: &ForeignItemFn) -> syn::Result<Self> {
let name = func.sig.ident.clone();
let mut receiver = None;
let mut args = Vec::new();
for (i, input) in func.sig.inputs.iter().enumerate() {
match input {
syn::FnArg::Typed(pat_type) => {
let arg_name = match &*pat_type.pat {
Pat::Ident(pat_ident) => pat_ident.ident.clone(),
_ => {
return Err(syn::Error::new(
pat_type.pat.span(),
"Expected identifier pattern",
));
}
};
let arg_ty = ForeignType::from_type(&pat_type.ty)?;
// Check if first arg is `this: &SomeType`
if i == 0
&& arg_name == "this"
&& let ForeignType::OpaqueRef(type_name) = &arg_ty
{
receiver = Some(type_name.clone());
continue; // Don't add to args
}
args.push(ForeignArg {View on GitHub (pinned to 24f6a829df)