Skip to content

When a help message is associated with a warning message, the two message you should be printed together and the source code printed only once. #21938

Closed
@dzamlo

Description

@dzamlo

For exemple, for the following code:

extern crate libc;

fn main() {
}

The output of rustc is:

bar.rs:1:1: 1:19 warning: use of unstable library feature 'libc'
bar.rs:1 extern crate libc;
         ^~~~~~~~~~~~~~~~~~
bar.rs:1:1: 1:19 help: add #![feature(libc)] to the crate attributes to silence this warning
bar.rs:1 extern crate libc;
         ^~~~~~~~~~~~~~~~~~

It should be:

bar.rs:1:1: 1:19 warning: use of unstable library feature 'libc'
bar.rs:1:1: 1:19 help: add #![feature(libc)] to the crate attributes to silence this warning
bar.rs:1 extern crate libc;
         ^~~~~~~~~~~~~~~~~~

I don't know if there is any help message associated with an error message, but if this the case, the same issue apply.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lints

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions