Eduard-Mihai Burtescu
8f286dbf27
rustc_errors: split macro backtrace rendering from <*macros> hacks.
2020-02-06 21:32:07 +02:00
Dylan DPC
4af33a9c26
Rollup merge of #68626 - Zoxc:termize, r=estebank
...
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-30 01:46:43 +01:00
John Kåre Alsaker
b0b11d31a2
Use termize instead of term_size
2020-01-29 01:13:48 +01:00
Michael Burge
79d8c9beab
Correct ICE caused by macros generating invalid spans.
2020-01-28 11:02:22 -08:00
Matthias Krüger
ec61761e46
don't clone types that are copy, round two.
2020-01-27 01:18:18 +01:00
Eduard-Mihai Burtescu
6980f82c0d
rustc_span: return an impl Iterator instead of a Vec from macro_backtrace.
2020-01-26 17:18:55 +02:00
Eduard-Mihai Burtescu
75284f8cbd
rustc_span: replace MacroBacktrace with ExpnData.
2020-01-26 17:18:55 +02:00
Esteban Küber
16709f032c
Revert suggestion window size change
2020-01-25 12:26:33 -08:00
Esteban Küber
600e385c43
review comments
2020-01-24 14:03:35 -08:00
Esteban Küber
34d51b3378
Increase suggestion code window from 6 lines to 20
2020-01-24 11:18:45 -08:00
Esteban Küber
03240e1359
review comments
2020-01-16 18:55:23 -08:00
Esteban Küber
10a9ea4c26
Do not ICE on malformed suggestion spans
2020-01-16 18:14:26 -08:00
Laurent Bonnans
12545c75ff
Handle multiple error fix suggestions carefuly
...
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-05 12:51:57 +01:00
Vadim Petrochenkov
70f1d57048
Rename syntax_pos
to rustc_span
in source code
2020-01-01 09:15:18 +03:00
Mark Rousskov
6891388e66
x.py fmt after previous deignore
2019-12-24 17:38:22 -05:00
Christoph Schmidler
59d7391238
Draw vertical lines in compiler error messages with multiline annotations correctly when non-1space unicode characters are to the left
...
For this we use the correct calculation of the 'left' identation
2019-11-27 20:02:20 +01:00
Mark Rousskov
3f93ffc333
Remove SourceMapper trait
...
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-15 08:45:43 -05:00
Mazdak Farrokhzad
4f9651b854
Rollup merge of #66139 - euclio:pluralize, r=nagisa
...
use American spelling for `pluralize!`
2019-11-06 07:03:14 +01:00
Andy Russell
ad550b8ef3
use American spelling for pluralize!
2019-11-05 15:10:24 -05:00
Andy Russell
d06a4ded13
use silent emitter for rustdoc highlighting pass
2019-11-03 22:19:34 -05:00
bors
8b07292671
Auto merge of #65827 - AnthonyMikh:out_of_the_loop, r=estebank
...
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-11-03 11:51:44 +00:00
AnthonyMikh
159d8a4154
Remove a loop which runs exactly once
2019-10-27 12:02:34 +03:00
Esteban Küber
508d032647
review comment: deduplicate logic
2019-10-24 15:44:43 -07:00
Esteban Küber
0baf61bfdb
Increase spacing for suggestions in diagnostics
...
Make the spacing between the code snippet and verbose structured
suggestions consistent with note and help messages.
2019-10-24 12:26:01 -07:00
varkor
f042687959
Fix plural mistake in emitter.rs
2019-10-19 18:08:54 +01:00
Philipp Hansch
6c75e81561
Refactor: Rename db
locals to diag
...
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-15 08:19:43 +02:00
Esteban Küber
8bf6d35377
Tweak heuristics for less noise
2019-10-14 14:48:45 -07:00
Esteban Küber
6dd718ca79
Use heuristics for capitalization warning in suggestions
2019-10-14 14:32:10 -07:00
Esteban Küber
4bb771615e
Bring attention to suggestions when the only difference is capitalization
2019-10-13 21:48:39 -07:00
Tyler Mandry
c7d7e3730a
Rollup merge of #64909 - estebank:turbofish-reloaded, r=Centril
...
When encountering chained operators use heuristics to recover from bad turbofish
2019-10-05 21:54:52 -07:00
Esteban Küber
76456e7406
review comments
2019-10-03 19:32:56 -07:00
Esteban Küber
02f57f83a9
review comments
2019-10-03 13:22:18 -07:00
AnthonyMikh
df203a297f
Compare primary with value instead of dropping it
2019-10-02 19:48:21 +03:00
AnthonyMikh
50c2a58d08
Fix borrowck errors
...
Reborrowing doesn't work for loops
2019-10-01 03:22:07 +03:00
AnthonyMikh
fdce4168fc
Hint type for .sum()
2019-10-01 03:04:01 +03:00
AnthonyMikh
515262cc13
Ascript type explicitly
2019-10-01 02:53:44 +03:00
AnthonyMikh
61bc38ecaa
Fix errors
2019-10-01 02:38:35 +03:00
AnthonyMikh
e5db5b34d7
(fmt) remove trailing whitespaces
2019-10-01 02:30:52 +03:00
AnthonyMikh
bb442881fc
Use pattern matching instead of indexing tuples
2019-10-01 01:12:36 +03:00
AnthonyMikh
55b54285c8
Simplify a conditional in collect_annotations
...
Also avoid excessive cloning
2019-10-01 01:08:51 +03:00
AnthonyMikh
9d73176978
Remove redundant .iter_mut()
2019-10-01 00:10:23 +03:00
AnthonyMikh
7a807c5b14
Simplify EmitterWriter::emit_suggestion_default
...
Make function return early if source map is not present
2019-10-01 00:01:22 +03:00
AnthonyMikh
21724eda05
Update doc comment for style_or_override
2019-09-30 23:50:58 +03:00
AnthonyMikh
7b4c5c62aa
Simplify EmitterWriter::get_max_line_num
2019-09-30 23:47:51 +03:00
AnthonyMikh
6b6a79b190
Simplify EmitterWriter::get_multispan_max_line_num
2019-09-30 23:43:24 +03:00
AnthonyMikh
7dc953b493
Simplify code for special case of annotation
2019-09-30 23:33:17 +03:00
AnthonyMikh
75a7c27a54
Revert "Simplify Unicode-aware trimming"
...
`taken` is actually used afterwards
2019-09-27 00:58:18 +03:00
AnthonyMikh
7a0725fdaf
Simplify style_or_override
2019-09-26 00:42:55 +03:00
AnthonyMikh
ea32862503
Use sort_by_key
rather than sort_by
2019-09-26 00:38:36 +03:00
AnthonyMikh
f93827f9e4
Simplify Emitter::fix_multispan_in_std_macros
...
1. Rewrite `if let` into `match` to return earl and avoid indenting giant block
2. Assign `spans_updated` only once
2019-09-26 00:31:16 +03:00