| Age | Commit message (Collapse) | Author | Lines |
|
Extracted from work on #59346. This moves the annotation collection to
the `FileWithAnnotatedLines` impl to allow re-use in a separate
EmitterWriter.
|
|
librustc_errors: Remove unused annotation style `OldSchoolNoteText`
I could not find any references to it and the `snippet` module does not
seem to be exported publicly, so I think it can be safely removed.
This was originally removed in 17bd76a51 and I'm not sure why it is still there.
|
|
I could not find any references to it and the `snippet` module does not
seem to be exported publicly, so I think it can be safely removed.
|
|
This is easier for tooling to handle than trying to reverse-engineer it from the filename extension.
|
|
simplify the output.
|
|
To implement pipelining, Cargo needs to know when metadata generation is
finished. This commit adds code to do that. Unfortunately, metadata file
writing currently occurs very late during compilation, so pipelining
won't produce a speed-up. Moving metadata file writing earlier will be a
follow-up.
The change involves splitting the existing `Emitter::emit` method in
two: `Emitter::emit_diagnostic` and `Emitter::emit_directive`.
The JSON directives look like this:
```
{"directive":"metadata file written: liba.rmeta"}
```
The functionality is behind the `-Z emit-directives` option, and also
requires `--error-format=json`.
|
|
|
|
|
|
a bool
|
|
|
|
Distinguish message for external macros depending on error level
fixes #57716
(I picked you because assigned to this issue.)
r? @estebank
|
|
Remove unnecessary comment
|
|
|
|
|
|
When two multiline span labels point at the same span, we special
case the output to avoid weird behavior:
```
foo(
_____^
|_____|
|| bar,
|| );
|| ^
||______|
|______foo
baz
```
instead showing
```
foo(
_____^
| bar,
| );
| ^
| |
|______foo
baz
```
|
|
Hidden suggestion support
Add way to hide suggestion snippet window from cli output to avoid cluttered spans that don't enhance understanding.
r? @pietroalbini CC @zackmdavis
|
|
|
|
|
|
|
|
|
|
|
|
Deduplicate mismatched delimiter errors
Delay unmatched delimiter errors until after the parser has run to deduplicate them when parsing and attempt recovering intelligently.
Second attempt at #54029, follow up to #53949. Fix #31528.
|
|
Delay unmatched delimiter errors until after the parser has run to
deduplicate them when parsing and attempt recovering intelligently.
|
|
|
|
The emitter already verifies wether a given span note or span label
can be emitted to the output. If it can't, because it is a dummy
span, it will be either elided for labels or emitted as an unspanned
note/help when applicable.
|
|
|
|
* Update bootstrap compiler
* Update version to 1.33.0
* Remove some `#[cfg(stage0)]` annotations
Actually updating the version number is blocked on updating Cargo
|
|
Replace usages of `..i + 1` ranges with `..=i`.
Before this change we were using old computer code techniques. After this change we use the new and improved computer code techniques.
|
|
fixes remaining test failures
|
|
|
|
Currently Cargo will always capture the output of rustc meaning that
rustc is never hooked up to a tty. To retain colors Cargo uses the
`fwdansi` crate to ensure that ansi color codes are translated to
windows terminal methods (and ansi codes otherwise just go their natural
route on Unix).
Cargo passes `--color always` to rustc to ensure that using a pipe
doesn't trick it into not emitting colors at all. It turns out, however,
that `--color always` ends up still accidentally using the native shell
api on native windows shells.
The fix here is to instead pass `AlwaysAnsi` to `termcolor` instead of
`Always`, ensuring that when `--color always` is passed to rustc and its
output isn't a terminal, we're always generating ansi colors regardless
of the platform.
Closes #55769
|
|
|
|
|
|
or "".into()
|
|
|
|
|
|
|
|
|
|
Misc cleanups
|
|
|
|
|
|
|
|
|
|
Remove highlighting from secondary messages
Deemphasize the secondary messages so that all other highlights stand
out more.
<img width="684" alt="" src="https://user-images.githubusercontent.com/1606434/41261199-7b4fe96e-6d8f-11e8-8619-04d170617df2.png">
|
|
Enforce `#![deny(bare_trait_objects)]` in `src/librustc_errors`.
|
|
|
|
Deemphasize the secondary messages so that all other highlights stand
out more.
|
|
|
|
|
|
When suggesting code that has a shorter span than the current code,
account for this by keeping the offset as a signed value.
|