about summary refs log tree commit diff
path: root/src/librustc_data_structures/snapshot_map
AgeCommit message (Collapse)AuthorLines
2020-08-30mv compiler to compiler/mark-184/+0
2020-05-24perf: Add inline on commonly used methods added in 69464Markus Westerlind-0/+1
Reclaims most of the regression in inflate
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
2019-12-22Format the worldMark Rousskov-15/+14
2019-10-21Remove unnecessary `Hash` bounds from various types.Nicholas Nethercote-1/+1
2019-08-02librustc_data_structures: Unconfigure tests during normal buildVadim Petrochenkov-1/+1
2019-02-09librustc_data_structures => 2018Taiki Endo-1/+1
2018-12-25Remove licensesMark Rousskov-20/+0
2018-11-25Remove `OpenSnapshot` and `CommittedSnapshot` markers from `SnapshotMap`.Nicholas Nethercote-34/+25
They're not strictly necessary, and they result in the `Vec` being allocated even for the trivial (and common) case where a `start_snapshot` is immediately followed by a `commit` or `rollback_to`.
2018-11-25Introduce `in_snapshot` and `assert_open_snapshot` methods.Nicholas Nethercote-3/+7
This makes the two snapshot implementations more consistent with each other and with crate `ena`.
2018-11-25Make `commit` and `rollback_to` methods take ownership of the snapshots.Nicholas Nethercote-8/+8
Because they shouldn't be reused. This provides consistency with the `ena` crate.
2018-11-25Replace a `.truncate(0)` call with `.clear()`.Nicholas Nethercote-1/+1
2018-11-25Remove `insert_noop`.Nicholas Nethercote-10/+4
Because it's as useless as its name suggests. This commit also renames `UndoLog::Noop` as `UndoLog::Purged`, because (a) that's a more descriptive name and (b) it matches the name used in similar code in `librustc/infer/region_constraints/mod.rs`.
2018-11-21rustc: implement and use Default on more types.Eduard-Mihai Burtescu-11/+12
2018-10-19Update unit testsOliver Scherer-3/+3
2018-10-19Prefer `Default::default` over `FxHash*::default` in struct constructorsOliver Scherer-2/+6
2018-10-19Deprecate the `FxHashMap()` and `FxHashSet()` constructor function hackOliver Scherer-1/+1
2018-08-09Make SnapshotMap::{commit, rollback_to} take referencesljedrz-9/+9
2018-05-17Avoid repeated HashMap lookups in `opt_normalize_projection_type`.Nicholas Nethercote-0/+6
There is a hot path through `opt_normalize_projection_type`: - `try_start` does a cache lookup (#1). - The result is a `NormalizedTy`. - There are no unresolved type vars, so we call `complete`. - `complete` does *another* cache lookup (#2), then calls `SnapshotMap::insert`. - `insert` does *another* cache lookup (#3), inserting the same value that's already in the cache. This patch optimizes this hot path by introducing `complete_normalized`, for use when the value is known in advance to be a `NormalizedTy`. It always avoids lookup #2. Furthermore, if the `NormalizedTy`'s obligations are empty (the common case), we know that lookup #3 would be a no-op, so we avoid it, while inserting a Noop into the `SnapshotMap`'s undo log.
2018-02-18Generate documentation for auto-trait implsAaron Hill-0/+5
A new section is added to both both struct and trait doc pages. On struct/enum pages, a new 'Auto Trait Implementations' section displays any synthetic implementations for auto traits. Currently, this is only done for Send and Sync. On trait pages, a new 'Auto Implementors' section displays all types which automatically implement the trait. Effectively, this is a list of all public types in the standard library. Synthesized impls for a particular auto trait ('synthetic impls') take into account generic bounds. For example, a type 'struct Foo<T>(T)' will have 'impl<T> Send for Foo<T> where T: Send' generated for it. Manual implementations of auto traits are also taken into account. If we have the following types: 'struct Foo<T>(T)' 'struct Wrapper<T>(Foo<T>)' 'unsafe impl<T> Send for Wrapper<T>' // pretend that Wrapper<T> makes this sound somehow Then Wrapper will have the following impl generated: 'impl<T> Send for Wrapper<T>' reflecting the fact that 'T: Send' need not hold for 'Wrapper<T>: Send' to hold Lifetimes, HRTBS, and projections (e.g. '<T as Iterator>::Item') are taken into account by synthetic impls However, if a type can *never* implement a particular auto trait (e.g. 'struct MyStruct<T>(*const T)'), then a negative impl will be generated (in this case, 'impl<T> !Send for MyStruct<T>') All of this means that a user should be able to copy-paste a synthetic impl into their code, without any observable changes in behavior (assuming the rest of the program remains unchanged).
2016-11-08Replace FnvHasher use with FxHasher.Nicholas Nethercote-3/+3
This speeds up compilation by 3--6% across most of rustc-benchmarks.
2016-10-21only remove keys that mention skolemized regionsNiko Matsakis-3/+7
2016-10-21when pop skol, also remove from proj cacheNiko Matsakis-15/+42
2016-10-20run rustfmt on snapshot_mapSrinivas Reddy Thatiparthy-8/+9
2016-05-31add a snapshottable hashmapNiko Matsakis-0/+188