Skip to content

Unused result lint should not fail if the result is contained by a struct #15681

Closed
@carllerche

Description

@carllerche

In my opinion, the following should not fail:

#![deny(unused_result)]

pub struct Zomg {
    res: Result<(), ()>
}

fn zomg() -> Zomg {
    Zomg { res: Ok(()) }
}

pub fn main() {
    zomg();
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions