about summary refs log tree commit diff
path: root/src/librustc_data_structures
AgeCommit message (Collapse)AuthorLines
2020-02-04Remove unused feature gates from librustc_data_structuresbjorn3-3/+0
2020-02-02Fix bootstrap rustc buildJonas Schievink-0/+39
2020-02-01Use BufWriterShotaro Yamada-1/+2
2020-01-24[self-profiler] Clean up `EventFilter`Wesley Wiser-7/+3
2020-01-24[self-profiler] Use `ThreadId::as_u64()` instead of transmuteWesley Wiser-7/+3
2020-01-23unused-parens: implement for block return valuesTyler Lanphear-1/+1
2020-01-22Use a `ParamEnvAnd<Predicate>` for caching in `ObligationForest`Aaron Hill-15/+20
Previously, we used a plain `Predicate` to cache results (e.g. successes and failures) in ObligationForest. However, fulfillment depends on the precise `ParamEnv` used, so this is unsound in general. This commit changes the impl of `ForestObligation` for `PendingPredicateObligation` to use `ParamEnvAnd<Predicate>` instead of `Predicate` for the associated type. The associated type and method are renamed from 'predicate' to 'cache_key' to reflect the fact that type is no longer just a predicate.
2020-01-17Rollup merge of #68278 - wesleywiser:doc_query_key_recording, r=michaelwoeristerDylan DPC-0/+2
[self-profiler] Add example to `-Z help` to turn on query key recording Also add the `default` option so that it's easy to add query key recording to the default. r? @michaelwoerister
2020-01-17Rollup merge of #67791 - Zoxc:lift-interning, r=eddybDylan DPC-0/+14
Implement Lift using interners instead of in_arena r? @eddyb cc @cjgillot
2020-01-17[self-profiler] Add example to `-Z help` to turn on query key recordingWesley Wiser-0/+2
Also add the `default` option so that it's easy to add query key recording to the default.
2020-01-15Rollup merge of #68141 - euclio:replace-bindings-with-winapi, r=alexcrichtonYuki Okushi-67/+19
use winapi for non-stdlib Windows bindings
2020-01-12Rollup merge of #67948 - llogiq:gallop, r=Mark-SimulacrumMazdak Farrokhzad-20/+40
Galloping search for binary_search_util This is unlikely to improve perf much unless for synthetic benchmarks, but I figure it likely won't hurt either.
2020-01-11use winapi for non-stdlib Windows bindingsAndy Russell-67/+19
2020-01-12Galloping search for binary_search_utilAndre Bogus-20/+40
2020-01-11Lift using interners instead of in_arenaJohn Kåre Alsaker-0/+14
2020-01-11Rollup merge of #68043 - Zoxc:missing-timers, r=wesleywiserMazdak Farrokhzad-0/+6
Add some missing timers Based on https://github.com/rust-lang/rust/pull/67988 r? @wesleywiser
2020-01-10Fix some rebasing fallout.Michael Woerister-3/+6
2020-01-10Update measureme to 0.7.1 in order to fix compilation error on big-endian ↵Michael Woerister-1/+1
platforms.
2020-01-10Run 'x.py fmt'.Michael Woerister-22/+7
2020-01-10self-profile: Fix issue with handling query blocking.Michael Woerister-0/+1
2020-01-10Initial support for recording query keys in self-profiling data.Michael Woerister-9/+39
2020-01-10self-profile: Switch to new approach for event_id generation that enables ↵Michael Woerister-32/+161
query-invocation-specific event_ids.
2020-01-10Rollup merge of #67922 - Centril:lowering-cleanup, r=petrochenkovMazdak Farrokhzad-0/+11
rustc_ast_lowering: misc cleanup & rustc dep reductions - The first two commits do some code simplification. - The next three do some file splitting (getting `lib.rs` below the 3kloc tidy lint). - The remaining commits reduce the number of `rustc::` imports. This works towards making lowering independent of the `rustc` crate. r? @oli-obk cc @Zoxc
2020-01-09Label unmarked timeJohn Kåre Alsaker-0/+6
2020-01-09{rustc::util -> rustc_data_structures}::capturesMazdak Farrokhzad-0/+11
2020-01-09More commentsJohn Kåre Alsaker-2/+6
2020-01-09Change -Z time event naming scheme and make them generic activitiesJohn Kåre Alsaker-92/+47
2020-01-05Rollup merge of #67882 - euclio:flock, r=rkruppeDylan DPC-106/+15
remove bespoke flock bindings Replaces some `struct flock` definitions with the definition from `libc`.
2020-01-05Use self profile infrastructure for -Z time and -Z time-passesJohn Kåre Alsaker-19/+213
2020-01-04remove bespoke flock bindingsAndy Russell-106/+15
2020-01-04define_id_collections -> rustc_data_structuresMazdak Farrokhzad-0/+8
2019-12-31Revert parts of #66405.Nicholas Nethercote-111/+80
Because it caused major performance regressions in some cases. That PR had five commits, two of which affected performance, and three of which were refactorings. This change undoes the performance-affecting changes, while keeping the refactorings in place. Fixes #67454.
2019-12-29Auto merge of #67614 - Mark-Simulacrum:global-callbacks, r=Zoxcbors-0/+28
Set callbacks globally This sets the callbacks from syntax and rustc_errors just once, utilizing static (rather than thread-local) storage.
2019-12-26Convert collapsed to shortcut reference linksMatthew Kraai-5/+5
2019-12-25Store callbacks in global staticsMark Rousskov-0/+28
The callbacks have precisely two states: the default, and the one present throughout almost all of the rustc run (the filled in value which has access to TyCtxt). We used to store this as a thread local, and reset it on each thread to the non-default value. But this is somewhat wasteful, since there is no reason to set it globally -- while the callbacks themselves access TLS, they do not do so in a manner that fails in when we do not have TLS to work with.
2019-12-22Format the worldMark Rousskov-1286/+1278
2019-12-17Revert "Auto merge of #67362 - Mark-Simulacrum:par-4-default, r=alexcrichton"Mark Rousskov-4/+1
This reverts commit 3ed3b8bb7b100afecf7d5f52eafbb70fec27f537, reversing changes made to 99b89533d4cdf7682ea4054ad0ee36c351d05df1. We will reland a similar patch at a future date but for now we should get a nightly released in a few hours with the parallel patch, so this should be reverted to make sure that the next nightly is not parallel-enabled.
2019-12-17Move AtomicU64 usage to AtomicUsizeMark Rousskov-1/+4
2019-12-13Avoid re-processing nodes in `find_cycles_from_node`.Nicholas Nethercote-4/+8
2019-12-13Remove an unnecessary local variable.Nicholas Nethercote-2/+1
2019-12-13Remove some `debug!` statements.Nicholas Nethercote-19/+1
Because I am tired of looking at them.
2019-12-13Move functions around.Nicholas Nethercote-59/+59
In particular, it has bugged me for some time that `process_cycles` is currently located before `mark_still_waiting_nodes` despite being called afterwards.
2019-12-13Remove `NodeState::{Waiting,Done}`.Nicholas Nethercote-87/+126
`NodeState` has two states, `Success` and `Done`, that are only used within `ObligationForest` methods. This commit removes them, and renames the existing `Waiting` state as `Success`. We are left with three states: `Pending`, `Success`, and `Error`. `Success` is augmented with a new `WaitingState`, which indicates when (if ever) it was last waiting on one or more `Pending` nodes. This notion of "when" requires adding a "process generation" to `ObligationForest`; it is incremented on each call to `process_obligtions`. This commit is a performance win. - Most of the benefit comes from `mark_as_waiting` (which the commit renames as `mark_still_waiting_nodes`). This function used to do two things: (a) change all `Waiting` nodes to `Success`, and (b) mark all nodes that depend on a pending node as `Waiting`. In practice, many nodes went from `Waiting` to `Success` and then immediately back to `Waiting`. The use of generations lets us skip step (a). - A smaller benefit comes from not having to change nodes to the `Done` state in `process_cycles`.
2019-12-11Make TinyList::remove iterate instead of recurseAndre Bogus-24/+16
2019-12-09Auto merge of #67016 - lqd:placeholder_loans, r=matthewjasperbors-0/+8
In which we implement illegal subset relations errors using Polonius This PR is the rustc side of implementing subset errors using Polonius. That is, in ```rust fn foo<'a, 'b>(x: &'a u32, y: &'b u32) -> &'a u32 { y } ``` returning `y` requires that `'b: 'a` but we have no evidence of that, so this is an error. (Evidence that the relation holds could come from explicit bounds, or via implied bounds). Polonius outputs one such error per CFG point where the free region's placeholder loan unexpectedly flowed into another free region. While all these CFG locations could be useful in diagnostics in the future, rustc does not do that (and the duplication is only partially handled in the rest of the errors/diagnostics infrastructure, e.g. duplicate suggestions will be shown by the "outlives suggestions" or some of the `#[rustc_*]` NLL/MIR debug dumps), so I deduplicated the errors. (The ordering also matters, otherwise some of the elided lifetime naming would change behaviour). I've blessed a couple of tests, where the output is currently suboptimal: - the `hrtb-perfect-forwarding` tests mix subset errors with higher-ranked subtyping, however the plan is for chalk to eventually take care of some of this to generate polonius constraints (i.e. it's not polonius' job). Until that happens, polonius will not see the error that NLL sees. - some other tests have errors and diagnostics specific to `'static`, I _believe_ this to be because of it being treated as more "special" than in polonius. I believe the output is not wrong, but could be better, and appears elsewhere (I feel we'll need to look at polonius' handling of `'static` at some point in the future, maybe to match a bit more what NLL does when it produces errors) I'll create a tracking issue in the polonius repo to record these 2 points (and a general "we'll need to go over the blessed output" issue, much like we did for NLLs) The last blessed test is because it's an improvement: in this case, more errors/suggestions were computed, instead of the existing code path where this case apparently stops at the first error. The `Naive` variant in Polonius computes those errors, so this PR also switches the default variant to that, as we're also in the process of temporarily deactivating all other variants (which exist mostly for performance considerations) until we have completed more work on completeness and correctness, before focusing on efficiency once again. While most of the correctness in this PR is hidden in the polonius compare-mode (which of course passes locally), I've added a couple of smoke-tests to the existing ones, so that we have some confidence that it works (and keeps working) until we're in a position where we can run them on CI. As mentioned during yesterday's wg-polonius meeting, @nikomatsakis has already read through most of this PR (and which is matching what they thought needed to be done [during the recent Polonius sprint](https://hackmd.io/CGMNjt1hR_qYtsR9hgdGmw#Compiler-notes-on-generating-the-placeholder-loans-support)), but Matthew was hopefully going to review (again, not urgent), so: r? @matthewjasper (This updates to the latest `polonius-engine` release, and I'm not sure whether `Cargo.lock` updates can easily be rolled up, but apart from that: this changes little that's tested on CI, so seems safe-ish to rollup ?)
2019-12-08Auto merge of #66981 - michaelwoerister:measureme-0.5.0, r=Mark-Simulacrumbors-12/+9
Update measureme crate to 0.5.0 This PR updates the `measureme` self-profiling crate to the latest release. Heads up, this version changes the trace file format, so the `summarize` tool on perf.rlo needs to be updated to 0.5 too. r? @Mark-Simulacrum cc @wesleywiser
2019-12-06Add a way to list the base non-transitive edges in `TransitiveRelation`Remy Rakic-0/+8
2019-12-04Auto merge of #66408 - nnethercote:greedy-process_obligations, r=nmatsakisbors-10/+33
Make `process_obligations()` greedier. `process_obligations()` adds new nodes, but it does not process these new nodes until the next time it is called. This commit changes it so that it does process these new nodes within the same call. This change reduces the number of calls to `process_obligations()` required to complete processing, sometimes giving significant speed-ups. The change required some changes to tests. - The output of `cycle-cache-err-60010.rs` is slightly different. - The unit tests required extra cases to handle the earlier processing of the added nodes. I mostly did these in the simplest possible way, by making the added nodes be ignored, thus giving outcomes the same as with the old behaviour. But I changed `success_in_grandchildren()` more extensively so that some obligations are completed earlier than they used to be. r? @nikomatsakis
2019-12-03Re-export Client from rustc_data_structures::jobserverMark Rousskov-1/+1
2019-12-03Update measureme crate to 0.5.0.Michael Woerister-12/+9