about summary refs log tree commit diff
path: root/src/librustc
AgeCommit message (Collapse)AuthorLines
2019-11-15Changed unused_labels lint default from allow to warnBart Massey-1/+1
Closes #66324.
2019-11-15Cleaned up unused labelsBart Massey-1/+1
Deleted unused labels from compiler and fixed or allowed unused labels in tests. This patch removes some gratuitous unused labels and turns off the warning for unused labels that are a necessary part of tests. This will permit setting the `unused_labels` lint to `warn`.
2019-11-15Fix nits from reviewDylan MacKenzie-4/+8
2019-11-15Use a bespoke type for the result of `mir_const_qualif`Dylan MacKenzie-1/+8
2019-11-15Remove -Z flag for suppressing validation mismatch ICEDylan MacKenzie-2/+0
2019-11-15Rollup merge of #66427 - Mark-Simulacrum:errors-json, r=CentrilMazdak Farrokhzad-1/+1
Move the JSON error emitter to librustc_errors This is done both as a cleanup (it makes little sense for this emitter to be in libsyntax), but also as part of broader work to decouple Session from librustc itself. Along the way, this also moves SourceMap to syntax_pos, which is also nice for the above reasons, as well as allowing dropping the SourceMapper trait from code. This had the unfortunate side-effect of moving `FatalError` to rustc_data_structures (it's needed in syntax_pos, due to SourceMap, but putting it there feels somehow worse).
2019-11-15Move JSON emitter to rustc_errorsMark Rousskov-1/+1
2019-11-15Rollup merge of #66435 - JohnTitor:fix-spelling, r=CentrilTyler Mandry-4/+4
Correct `const_in_array_repeat_expressions` feature name Fixes #66433 r? @estebank
2019-11-15Rollup merge of #66197 - Centril:transparent-ast, r=varkorTyler Mandry-31/+37
Push `ast::{ItemKind, ImplItemKind}::OpaqueTy` hack down into lowering We currently have a hack in the form of `ast::{ItemKind, ImplItemKind}::OpaqueTy` which is constructed literally when you write `type Alias = impl Trait;` but not e.g. `type Alias = Vec<impl Trait>;`. Per https://github.com/rust-lang/rfcs/pull/2515, this needs to change to allow `impl Trait` in nested positions. This PR achieves this change for the syntactic aspect but not the semantic one, which will require changes in lowering and def collection. In the interim, `TyKind::opaque_top_hack` is introduced to avoid knock-on changes in lowering, collection, and resolve. These hacks can then be removed and fixed one by one until the desired semantics are supported. r? @varkor
2019-11-15Rollup merge of #66410 - RalfJung:miri-machine-max, r=oli-obkYuki Okushi-0/+13
miri: helper methods for max values of machine's usize/isize We recently wanted this in Miri. r? @oli-obk
2019-11-15Rollup merge of #66390 - estebank:parenice, r=CentrilYuki Okushi-9/+10
Fix ICE when trying to suggest `Type<>` instead of `Type()` Fixes #66286, but the output has no span: ``` error[E0214]: parenthesized type parameters may only be used with a `Fn` trait error: aborting due to previous error For more information about this error, try `rustc --explain E0214`. ```
2019-11-15Rollup merge of #66013 - nnethercote:avoid-hashing-twice-in-get_query, r=ZoxcYuki Okushi-3/+14
Avoid hashing the key twice in `get_query()`. For a single-threaded parallel compiler, this reduces instruction counts across several benchmarks, by up to 2.8%. The commit also adds documentation about `Sharded`'s use of `FxHasher`. r? @Zoxc
2019-11-15Correct `const_in_array_repeat_expressions` feature nameYuki Okushi-4/+4
2019-11-14Use multiple derive clauses.Camille GILLOT-34/+34
2019-11-14TAIT: use hack in ->HIR to avoid more changesMazdak Farrokhzad-31/+37
2019-11-14Clean some error codes diagnosticsGuillaume Gomez-16/+28
2019-11-14Remove unused error_codes.rs filesGuillaume Gomez-2394/+0
2019-11-14Update to use new librustc_error_codes libraryGuillaume Gomez-2/+47
2019-11-14miri: helper methods for max values of machine's usize/isizeRalf Jung-0/+13
2019-11-14Auto merge of #66403 - JohnTitor:rollup-7obuivl, r=JohnTitorbors-2/+10
Rollup of 9 pull requests Successful merges: - #66253 (Improve errors after re rebalance coherence) - #66264 (fix an ICE in macro's diagnostic message) - #66349 (expand source_util macros with def-site context) - #66351 (Tweak non-char/numeric in range pattern diagnostic) - #66360 (Fix link to Exten in Vec::set_len) - #66361 (parser: don't use `unreachable!()` in `fn unexpected`.) - #66363 (Improve error message in make_tests) - #66369 (compiletest: Obtain timestamps for common inputs only once) - #66372 (Fix broken links in Ipv4Addr::is_benchmarking docs) Failed merges: r? @ghost
2019-11-14Rollup merge of #66253 - ↵Yuki Okushi-2/+10
ohadravid:improve-errors-after-re-rebalance-coherence, r=estebank Improve errors after re rebalance coherence Following #65247, I noticed that some error messages should be updated to reflect the changes of `re_rebalance_coherence` (also there was a [note](https://rust-lang.github.io/rfcs/2451-re-rebalancing-coherence.html#teaching-users) in the RFC about it). First, error message `E0210` was updated to match the RFC, and I also tried to improve a little the error when the "order" of types is problematic. For code like this: ``` #![feature(re_rebalance_coherence)] // Now stable struct Wrap<T>(T); impl<T> From<Wrap<T>> for T { fn from(x: Wrap<T>) -> T { x.0 } } ``` The old error was: ``` error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct<T>`) --> src/lib.rs:5:6 | 5 | impl<T> From<Wrap<T>> for T { | ^ type parameter `T` must be used as the type parameter for some local type | = note: only traits defined in the current crate can be implemented for a type parameter ``` and the new error is: ``` error[E0210]: type parameter `T` must be covered by another type when it appears before the first local type (`Wrap<T>`) --> main.rs:66:6 | 66 | impl<T> From<Wrap<T>> for T { | ^ type parameter `T` must be covered by another type when it appears before the first local type (`Wrap<T>`) | = note: implementing a foreign trait is only possible if at least one of the types for which is it implemented is local, and no uncovered type parameters appear before that first local type = note: in this case, 'before' refers to the following order: `impl<..> ForeignTrait<T1, ..., Tn> for T0`, where `T0` is the first and `Tn` is the last ``` I tried to point at the uncovered `T`, but couldn't get something which was reliable (but I'll be happy to try if someone points me in the right direction). r? @estebank cc @nikomatsakis Fixes #65247
2019-11-14Auto merge of #66233 - cjgillot:constkind, r=oli-obkbors-196/+206
Split ConstValue into two enums Hello, Issue #59210 appeared abandoned, so I gave it a go. Some further cleanup and refactoring may be mandated. I did not test beyond `x.py check`, since my home computer dies compiling librustc. Fixes #59210
2019-11-13Fix ICE when trying to suggest `Type<>` instead of `Type()`Esteban Küber-9/+10
2019-11-13Retire BraceStructTypeFoldableImpl and TupleStructTypeFoldableImpl.Camille GILLOT-56/+1
2019-11-13Use TypeFoldable derive macro.Camille GILLOT-688/+90
2019-11-13Add HIR pass to check for `if`s and `loop`s in a `const`Dylan MacKenzie-0/+5
These high-level constructs get mapped to control-flow primitives by the time the MIR const-checker runs, making it hard to get the span for the erroneous expression.
2019-11-13Get `FnSig` by `HirId`Dylan MacKenzie-0/+35
2019-11-13Rollup merge of #66337 - Mark-Simulacrum:no-decode-lint-id, r=Dylan-DPCYuki Okushi-26/+1
Remove dead code for encoding/decoding lint IDs This helps decouple the lint system from needing the implicit TLS TyCtxt as well.
2019-11-13Rollup merge of #66335 - Mark-Simulacrum:self-profile-to-data, ↵Yuki Okushi-322/+18
r=michaelwoerister Move self-profile infrastructure to data structures The single dependency on queries (QueryName) can be fairly easily abstracted via a trait and this further decouples Session from librustc (the primary goal). This is intended as a precursor to moving Session out of librustc, but since that involves lots of smaller steps that move around code I'm splitting it up into separate PRs.
2019-11-13Rollup merge of #66334 - Mark-Simulacrum:sess-cstore, r=petrochenkovYuki Okushi-10/+12
Move Session fields to CrateStore `allocator_kind` and `injected_panic_runtime` are both query-like, this moves them out of Session and into CrateStore, avoiding the `Once` they previously had by clearing separating initialization and de-initialization.
2019-11-13Rollup merge of #66186 - GuillaumeGomez:long-err-explanation-E0623, r=Dylan-DPCYuki Okushi-1/+45
Add long error explanation for E0623 Part of #61137. r? @Dylan-DPC
2019-11-13tidy up!Dylan DPC-2/+2
2019-11-13Update error_codes.rsDylan DPC-3/+5
2019-11-12Snap cfgsMark Rousskov-2/+0
2019-11-12Centril review.Camille GILLOT-4/+1
2019-11-12Remove cruft.Camille GILLOT-15/+0
2019-11-12Refactor pretty_print_const.Camille GILLOT-18/+41
2019-11-12Create intermediate enum ty::ConstKind.Camille GILLOT-200/+205
2019-11-12Register queries with self profiler in rustc_interfaceMark Rousskov-2/+3
2019-11-12Remove dead code for encoding/decoding lint IDsMark Rousskov-26/+1
This helps decouple the lint system from needing the implicit TLS TyCtxt as well.
2019-11-12Auto merge of #65608 - matthewjasper:mir-eval-order, r=pnkfelixbors-3/+11
Fix MIR lowering evaluation order and soundness bug * Fixes a soundness issue with built-in index operations * Ensures correct evaluation order of assignment expressions where the RHS is a FRU or is a use of a local of reference type. * Removes an unnecessary symbol to string conversion closes #65909 closes #65910
2019-11-12Move self-profile infrastructure to data structuresMark Rousskov-321/+16
The single dependency on queries (QueryName) can be fairly easily abstracted via a trait and this further decouples Session from librustc (the primary goal).
2019-11-13update suggestion ui testcsmoe-10/+22
2019-11-12Rollup merge of #66299 - rossmacarthur:fix-41260-avoid-issue-0, r=varkorYuki Okushi-7/+9
support issue = "none" in unstable attributes This works towards fixing #41260. This PR allows the use of `issue = "none"` in unstable attributes and makes changes to internally store the issue number as an `Option<NonZeroU32>`. For example: ```rust #[unstable(feature = "unstable_test_feature", issue = "none")] fn unstable_issue_none() {} ``` It was not made optional because feedback seen here #60860 suggested that people might forget the issue field if it was optional. I could not remove the current uses of `issue = "0"` (of which there are a lot) because the stage 0 compiler expects the old syntax. Once this is available in the stage 0 compiler we can replace all uses of `"0"` with `"none"` and no longer allow `"0"`. This is my first time contributing, so I'm not sure what the protocol is with two-part things like this, so some guidance would be appreciated. r? @varkor
2019-11-12Rollup merge of #66276 - Mark-Simulacrum:sess-code-stats, r=nikomatsakisYuki Okushi-13/+15
Move lock into CodeStats Prevent (theoretical) accidental too-long borrows by ensuring only encapsulated locking.
2019-11-11Fix soundness issue with index bounds checksMatthew Jasper-3/+11
An expression like `x[1][{ x = y; 2}]` would perform the bounds check for the inner index operation before evaluating the outer index. This would allow out of bounds memory accesses.
2019-11-11Move allocator_kind to CrateStoreMark Rousskov-7/+7
Similarly to the previous commit, there's no need for this to be in Session and have a Once around it.
2019-11-11Move injected_panic_runtime to CrateStoreMark Rousskov-3/+5
This was essentially a "query" previously (with no key, just always run once when resolving the crate dependencies), and remains so, just now in a way that isn't on Session. This removes the need for the `Once` as well.
2019-11-11support issue = "none" in unstable attributesRoss MacArthur-7/+9
- Use `Option<NonZeroU32>` to represent issue numbers.
2019-11-11Auto merge of #66252 - cjgillot:trees, r=oli-obkbors-245/+96
Merge repeated definitions Step forward on #66149 I may need further context to understand the need for a separate crate. Also, please tell me if you think of other definitions to merge.