Commit Graph

334 Commits

Author SHA1 Message Date
Nicholas Nethercote 7bcb0cffb6 In JSON output, emit a directive after metadata is generated.
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`.
2019-04-30 08:51:57 +10:00
Xavier Denis 4a073dda93 Fix #58270, fix off-by-one error in error diagnostics. 2019-04-22 18:14:45 -05:00
Andy Russell b6f148c8bd hide --explain hint if error has no extended info 2019-04-18 13:29:28 -04:00
bors 6ed6f1461d Auto merge of #60034 - rasendubi:fix-comments, r=Centril
Small comments fix

- Fix comments around test harness generation
- Promote regular comments to rustdoc comments
2019-04-17 13:26:29 +00:00
Alexey Shmalko 56c0125568 Promote regular comments to rustdoc comments 2019-04-17 12:03:39 +03:00
Mazdak Farrokhzad c89bc54d4f Rollup merge of #59128 - oli-obk:colorful_json, r=mark-i-m,eddyb
Emit ansi color codes in the `rendered` field of json diagnostics

cc @ljedrz

Implemented for https://github.com/rust-lang/rust/pull/56595#issuecomment-447645115 (x.py clippy)
2019-04-17 10:31:30 +02:00
Mateusz Mikuła 87e4b43d51 Deny internal in stage0 2019-04-17 05:15:00 +02:00
Oliver Scherer 325936ac20 Do not render ascii colors to buffers 2019-04-09 20:43:54 +02:00
flip1995 d3f0cb9b62 Deny internal lints on non conflicting crates
- libarena
- librustc_allocator
- librustc_borrowck
- librustc_codegen_ssa
- librustc_codegen_utils
- librustc_driver
- librustc_errors
- librustc_incremental
- librustc_metadata
- librustc_passes
- librustc_privacy
- librustc_resolve
- librustc_save_analysis
- librustc_target
- librustc_traits
- libsyntax
- libsyntax_ext
- libsyntax_pos
2019-04-03 18:24:21 +02:00
Oliver Scherer 39b21376db Rename colorful-json to json-rendered and make it a selection instead of a bool 2019-04-02 16:14:59 +02:00
Oliver Scherer 96404ee844 Emit ansi color codes in the rendered field of json diagnostics 2019-04-02 16:14:58 +02:00
Mazdak Farrokhzad dffdd8f728 Rollup merge of #58805 - fabric-and-ink:redundant_import, r=petrochenkov
Lint for redundant imports

Add lint for redundant imports. The changes are suggested by @petrochenkov.

Closes #10178.
2019-03-31 19:19:47 +02:00
Mazdak Farrokhzad fb8396da84 Rollup merge of #59574 - JohnTitor:distinguish-error-vs-warning, r=Centril
Distinguish message for external macros depending on error level

fixes #57716

(I picked you because assigned to this issue.)
r? @estebank
2019-03-31 16:10:38 +02:00
Yuki OKUSHI 45c82abf13 Distinguish depending on error level
Remove unnecessary comment
2019-03-31 07:51:31 +09:00
Fabian Drinck 541c4999a9 Remove redundant imports 2019-03-30 22:37:02 +01:00
Esteban Küber b5690c2cb8 Fix MultilineAnnotation field name 2019-03-28 20:19:50 -07:00
Esteban Küber 8fad69c200 Add comemnts clarifying logic 2019-03-28 20:18:50 -07:00
Esteban Küber e13e9a5d63 review comments 2019-03-28 20:03:13 -07:00
Esteban Küber 326ec800b9 Account for fully overlapping multiline annotations
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
```
2019-03-27 19:35:30 -07:00
Esteban Küber 9bfb0ef818 Tweak unsupported negative trait bounds message 2019-03-23 13:05:30 -07:00
Steven Malis 266ca31f74 Stabilize Range*::contains. 2019-03-12 21:00:37 -07:00
Esteban Küber a7563a30c0 fix bad logic 2019-03-07 08:46:18 -08:00
Esteban Küber c41ddf1773 Keep current behavior while accepting error count 2019-03-07 03:17:39 -08:00
Esteban Küber 7a55a004fa Make -Z treat-err-as-bug take a number of errors to be emitted
`-Z treat-err-as-bug=0` will cause `rustc` to panic after the first
error is reported. `-Z treat-err-as-bug=2` will cause `rustc` to
panic after 3 errors have been reported.
2019-03-06 19:51:32 -08:00
Taiki Endo 871910a2c6 Use ? in some macros 2019-02-24 21:59:44 +09:00
Mazdak Farrokhzad 56e19160af Rollup merge of #58296 - estebank:hidden-suggestion, r=oli-obk
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
2019-02-14 02:41:21 +01:00
bors b244f61b77 Auto merge of #58341 - alexreg:cosmetic-2-doc-comments, r=steveklabnik
Cosmetic improvements to doc comments

This has been factored out from https://github.com/rust-lang/rust/pull/58036 to only include changes to documentation comments (throughout the rustc codebase).

r? @steveklabnik

Once you're happy with this, maybe we could get it through with r=1, so it doesn't constantly get invalidated? (I'm not sure this will be an issue, but just in case...) Anyway, thanks for your advice so far!
2019-02-12 19:09:24 +00:00
Esteban Küber 87dd2e1df9 Use hidden suggestions for unused imports lint 2019-02-11 11:16:22 -08:00
Esteban Küber 235523c7d4 Add way to completely hide suggestion from cli output 2019-02-11 10:01:40 -08:00
Esteban Küber 7cfba1c5e8 Never inline HideCodeAlways suggestions 2019-02-11 10:01:40 -08:00
Esteban Küber 6ea159ea7e Expose hidden snippet suggestions 2019-02-11 10:01:40 -08:00
Esteban Küber 05b4e7c8a9 Add way to hide suggestion snippet window from cli output 2019-02-11 10:01:40 -08:00
Alexander Regueiro c3e182cf43 rustc: doc comments 2019-02-10 23:42:32 +00:00
Taiki Endo 2be0993c4e Revert removed #![feature(nll)] 2019-02-10 16:13:30 +09:00
bors 3315728c06 Auto merge of #57944 - estebank:unclosed-delim-the-quickening, r=oli-obk
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.
2019-02-09 20:15:57 +00:00
Guillaume Gomez 8b886e07f5 Remove images' url to make it work even without internet connection 2019-02-07 11:06:19 +01:00
Esteban Küber 7451cd8dc0 Deduplicate mismatched delimiter errors
Delay unmatched delimiter errors until after the parser has run to
deduplicate them when parsing and attempt recovering intelligently.
2019-02-07 01:41:30 -08:00
Taiki Endo 950fe6686d librustc_errors => 2018 2019-02-07 03:53:01 +09:00
Andy Russell 0897ffc28f remove _with_applicability from suggestion fns 2019-01-26 23:07:55 -05:00
Andy Russell 8eaa84c79f document Applicability 2019-01-26 23:06:08 -05:00
Esteban Küber c4b8df5df2 Remove unnecessary dummy span checks
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.
2019-01-20 13:29:03 -08:00
Mazdak Farrokhzad e78bde4015 Rollup merge of #57699 - euclio:applicability-ify, r=petrochenkov
add applicability to remaining suggestions

Fixes #50723.

I noticed that the suggestion methods on `DiagnosticBuilder` weren't actually deprecated due to #57679. This PR deprecates them properly and fixes the remaining usages.

There's also a PR for clippy at rust-lang/rust-clippy#3667.
2019-01-19 14:21:23 +01:00
Dan Robertson e3ba6ed3f5 Fix suggestions given mulitple bad lifetimes
When given multiple lifetimes prior to type parameters in generic
parameters, do not ICE and print the correct suggestion.
2019-01-18 01:10:14 +00:00
Andy Russell 02843d9eb7 properly deprecate suggestion methods 2019-01-17 10:18:56 -05:00
John Kåre Alsaker 03b7cec2de Replace LockCell with atomic types 2018-12-29 12:46:37 +01:00
Mark Rousskov 2a663555dd Remove licenses 2018-12-25 21:08:33 -07:00
Alex Crichton cf47a19305 Bump to 1.33.0
* Update bootstrap compiler
* Update version to 1.33.0
* Remove some `#[cfg(stage0)]` annotations

Actually updating the version number is blocked on updating Cargo
2018-12-12 08:09:26 -08:00
kennytm 0e41ef13aa Rollup merge of #56516 - frewsxcv:frewsxcv-eq, r=Mark-Simulacrum
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.
2018-12-07 12:42:32 +08:00
Matthew Russo f0f8aa9e05 adds DocTest filename variant, refactors doctest_offset out of source_map, fixes remaining test failures 2018-12-04 19:52:42 -05:00
Corey Farwell c025d61409 Replace usages of ..i + 1 ranges with ..=i. 2018-12-04 12:05:19 -08:00