about summary refs log tree commit diff
path: root/src/librustc_data_structures
AgeCommit message (Collapse)AuthorLines
2020-08-30mv compiler to compiler/mark-12152/+0
2020-08-19Add tagged pointer impl to data structuresMark Rousskov-0/+486
2020-08-17Rollup merge of #75637 - ctaggart:wasm32build, r=Mark-SimulacrumTyler Mandry-1/+1
update stacker to 0.1.11 to unbreak build for wasm32-unknown-unknown Like #72079, this updates stacker. The related problem is stacker is here https://github.com/rust-lang/stacker/issues/42. It was fixed by switching from `libc::c_void` to `std::ffi::c_void` https://github.com/rust-lang/stacker/pull/43/files.
2020-08-17update stacker to 0.1.11 to unbreak build for wasm32-unknown-unknownCameron Taggart-1/+1
2020-08-15Merge branch 'master' into feature/incorporate-tracingpawanbisht62-93/+86
2020-08-14Rework `rustc_serialize`Matthew Jasper-93/+50
- Move the type parameter from `encode` and `decode` methods to the trait. - Remove `UseSpecialized(En|De)codable` traits. - Remove blanket impls for references. - Add `RefDecodable` trait to allow deserializing to arena-allocated references safely. - Remove ability to (de)serialize HIR. - Create proc-macros `(Ty)?(En|De)codable` to help implement these new traits.
2020-08-11Rollup merge of #75315 - Mark-Simulacrum:save-temps, r=ecstatic-morseDylan DPC-0/+36
Avoid deleting temporary files on error Previously if the compiler error'd, fatally, then temporary directories which should be preserved by -Csave-temps would be deleted due to fatal compiler errors being implemented as panics. cc @infinity0 (Hopefully) fixes #75275, but I haven't tested
2020-08-10Merge branch 'master' into feature/incorporate-tracingpawanbisht62-27/+14
2020-08-09rustc_data_structures: use IndexSet in TransitiveRelationJosh Stone-26/+13
2020-08-09Upgrade indexmap to 1.5.1, now using hashbrown!Josh Stone-1/+1
2020-08-09Avoid deleting temporary files on errorMark Rousskov-0/+36
Previously if the compiler error'd, fatally, then temporary directories which should be preserved by -Csave-temps would be deleted due to fatal compiler errors being implemented as panics.
2020-08-06Incorporate tracing cratebishtpawan-2/+2
2020-07-31Move from `log` to `tracing`Oliver Scherer-1/+1
2020-07-21Auto merge of #69749 - davidtwco:issue-46477-polymorphization, r=eddybbors-0/+9
Polymorphization This PR implements an analysis to detect when functions could remain polymorphic during code generation. Fixes #46477 r? @eddyb cc @rust-lang/wg-mir-opt @nikomatsakis @pnkfelix
2020-07-20index: introduce and use `FiniteBitSet`David Wood-0/+9
This commit introduces a `FiniteBitSet` type which replaces the manual bit manipulation which was being performed in polymorphization. Signed-off-by: David Wood <david@davidtw.co>
2020-07-20Auto merge of #74010 - pierwill:pierwill-o-notation, r=GuillaumeGomezbors-3/+3
Use italics for O notation In documentation, I think it makes sense to italicize O notation (*O(n)*) as opposed to using back-ticks (`O(n)`). Visually, back-ticks focus the reader on the literal characters being used, making them ideal for representing code. Using italics, as far I can tell, more closely follows typographic conventions in mathematics and computer science. Just a suggestion, of course! 😇
2020-07-19Use italics for O notationpierwill-3/+3
Co-authored-by: Guillaume Gomez <guillaume1.gomez@gmail.com>
2020-07-03Rollup merge of #73984 - pierwill:pierwill-tarjan, r=jonas-schievinkManish Goregaokar-4/+6
Edit docs for rustc_data_structures::graph::scc - Add newline to provide concise module summary - Add wikipedia link - Italicize O notation
2020-07-03Rollup merge of #73881 - pierwill:pierwill-citations, r=jonas-schievinkManish Goregaokar-5/+6
Standardize bibliographic citations in rustc API docs See #73877.
2020-07-03Edit docs for rustc_data_structures::graph::sccpierwill-4/+6
- Add newline to provide concise module summary - Add wikipedia link - Italicize O notation
2020-07-02Standardize bibliographic citations in rustc API docspierwill-5/+6
2020-06-30Rewrite a few manual index loops with while-letJosh Stone-10/+6
There were a few instances of this pattern: ```rust while index < vec.len() { let item = &vec[index]; // ... } ``` These can be indexed at once: ```rust while let Some(item) = vec.get(index) { // ... } ``` Particularly in `ObligationForest::process_obligations`, this mitigates a codegen regression found with LLVM 11 (#73526).
2020-06-23Remove unused crate imports in 2018 edition cratesyuqio-1/+0
2020-06-19Update chalkJack Huey-1/+1
2020-06-10Migrate to numeric associated constsLzu Tao-2/+2
2020-06-02Rename the crates in source codeVadim Petrochenkov-2/+2
2020-06-02Make things build againVadim Petrochenkov-2/+2
2020-05-29Add Extend::{extend_one,extend_reserve}Josh Stone-0/+15
This adds new optional methods on `Extend`: `extend_one` add a single element to the collection, and `extend_reserve` pre-allocates space for the predicted number of incoming elements. These are used in `Iterator` for `partition` and `unzip` as they shuffle elements one-at-a-time into their respective collections.
2020-05-27Auto merge of #71996 - Marwes:detach_undo_log, r=nikomatsakisbors-0/+1
perf: Revert accidental inclusion of a part of #69218 This was accidentally included in #69464 after a rebase and given how much `inflate` and `keccak` stresses the obligation forest seems like a likely culprit to the regression in those benchmarks. (It is necessary in #69218 as obligation forest needs to accurately track the root variables or unifications will get lost)
2020-05-24perf: Add inline on commonly used methods added in 69464Markus Westerlind-0/+1
Reclaims most of the regression in inflate
2020-05-22Replace `rustc_data_structures::sync::Once` with `OnceCell`Dylan MacKenzie-129/+5
2020-05-22Rollup merge of #72161 - nbdd0121:master, r=cuviperRalf Jung-24/+57
Replace fcntl-based file lock with flock WSL1 does not support `fcntl`-based lock and will always report success, therefore creating a race condition when multiple rustc processes are modifying shared data such as `search-index.js`. WSL1 does however support `flock`. `flock` is supported by all unix-like platforms. The only caveat is that Linux 2.6.11 or earlier does not support `flock` on NFS mounts, but as the minimum supported Linux version is 2.6.18, it is not an issue. Fixes #72157
2020-05-21Comment flock usage on LinuxGary Guo-0/+5
2020-05-20Use fcntl-based file lock for non-Linux unixGary Guo-10/+67
2020-05-16Auto merge of #72079 - semarie:openbsd-stacker, r=Mark-Simulacrumbors-1/+1
update stacker to 0.1.9 to unbreak build on OpenBSD the version 0.1.8 of stacker (what is currently pinned in Cargo.lock) doesn't build on OpenBSD (see https://github.com/rust-lang/stacker/pull/34). update the version to 0.1.9
2020-05-13Replace fcntl-based file lock with flockGary Guo-48/+19
WSL1 does not support `fcntl`-based lock and will always report success, therefore creating a race condition when multiple rustc processes are modifying shared data such as `search-index.js`. WSL1 does however support `flock`. `flock` is supported by all unix-like platforms. The only caveat is that Linux 2.6.11 or earlier does not support `flock` on NFS mounts, but as the minimum supported Linux version is 2.6.18, it is not an issue. Fixes #72157
2020-05-11Rollup merge of #72109 - matthiaskrgr:cl8ppy, r=Dylan-DPCDylan DPC-2/+2
Fix clippy warnings Fixes clippy::{cone_on_copy, filter_next, redundant_closure, single_char_pattern, len_zero,redundant_field_names, useless_format, identity_conversion, map_clone, into_iter_on_ref, needless_return, option_as_ref_deref, unused_unit, unnecessary_mut_passed} r? @Dylan-DPC
2020-05-11Fix clippy warningsMatthias Krüger-2/+2
Fixes clippy::{cone_on_copy, filter_next, redundant_closure, single_char_pattern, len_zero,redundant_field_names, useless_format, identity_conversion, map_clone, into_iter_on_ref, needless_return, option_as_ref_deref, unused_unit, unnecessary_mut_passed}
2020-05-10update stacker to 0.1.9 to unbreak build on OpenBSDSébastien Marie-1/+1
2020-05-10use min_specialization for some rustc crates where it requires no changesRalf Jung-1/+1
2020-05-07Auto merge of #55617 - oli-obk:stacker, r=nagisa,oli-obkbors-0/+19
Prevent compiler stack overflow for deeply recursive code I was unable to write a test that 1. runs in under 1s 2. overflows on my machine without this patch The following reproduces the issue, but I don't think it's sensible to include a test that takes 30s to compile. We can now easily squash newly appearing overflows by the strategic insertion of calls to `ensure_sufficient_stack`. ```rust // compile-pass #![recursion_limit="1000000"] macro_rules! chain { (EE $e:expr) => {$e.sin()}; (RECURSE $i:ident $e:expr) => {chain!($i chain!($i chain!($i chain!($i $e))))}; (Z $e:expr) => {chain!(RECURSE EE $e)}; (Y $e:expr) => {chain!(RECURSE Z $e)}; (X $e:expr) => {chain!(RECURSE Y $e)}; (A $e:expr) => {chain!(RECURSE X $e)}; (B $e:expr) => {chain!(RECURSE A $e)}; (C $e:expr) => {chain!(RECURSE B $e)}; // causes overflow on x86_64 linux // less than 1 second until overflow on test machine // after overflow has been fixed, takes 30s to compile :/ (D $e:expr) => {chain!(RECURSE C $e)}; (E $e:expr) => {chain!(RECURSE D $e)}; (F $e:expr) => {chain!(RECURSE E $e)}; // more than 10 seconds (G $e:expr) => {chain!(RECURSE F $e)}; (H $e:expr) => {chain!(RECURSE G $e)}; (I $e:expr) => {chain!(RECURSE H $e)}; (J $e:expr) => {chain!(RECURSE I $e)}; (K $e:expr) => {chain!(RECURSE J $e)}; (L $e:expr) => {chain!(RECURSE L $e)}; } fn main() { let x = chain!(D 42.0_f32); } ``` fixes #55471 fixes #41884 fixes #40161 fixes #34844 fixes #32594 cc @alexcrichton @rust-lang/compiler I looked at all code that checks the recursion limit and inserted stack growth calls where appropriate.
2020-05-05perf: Lazily recive the Rollback argument in rollback_toMarkus Westerlind-1/+2
2020-05-05Move projection_cache into the combined undo logMarkus Westerlind-7/+19
2020-05-05Allow SnapshotMap to have a separate undo_logMarkus Westerlind-92/+58
2020-05-05Move region_constraint to the unified undo logMarkus Westerlind-1/+1
2020-05-05perf: Reduce snapshot/rollback overheadMarkus Westerlind-0/+1
By merging the undo_log of all structures part of the snapshot the cost of creating a snapshot becomes much cheaper. Since snapshots with no or few changes are so frequent this ends up mattering more than the slight overhead of dispatching on the variants that map to each field.
2020-05-02Move ensure_sufficient_stack to data_structuresSimonas Kazlauskas-0/+19
We anticipate this to have uses in all sorts of crates and keeping it in `rustc_data_structures` enables access to it from more locations without necessarily pulling in the large `librustc` crate.
2020-05-02fix rustdoc warningsTshepang Lekhonkhobe-2/+2
2020-04-30Rollup merge of #70950 - nikomatsakis:leak-check-nll-2, r=matthewjasperDylan DPC-0/+5
extend NLL checker to understand `'empty` combined with universes This PR extends the NLL region checker to understand `'empty` combined with universes. In particular, it means that the NLL region checker no longer considers `exists<R2> { forall<R1> { R1: R2 } }` to be provable. This is work towards https://github.com/rust-lang/rust/issues/59490, but we're not all the way there. One thing in particular it does not address is error messages. The modifications to the NLL region inference code turned out to be simpler than expected. The main change is to require that if `R1: R2` then `universe(R1) <= universe(R2)`. This constraint follows from the region lattice (shown below), because we assume then that `R2` is "at least" `empty(Universe(R2))`, and hence if `R1: R2` (i.e., `R1 >= R2` on the lattice) then `R1` must be in some universe that can name `'empty(Universe(R2))`, which requires that `Universe(R1) <= Universe(R2)`. ``` static ----------+-----...------+ (greatest) | | | early-bound and | | free regions | | | | | scope regions | | | | | empty(root) placeholder(U1) | | / | | / placeholder(Un) empty(U1) -- / | / ... / | / empty(Un) -------- (smallest) ``` I also made what turned out to be a somewhat unrelated change to add a special region to represent `'empty(U0)`, which we use (somewhat hackily) to indicate well-formedness checks in some parts of the compiler. This fixes #68550. I did some investigation into fixing the error message situation. That's a bit trickier: the existing "nice region error" code around placeholders relies on having better error tracing than NLL currently provides, so that it knows (e.g.) that the constraint arose from applying a trait impl and things like that. I feel like I was hoping *not* to do such fine-grained tracing in NLL, and it seems like we...largely...got away with that. I'm not sure yet if we'll have to add more tracing information or if there is some sort of alternative. It's worth pointing out though that I've not kind of shifted my opinion on whose job it should be to enforce lifetimes: I tend to think we ought to be moving back towards *something like* the leak-check (just not the one we *had*). If we took that approach, it would actually resolve this aspect of the error message problem, because we would be resolving 'higher-ranked errors' in the trait solver itself, and hence we wouldn't have to thread as much causal information back to the region checker. I think it would also help us with removing the leak check while not breaking some of the existing crates out there. Regardless, I think it's worth landing this change, because it was relatively simple and it aligns the set of programs that NLL accepts with those that are accepted by the main region checker, and hence should at least *help* us in migration (though I guess we still also have to resolve the existing crates that rely on leak check for coherence). r? @matthewjasper
2020-04-25Replace thread_local with generator resume arguments in box_region.Alex Aktsipetrov-20/+27