about summary refs log tree commit diff
path: root/src/librustc/infer/higher_ranked
AgeCommit message (Collapse)AuthorLines
2020-02-16Move librustc/{traits,infer} to librustc_infer.Camille GILLOT-156/+0
2020-02-10Reduce the number of `RefCell`s in `InferCtxt`.Nicholas Nethercote-1/+1
`InferCtxt` contains six structures within `RefCell`s. Every time we create and dispose of (commit or rollback) a snapshot we have to `borrow_mut` each one of them. This commit moves the six structures under a single `RefCell`, which gives significant speed-ups by reducing the number of `borrow_mut` calls. To avoid runtime errors I had to reduce the lifetimes of dynamic borrows in a couple of places.
2020-02-06add the ability to skip leak check within a snapshotNiko Matsakis-0/+10
The intention is that coherence code will skip the leak check and determine whether two impls *would have* overlapped, and then issue a warning.
2019-12-22Format the worldMark Rousskov-15/+15
2019-11-12Create intermediate enum ty::ConstKind.Camille GILLOT-2/+1
2019-06-14Unify all uses of 'gcx and 'tcx.Eduard-Mihai Burtescu-2/+2
2019-05-01Fix rebase from LazyConst removalvarkor-2/+2
2019-05-01Replace ConstVariableTable with UnificationTablevarkor-10/+12
2019-05-01Implement fold_const for BoundVarReplacervarkor-2/+13
2019-02-21restore the actual leak-checkNiko Matsakis-13/+6
2019-02-21introduce a dummy leak check and invoke it in all the right placesNiko Matsakis-2/+24
This set of diffs was produced by combing through b68fad670bb3612cac26e50751e4fd9150e59977 and seeing where the `leak_check` used to be invoked and how.
2019-02-21reintroduce `commit_if_ok` call into `higher_ranked_sub`Niko Matsakis-26/+25
2019-02-15include more universe information in `debug!` printoutsNiko Matsakis-2/+7
2019-02-10rustc: doc commentsAlexander Regueiro-1/+1
2019-02-05move librustc to 2018Mark Mansi-2/+2
2019-01-18remove more old readmesmark-401/+6
2019-01-02universe transitionNiko Matsakis-477/+30
Remove the leak-check and its associated machinery. Replace with making the solver aware of universes.
2018-12-25Remove licensesMark Rousskov-10/+0
2018-12-07Various minor/cosmetic improvements to codeAlexander Regueiro-1/+1
2018-11-26rustc-guide has movedMark Mansi-1/+1
2018-11-25Auto merge of #55906 - nnethercote:rm-OpenSnapshot-CommittedSnapshot, ↵bors-5/+1
r=nikomatsakis Clean up and streamline snapshot data structures These commits clean up the snapshot structures a bit, so they are more consistent with each other and with the `ena` crate. They also remove the `OpenSnapshot` and `CommittedSnapshot` entries in the undo log, just like I did for the `ena` crate in https://github.com/rust-lang-nursery/ena/pull/14. This PR in combination with that `ena` PR reduces instruction counts by up to 6% on benchmarks. r? @nikomatsakis. Note that this isn't quite ready for landing, because the `ena` dependency in the first commit needs to be updated once https://github.com/rust-lang-nursery/ena/pull/14 lands. But otherwise it should be good.
2018-11-25Remove `OpenSnapshot` and `CommittedSnapshot` markers from ↵Nicholas Nethercote-5/+1
`RegionConstraintCollector`. 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`. The commit also removes a now-unnecessary argument of `pop_placeholders()`.
2018-11-24Instantiate all bound vars universallyscalexm-16/+27
2018-11-24Distinguish between placeholder kindsscalexm-1/+1
2018-11-15Rollup merge of #55901 - euclio:speling, r=petrochenkovPietro Albini-1/+1
fix various typos in doc comments
2018-11-13fix various typos in doc commentsAndy Russell-1/+1
2018-11-13Instantiate all bound vars existentiallyscalexm-5/+5
2018-10-31kill old-style-lub warningsNiko Matsakis-256/+0
2018-10-19Deprecate the `FxHashMap()` and `FxHashSet()` constructor function hackOliver Scherer-1/+1
2018-10-15remove the sub/super terminology for universesNiko Matsakis-2/+2
Instead, we talk about: - creating the "next" universe - universes "extending" one another - and `u1.can_name(u2)`, meaning that `u1` contains all names from `u2`
2018-10-15make `UniverseIndex` hashable, rename "sub-" to "superuniverse"Niko Matsakis-1/+1
The only name was silly. U1 can contain everything from U0 *plus* more things.
2018-10-04remove occurences of `skolemization`Niko Matsakis-34/+34
2018-10-04remove all occurences of `skolemize`Niko Matsakis-2/+2
2018-10-04extend NLL universe code to have >1 placeholder within one universeNiko Matsakis-6/+11
2018-10-04create just one subuniverse per binder -- no need for more, reallyNiko Matsakis-3/+3
2018-10-04reorder the placeholders and inference variables in hr::subNiko Matsakis-7/+9
2018-10-04rename skolemized to placeholderNiko Matsakis-73/+79
2018-09-29don't elide lifetimes in paths in librustc/Zack M. Davis-1/+1
This seemed like a good way to kick the tires on the elided-lifetimes-in-paths lint (#52069)—seems to work! This was also pretty tedious—it sure would be nice if `cargo fix` worked on this codebase (#53896)!
2018-08-19Fix typos found by codespell.Matthias Krüger-1/+1
2018-07-25introduce new subtypingNiko Matsakis-0/+12
2018-06-24Update broken rustc-guide linksAlex Kitchens-1/+1
Recently, there has been some rearrangement of the content in the Rustc Guide, and this commit changes the urls the match the updated guide.
2018-06-14Declare DebruijnIndex via newtype_index macroFabian Drinck-3/+2
2018-05-28stop invoking `DebruijnIndex::new` directlyNiko Matsakis-1/+2
Co-authored-by: csmoe <35686186+csmoe@users.noreply.github.com>
2018-05-28port `fold_regions` and friends to use debruijn indices directlyNiko Matsakis-3/+5
They no longer talk about plain integers. Co-authored-by: csmoe <35686186+csmoe@users.noreply.github.com>
2018-05-14Remove LazyBTreeMap.Nicholas Nethercote-7/+5
It was introduced in #50240 to avoid an allocation when creating a new BTreeMap, which gave some speed-ups. But then #50352 made that the default behaviour for BTreeMap, so LazyBTreeMap is no longer necessary.
2018-05-02Fix rebase issuesSean Griffin-1/+1
2018-05-02track skol levels in the InferCtxt rather than via counterSean Griffin-6/+6
2018-04-28Auto merge of #50240 - nnethercote:LazyBTreeMap, r=cramertjbors-5/+7
Implement LazyBTreeMap and use it in a few places. This is a thin wrapper around BTreeMap that avoids allocating upon creation. I would prefer to change BTreeMap directly to make it lazy (like I did with HashSet in #36734) and I initially attempted that by making BTreeMap::root an Option<>. But then I also had to change Iter and Range to handle trees with no root, and those types have stability markers on them and I wasn't sure if that was acceptable. Also, BTreeMap has a lot of complex code and changing it all was challenging, and I didn't have high confidence about my general approach. So I prototyped this wrapper instead and used it in the hottest locations to get some measurements about the effect. The measurements are pretty good! - Doing a debug build of serde, it reduces the total number of heap allocations from 17,728,709 to 13,359,384, a 25% reduction. The number of bytes allocated drops from 7,474,672,966 to 5,482,308,388, a 27% reduction. - It gives speedups of up to 3.6% on some rustc-perf benchmark jobs. crates.io, futures, and serde benefit most. ``` futures-check avg: -1.9% min: -3.6% max: -0.5% serde-check avg: -2.1% min: -3.5% max: -0.7% crates.io-check avg: -1.7% min: -3.5% max: -0.3% serde avg: -2.0% min: -3.0% max: -0.9% serde-opt avg: -1.8% min: -2.9% max: -0.3% futures avg: -1.5% min: -2.8% max: -0.4% tokio-webpush-simple-check avg: -1.1% min: -2.2% max: -0.1% futures-opt avg: -1.2% min: -2.1% max: -0.4% piston-image-check avg: -0.8% min: -1.1% max: -0.3% crates.io avg: -0.6% min: -1.0% max: -0.3% ``` @Gankro, how do you think I should proceed here? Is leaving this as a wrapper reasonable? Or should I try to make BTreeMap itself lazy? If so, can I change the representation of Iter and Range? Thanks!
2018-04-26Implement LazyBTreeMap and use it in a few places.Nicholas Nethercote-5/+7
This is a thin wrapper around BTreeMap that avoids allocating upon creation. It speeds up some rustc-perf benchmarks by up to 3.6%.
2018-04-24Make Binder's field private and clean up its usageTyler Mandry-3/+3