about summary refs log tree commit diff
path: root/src/librustc_errors/lib.rs
AgeCommit message (Collapse)AuthorLines
2017-05-10Example usage of multiple suggestionsOliver Schneider-1/+4
2017-05-10Refactor suggestion diagnostic API to allow for multiple suggestionsOliver Schneider-31/+54
2017-05-06Group "macro expansion" notes per call spanEsteban Küber-3/+5
2017-05-05Use diagnostics for trace_macro instead of printlnEsteban Küber-0/+6
2017-05-02Auto merge of #40851 - oli-obk:multisugg, r=jonathandturnerbors-0/+1
Minimize single span suggestions into a label changes ``` 14 | println!("☃{}", tup[0]); | ^^^^^^ | help: to access tuple elements, use tuple indexing syntax as shown | println!("☃{}", tup.0); ``` into ``` 14 | println!("☃{}", tup[0]); | ^^^^^^ to access tuple elements, use `tup.0` ``` Also makes suggestions explicit in the backend in preparation of adding multiple suggestions to a single diagnostic. Currently that's already possible, but results in a full help message + modified code snippet per suggestion, and has no rate limit (might show 100+ suggestions).
2017-04-27typeck: resolve type vars before calling `try_index_step`Ariel Ben-Yehuda-0/+3
`try_index_step` does not resolve type variables by itself and would fail otherwise. Also harden the failure path in `confirm` to cause less confusing errors.
2017-04-25Minimize single span suggestions into a noteOliver Schneider-0/+1
2017-04-11Highlight and simplify mismatched typesEsteban Küber-1/+1
Shorten mismatched types errors by replacing subtypes that are not different with `_`, and highlighting only the subtypes that are different. Given a file ```rust struct X<T1, T2> { x: T1, y: T2, } fn foo() -> X<X<String, String>, String> { X { x: X {x: "".to_string(), y: 2}, y: "".to_string()} } fn bar() -> Option<String> { "".to_string() } ``` provide the following output ```rust error[E0308]: mismatched types --> file.rs:6:5 | 6 | X { x: X {x: "".to_string(), y: 2}, y: "".to_string()} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `std::string::String`, found {integer} | = note: expected type `X<X<_, std::string::String>, _>` ^^^^^^^^^^^^^^^^^^^ // < highlighted found type `X<X<_, {integer}>, _>` ^^^^^^^^^ // < highlighted error[E0308]: mismatched types --> file.rs:6:5 | 10 | "".to_string() | ^^^^^^^^^^^^^^ expected struct `std::option::Option`, found `std::string::String` | = note: expected type `Option<std::string::String>` ^^^^^^^ ^ // < highlighted found type `std::string::String` ```
2017-03-29Merge `ExpnId` and `SyntaxContext`.Jeffrey Seyfried-3/+1
2017-02-25Fix suggestion span error with a line containing non-ASCIIssinkuu-1/+2
2017-02-02store typeck lints in the `TypeckTables`Niko Matsakis-3/+4
Otherwise they are a "hidden output"
2017-01-22Remove unused `extern crate`s.Jeffrey Seyfried-5/+0
2017-01-22Warn on unused `#[macro_use]` imports.Jeffrey Seyfried-2/+0
2016-12-29Remove not(stage0) from deny(warnings)Alex Crichton-1/+1
Historically this was done to accommodate bugs in lints, but there hasn't been a bug in a lint since this feature was added which the warnings affected. Let's completely purge warnings from all our stages by denying warnings in all stages. This will also assist in tracking down `stage0` code to be removed whenever we're updating the bootstrap compiler.
2016-12-12Auto merge of #38049 - frewsxcv:libunicode, r=alexcrichtonbors-1/+1
Rename 'librustc_unicode' crate to 'libstd_unicode'. Fixes https://github.com/rust-lang/rust/issues/26554.
2016-11-30Update the bootstrap compilerAlex Crichton-1/+0
Now that we've got a beta build, let's use it!
2016-11-30Rename 'librustc_unicode' crate to 'libstd_unicode'.Corey Farwell-1/+1
Fixes #26554.
2016-11-01improve early lint to use multispan from diagnosticNiko Matsakis-2/+2
2016-11-01compare-method lintNiko Matsakis-22/+2
2016-11-01separate Diagnostic from DiagnosticBuilderNiko Matsakis-215/+4
2016-10-18run rustfmt on librustc_errors folderSrinivas Reddy Thatiparthy-77/+73
2016-10-12Stabilise `?`Nick Cameron-1/+1
cc [`?` tracking issue](https://github.com/rust-lang/rust/issues/31436)
2016-09-19Add the ability to merge spans to codemapJonathan Turner-0/+1
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-08-31Special case a few colors for WindowsJonathan Turner-1/+7
2016-08-25prevent error message interleaving on win/unixJonathan Turner-0/+1
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-07Turn on new errors, json mode. Remove duplicate unicode testJonathan Turner-21/+2
2016-07-22rustc_errors: fix a few bugsAriel Ben-Yehuda-3/+5
2016-07-14Add in styled_buffer.rs and remove some unused codeJonathan Turner-2/+2
2016-07-14DCE and fixing some internal testsJonathan Turner-10/+0
2016-07-14Implement latest rfc style using simpler renderingJonathan Turner-0/+1
2016-07-14Rename emit_struct->emitJonathan Turner-3/+3
2016-07-14Remove emit from emitter, leaving emit_structJonathan Turner-13/+44
2016-07-14Remove BasicEmitterJonathan Turner-1/+1
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-1/+2
2016-06-23Move errors from libsyntax to its own crateJonathan Turner-0/+745