about summary refs log tree commit diff
path: root/src/librustc/infer/equate.rs
AgeCommit message (Collapse)AuthorLines
2020-02-16Move librustc/{traits,infer} to librustc_infer.Camille GILLOT-142/+0
2020-02-10Reduce the number of `RefCell`s in `InferCtxt`.Nicholas Nethercote-4/+9
`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-02Avoid exponential behaviour when relating typesMatthew Jasper-2/+8
2020-01-05Remove rustc_hir reexports in rustc::hir.Mazdak Farrokhzad-2/+2
2019-12-22Format the worldMark Rousskov-33/+45
2019-09-25Rename `sty` to `kind`varkor-1/+1
2019-09-22Infer consts consistently. Moved some logic into super_combined_consts,ben-37/+3
also removed some duplicated logic from TypeRelation methods.
2019-09-12Shrink `SubregionOrigin`.Nicholas Nethercote-1/+1
It's currently 120 bytes on x86-64, due to one oversized variant (`Subtype`). This commit boxes `Subtype`'s contents, reducing the size of `SubregionOrigin` to 32 bytes. The change speeds things up by avoiding lots of `memcpy` calls, mostly relating to `RegionConstraintData::constraints`, which is a `BTreeMap` with `SubregionOrigin` values.
2019-08-05Fiddle param env through to `try_eval_bits` in most placesOliver Scherer-0/+2
2019-06-18rustc: remove 'x: 'y bounds (except from comments/strings).Eduard-Mihai Burtescu-1/+1
2019-06-14Run `rustfmt --file-lines ...` for changes from previous commits.Eduard-Mihai Burtescu-3/+4
2019-06-14Unify all uses of 'gcx and 'tcx.Eduard-Mihai Burtescu-7/+7
2019-06-12rustc: replace `TyCtxt<'tcx, 'gcx, 'tcx>` with `TyCtxt<'gcx, 'tcx>`.Eduard-Mihai Burtescu-1/+1
2019-06-12rustc: replace `TyCtxt<'a, 'gcx, 'tcx>` with `TyCtxt<'tcx, 'gcx, 'tcx>`.Eduard-Mihai Burtescu-4/+2
2019-05-01Fix rebase from LazyConst removalvarkor-25/+24
2019-05-01Replace ConstVariableTable with UnificationTablevarkor-2/+3
2019-05-01Implement TypeRelation::constsvarkor-3/+45
Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
2019-02-26replace &'tcx Substs with SubstsRefcsmoe-4/+4
2019-02-05move librustc to 2018Mark Mansi-5/+5
2019-01-04Revert "add coherence future-compat warnings for marker-only trait objects"Ariel Ben-Yehuda-4/+0
This reverts commit 760639635facb6c9a0926ac9278bcba71880b0b3.
2018-12-25Remove licensesMark Rousskov-10/+0
2018-12-14add coherence future-compat warnings for marker-only trait objectsAriel Ben-Yehuda-0/+4
The future-compat warnings break code that assumes that `dyn Send + Sync != dyn Sync + Send`, and are the first step in making them equal. cc #33140. It should be possible to revert this commit when we're done with the warnings.
2018-12-07Various minor/cosmetic improvements to codeAlexander Regueiro-2/+2
2018-10-22Fix Rustdoc ICE when checking blanket implsAaron Hill-0/+3
Fixes #55001, #54744 Previously, SelectionContext would unconditionally cache the selection result for an obligation. This worked fine for most users of SelectionContext, but it caused an issue when used by Rustdoc's blanket impl finder. The issue occured when SelectionContext chose a ParamCandidate which contained inference variables. Since inference variables can change between calls to select(), it's not safe to cache the selection result - the chosen candidate might not be applicable for future results, leading to an ICE when we try to run confirmation. This commit prevents SelectionContext from caching any ParamCandidate that contains inference variables. This should always be completely safe, as trait selection should never depend on a particular result being cached. I've also added some extra debug!() statements, which I found helpful in tracking down this bug.
2018-09-29rustc/infer: readability improvementsljedrz-4/+2
2018-08-22Remove Ty prefix from ↵varkor-3/+3
Ty{Adt|Array|Slice|RawPtr|Ref|FnDef|FnPtr|Dynamic|Closure|Generator|GeneratorWitness|Never|Tuple|Projection|Anon|Infer|Error}
2017-11-16make the `region_constraints` field an `Option`Niko Matsakis-1/+2
This way, we can `take()` ownership of it when we are going to resolve regions.
2017-11-16infer: rename `region_vars` field to `region_constraints`Niko Matsakis-1/+1
2017-11-16move refcells out from `RegionVarBindings` and up into `InferCtxt`Niko Matsakis-1/+1
2017-05-11do not fetch variance for items when equatingNiko Matsakis-1/+20
Fixes #41849. Problem was that evaluating the constant expression required evaluating a trait, which would equate types, which would request variance information, which it would then discard. However, computing the variance information would require determining the type of a field, which would evaluate the constant expression. (This problem will potentially arise *later* as we move to more sophisticated constants, however, where we need to check subtyping. We can tackle that when we come to it.)
2017-04-30intern CodeExtentsNiko Matsakis-2/+2
Make a `CodeExtent<'tcx>` be something allocated in an arena instead of an index into the `RegionMaps`.
2017-04-11remove the subtyping relations from TypeVariableNiko Matsakis-5/+4
2016-08-27rustc: pass ty::Region behind an interned 'tcx reference.Eduard Burtescu-1/+2
2016-07-25Tidy upMasood Malekghassemi-2/+6
2016-07-25Use &mut for CombineFields in inference relationsMasood Malekghassemi-10/+5
2016-07-25Move `a_is_expected` out of `CombineFields`Masood Malekghassemi-8/+9
2016-07-25Rename infcx lifetimes in inference relationsMasood Malekghassemi-6/+6
2016-05-11rustc: Generalize a minimum set of functions over 'tcx != 'gcx.Eduard Burtescu-11/+10
2016-05-11rustc: Split 'tcx into 'gcx and 'tcx for InferCtxt and its users.Eduard Burtescu-6/+6
2016-05-11rustc: Replace &'a TyCtxt<'tcx> with a TyCtxt<'a, 'tcx> wrapper.Eduard Burtescu-1/+1
2016-05-11rustc: Avoid free functions taking &TyCtxt and &InferCtxt.Eduard Burtescu-2/+2
2016-03-29Plumb obligations through librustc/inferMasood Malekghassemi-0/+5
2016-03-27rustc: move cfg, infer, traits and ty from middle to top-level.Eduard Burtescu-0/+95