Skip to content

Collect errors which would be better as multiline errors #19464

Closed
@mdinger

Description

@mdinger

This sorta seems like a metabug for a topic which doesn't exist...so I'm unsure if this is the right place for this. Either way, it still seems like a good idea though.


Errors such as #18946 would benefit from being multiline e.g. the second would be an improvement over the first:

<anon>:2:5: 2:10 error: mismatched types: expected `core::option::Option<int>`, found `core::result::Result<_, _>` (expected enum core::option::Option, found enum core::result::Result)
<anon>:2:5: 2:10 error: mismatched types: expected `core::option::Option<int>`,
                                             found `core::result::Result<_, _>`
                                         (expected enum `core::option::Option`,
                                             found enum `core::result::Result`)

Simple whitespace padding on single line errors cannot be implemented because of how it interacts with word wrapping (see #19203 (comment)). A better way would be to optionally enable multiline errors e.g. via compiler flags. However, a compiler flag for just one error may be overkill.

This bug is to collect errors which could be improved by being multiline errors and the way they should be improved. Then a more comprehensive fix can be enabled later.

cc @P1start @steveklabnik @jakub- @sinistersnare


Also might have other creative uses like improving #16619.

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