about summary refs log tree commit diff
path: root/src/librustc_errors
AgeCommit message (Collapse)AuthorLines
2016-09-15Specify when type parameter shadows primitive typeEsteban Küber-3/+14
When a type parameter shadows a primitive type, the error message was non obvious. For example, given the file `file.rs`: ```rust trait Parser<T> { fn parse(text: &str) -> Option<T>; } impl<bool> Parser<bool> for bool { fn parse(text: &str) -> Option<bool> { Some(true) } } fn main() { println!("{}", bool::parse("ok").unwrap_or(false)); } ``` The output was: ```bash % rustc file.rs error[E0308]: mismatched types --> file.rs:7:14 | 7 | Some(true) | ^^^^ expected type parameter, found bool | = note: expected type `bool` = note: found type `bool` error: aborting due to previous error ``` We now show extra information about the type: ```bash % rustc file.rs error[E0308]: mismatched types --> file.rs:7:14 | 7 | Some(true) | ^^^^ expected type parameter, found bool | = note: expected type `bool` (type parameter) = note: found type `bool` (bool) error: aborting due to previous error ``` Fixes #35030
2016-09-15Fix wording for out-of-crate macro errorJonathan Turner-1/+2
2016-09-11Use question_mark feature in librustc_errors.Ahmed Charles-17/+17
2016-08-31Special case a few colors for WindowsJonathan Turner-3/+20
2016-08-25prevent error message interleaving on win/unixJonathan Turner-2/+198
2016-08-20Rollup merge of #35839 - jonathandturner:error_touchup, r=AatchJonathan Turner-1/+3
Wording fixes in error messages This PR is largely wording fixes to existing PRs that I found going back through the ones that have already been updated. Sometimes seeing the message in context made me think "oh there's a better wording!" There's one additional fix. This will also prevent the secondary underlining of derive call (since they look like macros to the system in the way I was using): ``` error[E0184]: the trait `Copy` may not be implemented for this type; the type has a destructor --> src/test/compile-fail/E0184.rs:11:10 | 11 | #[derive(Copy)] //~ ERROR E0184 | ^^^^ | | | in this macro invocation ``` Is now just: ``` error[E0184]: the trait `Copy` may not be implemented for this type; the type has a destructor --> src/test/compile-fail/E0184.rs:11:10 | 11 | #[derive(Copy)] //~ ERROR E0184 | ^^^^ ```
2016-08-19Auto merge of #33922 - estebank:doc-comment, r=alexcrichtonbors-0/+9
Specific error message for missplaced doc comments Identify when documetation comments have been missplaced in the following places: * After a struct element: ```rust // file.rs: struct X { a: u8 /** document a */, } ``` ```bash $ rustc file.rs file.rs:2:11: 2:28 error: found documentation comment that doesn't document anything file.rs:2 a: u8 /** document a */, ^~~~~~~~~~~~~~~~~ file.rs:2:11: 2:28 help: doc comments must come before what they document, maybe a comment was intended with `//`? ``` * As the last line of a struct: ```rust // file.rs: struct X { a: u8, /// incorrect documentation } ``` ```bash $ rustc file.rs file.rs:3:5: 3:27 error: found a documentation comment that doesn't document anything file.rs:3 /// incorrect documentation ^~~~~~~~~~~~~~~~~~~~~~ file.rs:3:5: 3:27 help: doc comments must come before what they document, maybe a comment was intended with `//`? ``` * As the last line of a `fn`: ```rust // file.rs: fn main() { let x = 1; /// incorrect documentation } ``` ```bash $ rustc file.rs file.rs:3:5: 3:27 error: found a documentation comment that doesn't document anything file.rs:3 /// incorrect documentation ^~~~~~~~~~~~~~~~~~~~~~ file.rs:3:5: 3:27 help: doc comments must come before what they document, maybe a comment was intended with `//`? ``` Fix #27429, #30322
2016-08-19wording fixes in error messagesJonathan Turner-1/+3
2016-08-17Rebase. Fix mutable iteration nit.Jonathan Turner-1/+1
2016-08-17Replace local backtrace with def-use, repair std macro spansJonathan Turner-41/+103
2016-08-07Turn on new errors, json mode. Remove duplicate unicode testJonathan Turner-314/+11
2016-07-22rustc_errors: fix a few bugsAriel Ben-Yehuda-3/+5
2016-07-15Nudge travis by commenting a littleJonathan Turner-0/+1
2016-07-14Teach EmitterWriter about the dangers of quasi-quotingJonathan Turner-7/+20
2016-07-14Add fix for tabs. Move error unit tests->ui testsJonathan Turner-6/+19
2016-07-14Add in styled_buffer.rs and remove some unused codeJonathan Turner-54/+156
2016-07-14Fix up some tidy-unfriendly spacingJonathan Turner-3/+7
2016-07-14DCE and fixing some internal testsJonathan Turner-1115/+34
2016-07-14Fix a couple UI test failuresJonathan Turner-11/+16
2016-07-14Add back in old school modeJonathan Turner-26/+265
2016-07-14Implement latest rfc style using simpler renderingJonathan Turner-192/+691
2016-07-14Remove CoreEmitter and focus on EmitterJonathan Turner-43/+36
2016-07-14Rename emit_struct->emitJonathan Turner-5/+5
2016-07-14Remove emit from emitter, leaving emit_structJonathan Turner-29/+44
2016-07-14Remove BasicEmitterJonathan Turner-74/+64
2016-07-05Specific error message for missplaced doc commentsEsteban Küber-0/+9
Identify when documetation comments have been missplaced in the following places: * After a struct element: ```rust // file.rs: struct X { a: u8 /** document a */, } ``` ```bash $ rustc file.rs file.rs:2:11: 2:28 error: found documentation comment that doesn't document anything file.rs:2 a: u8 /** document a */, ^~~~~~~~~~~~~~~~~ file.rs:2:11: 2:28 help: doc comments must come before what they document, maybe a comment was intended with `//`? ``` * As the last line of a struct: ```rust // file.rs: struct X { a: u8, /// incorrect documentation } ``` ```bash $ rustc file.rs file.rs:3:5: 3:27 error: found a documentation comment that doesn't document anything file.rs:3 /// incorrect documentation ^~~~~~~~~~~~~~~~~~~~~~ file.rs:3:5: 3:27 help: doc comments must come before what they document, maybe a comment was intended with `//`? ``` * As the last line of a `fn`: ```rust // file.rs: fn main() { let x = 1; /// incorrect documentation } ``` ```bash $ rustc file.rs file.rs:3:5: 3:27 error: found a documentation comment that doesn't document anything file.rs:3 /// incorrect documentation ^~~~~~~~~~~~~~~~~~~~~~ file.rs:3:5: 3:27 help: doc comments must come before what they document, maybe a comment was intended with `//`? ``` Fix #27429, #30322
2016-06-23make old school mode a bit more configurableJonathan Turner-24/+68
2016-06-23Move test helper functions to consolidated codemap testingJonathan Turner-0/+0
2016-06-23Consolidate codemap tests and fix more errors for travisJonathan Turner-854/+1
2016-06-23Address comments and fix travis warningJonathan Turner-1/+0
2016-06-23Move errors from libsyntax to its own crateJonathan Turner-0/+3147