Skip to content

eprintln! warnings are not (easily) testable #6933

@jieyouxu

Description

@jieyouxu

Remark (not for this PR): hm, these eprintln!s feel problematic to me in terms of being able to actually test them. We probably need to not directly use eprintln! and instead use some other custom interceptor which allows promoting warnings -> errors when testing [or such] 🤔

Originally posted by @jieyouxu in #6651 (comment)

There are a few instances, the one I noticed was

if override_value > max_width {
eprintln!(
"`{0}` cannot have a value that exceeds `max_width`. \
`{0}` will be set to the same value as `max_width`",
config_key,
);
return max_width;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: diagnostics, of rustfmt itself or cargo-fmtC-discussionCategory: discussion

    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