Skip to content

Disable explicit_write in test code? #15780

@smoelius

Description

@smoelius

Would you consider a PR to disabe the explicit_write lint in test code?

An explicit write allows you to circumvent libtest's stdout/stderr capture, which you might to do to emit warnings, for example.

The below test can be used to verify this (playground):

#[test]
fn test() {
    use std::io::Write;
    writeln!(std::io::stderr(), "I am an explicit write.").unwrap();
    eprintln!("I am not an explicit write.");
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions