Commit Graph

251 Commits

Author SHA1 Message Date
Donato Sciarra
d6dcbcd4e1 mv FileMap SourceFile 2018-08-19 23:00:59 +02:00
Donato Sciarra
c655473378 mv CodeMap SourceMap 2018-08-19 23:00:59 +02:00
kennytm
62d70c9d47
Rollup merge of #53214 - memoryruins:nll_bootstrap_2, r=nikomatsakis
[nll] enable feature(nll) on various crates for bootstrap: part 2

#53172
2018-08-10 01:01:31 +08:00
memoryruins
80e8e97d93 [nll] librustc_errors: enable feature(nll) for bootstrap 2018-08-09 04:08:45 -04:00
ljedrz
44d32d4413 Avoid unnecessary pattern matching against Option and Result 2018-08-07 10:24:27 +02:00
Alex Crichton
ca762ba954 rustc: Disallow machine applicability in foreign macros
Recent changes to lints disallowed lints from being emitted against code located
in foreign macros, except for future-incompatible lints. For a future
incompatible lint, however, the automatic suggestions may not be applicable!

This commit updates this code path to force all applicability suggestions made
to foreign macros to never be `MachineApplicable`. This should avoid rustfix
actually attempting fixing these suggestions, causing non-compiling code to be
produced.

Closes rust-lang/cargo#5799
2018-07-30 07:48:59 -07:00
bors
a5c2d0fffa Auto merge of #52764 - sinkuu:cleanup, r=nikomatsakis
Misc cleanups
2018-07-29 06:32:24 +00:00
kennytm
59f8422a17
Rollup merge of #52781 - ljedrz:avoid_vec_arguments, r=nikomatsakis
Use a slice where a vector is not necessary
2018-07-28 16:25:07 +08:00
bors
4f1e235744 Auto merge of #52336 - ishitatsuyuki:dyn-rollup, r=Mark-Simulacrum
Rollup of bare_trait_objects PRs

All deny attributes were moved into bootstrap so they can be disabled with a line of config.

Warnings for external tools are allowed and it's up to the tool's maintainer to keep it warnings free.

r? @Mark-Simulacrum
cc @ljedrz @kennytm
2018-07-27 20:27:40 +00:00
ljedrz
1cca420435 Use slices where a vector is not necessary 2018-07-27 16:50:28 +02:00
Shotaro Yamada
8296699fae Remove unnecessary .collect() 2018-07-27 23:26:36 +09:00
Shotaro Yamada
3525368a56 Use str::repeat 2018-07-27 23:26:36 +09:00
bors
b18b9edf00 Auto merge of #52681 - pnkfelix:z-borrowck-migrate, r=nikomatsakis
Add `-Z borrowck=migrate`

This adds `-Z borrowck=migrate`, which represents the way we want to migrate to NLL under Rust versions to come. It also hooks this new mode into `--edition 2018`, which means we're officially turning NLL on in the 2018 edition.

The basic idea of `-Z borrowck=migrate` that there are cases where NLL is fixing old soundness bugs in the borrow-checker, but in order to avoid just breaking code by immediately rejecting the programs that hit those soundness bugs, we instead use the following strategy:

If your code is accepted by NLL, then we accept it.
If your code is rejected by both NLL and the old AST-borrowck, then we reject it.
If your code is rejected by NLL but accepted by the old AST-borrowck, then we emit the new NLL errors as **warnings**.

These warnings will be turned into hard errors in the future, and they say so in these diagnostics.

Fix #46908
2018-07-27 09:10:07 +00:00
Felix S. Klock II
a23e8a726c Add -Z borrowck=migrate flag, use it to link NLL up to AST-borrowck. 2018-07-26 13:17:55 +02:00
ljedrz
f653bf4fba Improve readability in a few sorts 2018-07-25 12:13:02 +02:00
Tatsuyuki Ishi
e098985939 Deny bare_trait_objects globally 2018-07-25 10:25:29 +09:00
Santiago Pastorino
3d3e0aa571 Buffer errors in MIR borrow check
(pnkfelix updated to address tidy, and to change the buffer from
`Vec<DiagnosticBuilder<'errs>>` to a `Vec<Diagnostic>` in order to
avoid painful lifetime maintenance.)
2018-07-23 14:20:12 +02:00
bors
02b0479c26 Auto merge of #52568 - oli-obk:span_bug_error, r=varkor
Fix loop label resolution around constants

And make `delay_span_bug` a little more helpful

r? @varkor

fixes #52442
fixes #52443
2018-07-23 01:02:32 +00:00
bors
0ad6179d3b Auto merge of #51485 - estebank:dehighlight-secondary-msgs, r=GuillaumeGomez
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">
2018-07-21 23:50:28 +00:00
Oliver Schneider
bab5eb41a7 Sequence-field should have plural name 2018-07-21 16:09:10 +02:00
Oliver Schneider
56c90774a9 Make sure the compiler actually panics on delay_span_bug
Even if that is just happening because of `abort_if_errors`
2018-07-20 15:59:21 +02:00
Eduard-Mihai Burtescu
c0adb05d34 proc_macro: don't use DiagnosticBuilder for building up Diagnostics. 2018-07-20 00:15:11 +03:00
ljedrz
033924464f Deny bare trait objects in src/librustc_errors
Enforce `#![deny(bare_trait_objects)]` in `src/librustc_errors`.
2018-07-14 07:23:32 +02:00
Vadim Petrochenkov
9f92fce77c Fortify dummy span checking 2018-06-30 01:53:32 +03:00
Esteban Küber
ed5dcc3118 Remove highlighting from secondary messages
Deemphasize the secondary messages so that all other highlights stand
out more.
2018-06-11 15:52:10 -07:00
Oliver Schneider
9a16bbd948 Also prevent overflow in debug builds 2018-06-03 11:24:58 +02:00
Guillaume Gomez
426b63f8a3 Make short-error format GNU compatible 2018-05-31 20:09:27 +02:00
bors
16cd84ee22 Auto merge of #50724 - zackmdavis:applicability_rush, r=Manishearth
add suggestion applicabilities to librustc and libsyntax

A down payment on #50723. Interested in feedback on whether my `MaybeIncorrect` vs. `MachineApplicable` judgement calls are well-calibrated (and that we have a consensus on what this means).

r? @Manishearth
cc @killercup @estebank
2018-05-28 10:11:26 +00:00
Esteban Küber
50eefc0d77 Account for negative offsets in suggestions
When suggesting code that has a shorter span than the current code,
account for this by keeping the offset as a signed value.
2018-05-24 04:16:54 -07:00
Esteban Küber
2daa013290 Underline multiple suggested replacements in the same line
Follow up to #50943.

Fix #50977.
2018-05-24 04:16:13 -07:00
Oliver Schneider
af75ebdc3a Improve the diagnostic around impl Trait <-> generic param mismatch 2018-05-21 18:06:28 +02:00
Zack M. Davis
6bb4aad51f introducing span_suggestion_short_with_applicability
Some would argue that this 40-character method name is ludicrously
unwieldy (even ironic), but it's the unique continuation of the
precedent set by the other suggestion methods. (And there is some hope
that someday we'll just fold `Applicability` into the signature of the
"basic" method `span_suggestion`.)

This is in support of #50723.
2018-05-20 12:57:19 -07:00
Andre Bogus
e333725664 use fmt::Result where applicable 2018-05-09 02:01:37 +02:00
Manish Goregaokar
4e2cd4104a Approximate -> Applicability 2018-04-25 14:55:25 -07:00
Manish Goregaokar
b9c44ebd3f Use enum for approximate suggestions 2018-04-24 15:42:27 -07:00
John Kåre Alsaker
bf06a53265 Make Handler more thread-safe 2018-04-17 16:43:30 +02:00
bors
49317cd511 Auto merge of #49130 - smmalis37:range, r=alexcrichton
Move Range*::contains to a single default impl on RangeBounds

Per the ongoing discussion in #32311.

This is my first PR to Rust (woo!), so I don't know if this requires an amendment to the original range_contains RFC, or not, or if we can just do a psuedo-RFC here. While this may no longer follow the explicit decision made in that RFC, I believe this better follows its spirit by adding the new contains method to all Ranges. It also allows users to be generic over all ranges and use this method without writing it themselves (my personal desired use case).

This also somewhat answers the unanswered question about Wrapping ranges in the above issue by instead just punting it to the question of what those types should return for start() & end(), or if they should implement RangeArgument at all. Those types could also implement their own contains method without implementing this trait, in which case the question remains the same.

This does add a new contains method to types that already implemented RangeArgument but not contains. These types are RangeFull, (Bound<T>, Bound<T>), (Bound<&'a T>, Bound<&'a T>). No tests have been added for these types yet. No inherent method has been added either.

r? @alexcrichton
2018-04-16 16:07:10 +00:00
Mark Simulacrum
c115cc655c Move deny(warnings) into rustbuild
This permits easier iteration without having to worry about warnings
being denied.

Fixes #49517
2018-04-08 16:59:14 -06:00
Steven Malis
f5a367c7bb Update based on RangeBounds trait being moved to libcore. 2018-04-07 15:47:18 -07:00
bors
8c2d7b2da3 Auto merge of #49661 - alexcrichton:bump-bootstrap, r=nikomatsakis
Bump the bootstrap compiler to 1.26.0 beta

Holy cow that's a lot of `cfg(stage0)` removed and a lot of new stable language
features!
2018-04-07 11:58:38 +00:00
John Kåre Alsaker
4fd188e5f3 Print query stack on ICEs 2018-04-06 16:23:31 +02:00
bors
7222241e7c Auto merge of #49045 - Zoxc:tls, r=michaelwoerister
Make queries thread safe

This makes queries thread safe by removing the query stack and making queries point to their parents. Queries write to the query map when starting and cycles are detected by checking if there's already an entry in the query map. This makes cycle detection O(1) instead of O(n), where `n` is the size of the query stack.

This is mostly corresponds to the method I described [here](https://internals.rust-lang.org/t/parallelizing-rustc-using-rayon/6606).

cc @rust-lang/compiler

r? @michaelwoerister
2018-04-05 16:38:15 +00:00
Alex Crichton
8958815916 Bump the bootstrap compiler to 1.26.0 beta
Holy cow that's a lot of `cfg(stage0)` removed and a lot of new stable language
features!
2018-04-05 07:13:45 -07:00
Mark Mansi
7ce8191775 Stabilize i128_type 2018-03-26 08:36:50 -05:00
Taylor Cramer
0f5b52e4a8 Stabilize conservative_impl_trait 2018-03-26 10:43:03 +02:00
kennytm
9c5f372a9a
Rollup merge of #49046 - Zoxc:error-summary, r=michaelwoerister
Always print `aborting due to n previous error(s)`

r? @michaelwoerister
2018-03-25 01:26:24 +08:00
John Kåre Alsaker
29a4ec0d43 Make queries thread safe. Remove the query stack and make queries point to their parents instead. 2018-03-24 05:21:50 +01:00
John Kåre Alsaker
910bf840cc Always print aborting due to n previous error(s) and only print it once for multi-threaded code 2018-03-16 11:25:37 +01:00
John Kåre Alsaker
8395ce9451 Require the code mapper to be thread-safe 2018-03-15 00:43:03 +01:00
Guillaume Gomez
8c75e18e5d test for putting back check on json 2018-03-14 00:52:17 +01:00