about summary refs log tree commit diff
path: root/src/librustc_errors/emitter.rs
AgeCommit message (Collapse)AuthorLines
2020-08-30mv compiler to compiler/mark-2177/+0
2020-08-15replaced log with tracingGurpreet Singh-1/+1
2020-08-05Show backtrace numbers in backtrace whenever more than one is involvedAaron Hill-2/+2
Previously, we only displayed 'frame' numbers in a macro backtrace when more than two frames were involved. This commit should help make backtrace more readable, since these kinds of messages can quickly get confusing.
2020-06-25emitter: column width defaults to 140David Wood-3/+7
This commit modifies the column width computation in the emitter when `termize::dimensions` returns `None` so that it uses the default value of 140 (which is used in UI testing currently) instead of `usize::MAX` which just ends up causing overflows in later computations. This is hard to test but appears to produce the same output as using saturating functions instead. Signed-off-by: David Wood <david@davidtw.co>
2020-04-24Replace filter_map().next() calls with find_map()Josh Stone-13/+10
These are semantically the same, but `find_map()` is more concise.
2020-04-16don't clone types that are copy (clippy::clone_on_copy)Matthias Krüger-1/+1
2020-04-07Use assoc integer constants in librustc_*Linus Färnstrand-5/+5
2020-03-30Use if let instead of match when only matching a single variant ↵Matthias Krüger-22/+16
(clippy::single_match) Makes code more compact and reduces nestig.
2020-03-20Revised span-to-lines conversion to produce an empty vec on DUMMY_SP.Felix S. Klock II-1/+1
This required revising some of the client code to stop relying on the returned set of lines being non-empty.
2020-03-16use direct imports for `rustc::{lint, session}`.Mazdak Farrokhzad-1/+1
2020-03-10rustc_errors: Use ensure_source_file_source_present where necessary.Ana-Maria Mihalache-1/+5
2020-03-10Store `TokenStream` in `rmeta::MacroDef`.Mazdak Farrokhzad-8/+8
This removes a hack from `load_macro_untracked` in which parsing is used.
2020-03-01use for (idx, item) in iter.enumerate() instead of manually counting loop ↵Matthias Krüger-3/+2
iterations by variables
2020-02-28use is_empty() instead of len() == x to determine if structs are empty.Matthias Krüger-1/+1
2020-02-06rustc_macros: don't limit the -Zmacro-backtrace suggestion to extern macros.Eduard-Mihai Burtescu-18/+35
2020-02-06rustc_errors: hide "in this macro invocation" when redundant, more explicitly.Eduard-Mihai Burtescu-27/+36
2020-02-06rustc_errors: deduplicate the -Zmacro-backtrace suggestion message.Eduard-Mihai Burtescu-12/+5
2020-02-06rustc: rename -Zexternal-macro-backtrace to -Zmacro-backtrace.Eduard-Mihai Burtescu-18/+10
2020-02-06rustc_errors: split macro backtrace rendering from <*macros> hacks.Eduard-Mihai Burtescu-58/+96
2020-01-30Rollup merge of #68626 - Zoxc:termize, r=estebankDylan DPC-1/+1
Use termize instead of term_size `termize` is a fork of `term_size` which uses `winapi` 0.3 instead of 0.2. This is a step towards removing the `winapi` 0.2 dependency. r? @Mark-Simulacrum
2020-01-29Use termize instead of term_sizeJohn Kåre Alsaker-1/+1
2020-01-28Correct ICE caused by macros generating invalid spans.Michael Burge-1/+8
2020-01-27don't clone types that are copy, round two.Matthias Krüger-6/+6
2020-01-26rustc_span: return an impl Iterator instead of a Vec from macro_backtrace.Eduard-Mihai Burtescu-4/+4
2020-01-26rustc_span: replace MacroBacktrace with ExpnData.Eduard-Mihai Burtescu-6/+6
2020-01-25Revert suggestion window size changeEsteban Küber-1/+1
2020-01-24review commentsEsteban Küber-1/+1
2020-01-24Increase suggestion code window from 6 lines to 20Esteban Küber-3/+8
2020-01-16review commentsEsteban Küber-4/+5
2020-01-16Do not ICE on malformed suggestion spansEsteban Küber-1/+8
2020-01-05Handle multiple error fix suggestions carefulyLaurent Bonnans-5/+13
The existing code seems to assume that substitutions spans are disjoint, which is not always the case. In the example: pub trait AAAA {} pub trait B {} pub trait C {} pub type T<P: AAAA + B + C> = P; , we get three substituions starting from ':' and ending respectively at the end of each trait token. With the former offset calculation, this would cause `underline_start` to eventually become negative before being converted to `usize`... The new version may report erroneous results for non perfectly overlapping substitutions but I don't know if such examples exist. Alternatively, we could detect these cases and trim out overlapping substitutions.
2020-01-01Rename `syntax_pos` to `rustc_span` in source codeVadim Petrochenkov-2/+2
2019-12-24x.py fmt after previous deignoreMark Rousskov-291/+310
2019-11-27Draw vertical lines in compiler error messages with multiline annotations ↵Christoph Schmidler-3/+3
correctly when non-1space unicode characters are to the left For this we use the correct calculation of the 'left' identation
2019-11-15Remove SourceMapper traitMark Rousskov-12/+13
SourceMap is now in the root of all rustc-specific crates, syntax_pos, so there's no need for the trait object to decouple the dependencies between librustc_errors and libsyntax as was needed previously.
2019-11-06Rollup merge of #66139 - euclio:pluralize, r=nagisaMazdak Farrokhzad-2/+2
use American spelling for `pluralize!`
2019-11-05use American spelling for `pluralize!`Andy Russell-2/+2
2019-11-03use silent emitter for rustdoc highlighting passAndy Russell-0/+8
2019-11-03Auto merge of #65827 - AnthonyMikh:out_of_the_loop, r=estebankbors-4/+3
Remove a loop which runs exactly once Though the code seems to work properly, it is worth removing the loop entirely in order to not confuse the reader. r? @estebank
2019-10-27Remove a loop which runs exactly onceAnthonyMikh-4/+3
2019-10-24review comment: deduplicate logicEsteban Küber-27/+13
2019-10-24Increase spacing for suggestions in diagnosticsEsteban Küber-0/+13
Make the spacing between the code snippet and verbose structured suggestions consistent with note and help messages.
2019-10-19Fix plural mistake in emitter.rsvarkor-2/+3
2019-10-15Refactor: Rename `db` locals to `diag`Philipp Hansch-13/+13
https://github.com/rust-lang/rust/pull/64272 replaced `DiagnosticBuilder` with `Diagnostic` in some places. This commit just renames the DB variable from `db` to `diag` where it wasn't renamed.
2019-10-14Tweak heuristics for less noiseEsteban Küber-3/+3
2019-10-14Use heuristics for capitalization warning in suggestionsEsteban Küber-6/+21
2019-10-13Bring attention to suggestions when the only difference is capitalizationEsteban Küber-4/+28
2019-10-05Rollup merge of #64909 - estebank:turbofish-reloaded, r=CentrilTyler Mandry-4/+8
When encountering chained operators use heuristics to recover from bad turbofish
2019-10-03review commentsEsteban Küber-6/+8
2019-10-03review commentsEsteban Küber-1/+3