Skip to content

write! is somehow masking the #[must_use] on its result #55516

Closed
@pnkfelix

Description

@pnkfelix

Hat tip to @shepmaster for finding this

play

fn main() {
    use std::fmt::Write;
    let mut example = String::new();
    write!(&mut example, "{}", 42);
}

is not triggering the #[must_use] lint on Result.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.C-bugCategory: This is a bug.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions