You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
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
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.
Looks like the referenced merge addresses error + help combos (albeit not in the order described above):
$ echo'mod foo;'> test.rs
$ rustc ./test.rstest.rs:1:5: 1:8 error: file not found for module `foo`test.rs:1 mod foo; ^~~test.rs:1:5: 1:8 help: name the file either foo.rs or foo/mod.rs inside the directory ""
But this still happens for error + warning combos:
use std::vec::Drain;fnmain(){}
$ rustc ./test.rs./test.rs:1:5: 1:20 error: use of unstable library feature 'collections': recently added as part of collections reform 2./test.rs:1 use std::vec::Drain; ^~~~~~~~~~~~~~~./test.rs:1:5: 1:20 warning: unused import, #[warn(unused_imports)] on by default./test.rs:1 use std::vec::Drain; ^~~~~~~~~~~~~~~error: aborting due to previous error
Though this may be deliberate since the error and warning are about different issues.
With the error+warning case, I think those are actually two separate diagnostics, that is, the warning is not the subdiagnostic of the error, so they shouldn't be combined.
Sooo I think this issue might be done? If I'm understanding the intentionality of the current error display?
Warnings have undergone a lot of churn lately, and some of them have been grouped together in logical ways. @jonathandturner@nikomatsakis@nrc@pnkfelix is this issue still relevant?
I think we can close this. The main redundancy has been addressed, and I think the current handling of help messages works at least for the case described
Activity
caipre commentedon May 9, 2015
Looks like the referenced merge addresses error + help combos (albeit not in the order described above):
But this still happens for error + warning combos:
Though this may be deliberate since the error and warning are about different issues.
carols10cents commentedon Feb 2, 2016
So since helps look like they're a subdiagnostic of errors, and errors get output before their subdiagnostics, the ordering looks intentional.
With the error+warning case, I think those are actually two separate diagnostics, that is, the warning is not the subdiagnostic of the error, so they shouldn't be combined.
Sooo I think this issue might be done? If I'm understanding the intentionality of the current error display?
brson commentedon Jun 27, 2016
Warnings have undergone a lot of churn lately, and some of them have been grouped together in logical ways. @jonathandturner @nikomatsakis @nrc @pnkfelix is this issue still relevant?
pnkfelix commentedon Jul 4, 2016
I think we can close this. The main redundancy has been addressed, and I think the current handling of help messages works at least for the case described
nikomatsakis commentedon Aug 23, 2016
Agreed.
Merge pull request rust-lang#21938 from A4-Tacks/indent-let-else-to-m…
Merge pull request rust-lang#21938 from A4-Tacks/indent-let-else-to-m…