Skip to content

"type annotations needed" on #[derive(serde::Deserialize)] #22263

@ChayimFriedman2

Description

@ChayimFriedman2

Every #[derive(serde::Deserialize)] on a non-empty struct with experimental diagnostics enabled triggers a "type annotations needed" error, e.g.:

#[derive(serde::Deserialize)]
struct Foo {
    v: i32,
}

Minimized:

pub fn missing_field<E>() -> Result<(), E> {
    loop {}
}

fn visit_map() -> Result<(), ()> {
    missing_field()?;
    Ok(())
}

Metadata

Metadata

Labels

A-diagnosticsdiagnostics / error reportingC-bugCategory: bug

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions