about summary refs log tree commit diff
path: root/src/librustc/infer/fudge.rs
AgeCommit message (Collapse)AuthorLines
2020-02-16Move librustc/{traits,infer} to librustc_infer.Camille GILLOT-213/+0
2020-02-10Reduce the number of `RefCell`s in `InferCtxt`.Nicholas Nethercote-18/+14
`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-01-27don't clone types that are copy, round two.Matthias Krüger-1/+1
2019-12-22Format the worldMark Rousskov-30/+33
2019-11-12Create intermediate enum ty::ConstKind.Camille GILLOT-2/+1
2019-09-25Rename `sty` to `kind`varkor-1/+1
2019-06-18rustc: remove 'x: 'y bounds (except from comments/strings).Eduard-Mihai Burtescu-1/+1
2019-06-14Unify all uses of 'gcx and 'tcx.Eduard-Mihai Burtescu-5/+5
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-1/+1
2019-05-28Rename `OpportunisticTypeResolver` to `OpportunisticVarResolver`varkor-1/+1
2019-05-01Implement const generics for `InferenceFudger`varkor-13/+32
2019-05-01Fix rebase from LazyConst removalvarkor-5/+2
2019-05-01Replace ConstVariableTable with UnificationTablevarkor-20/+10
2019-05-01impl fold_const for RegionFudgerGabriel Smith-1/+29
Signed-off-by: Gabriel Smith <ga29smith@gmail.com>
2019-05-01Add stubs for `fold_const`varkor-0/+4
Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
2019-03-27Use Vec instead of FxHashMapvarkor-7/+10
2019-03-27Lookup region variable origin instead of choosing onevarkor-9/+6
2019-03-27Store type variable origins in InferenceFudgervarkor-3/+4
2019-03-27Use `eq_relations`varkor-5/+5
2019-03-27Add `next_int_var` and `next_float_var`varkor-2/+2
2019-03-27Simplify `fudge_inference_if_ok`varkor-19/+19
2019-03-27Add int variables and float variables to `InferenceFudger`varkor-8/+35
2019-03-27Rename `RegionFudger` to `InferenceFudger`varkor-7/+7
2019-03-27Use Ranges for vars_since_snapshotvarkor-31/+28
2019-03-27Make `vars_since_snapshot` naming consistentvarkor-6/+6
2019-02-10rustc: doc commentsAlexander Regueiro-2/+2
2019-02-05move librustc to 2018Mark Mansi-3/+3
2018-12-25Remove licensesMark Rousskov-10/+0
2018-08-22Remove Ty prefix from ↵varkor-1/+1
Ty{Adt|Array|Slice|RawPtr|Ref|FnDef|FnPtr|Dynamic|Closure|Generator|GeneratorWitness|Never|Tuple|Projection|Anon|Infer|Error}
2018-03-23Revert "add universes to type inference variables"Sean Griffin-5/+1
This reverts commit 13efaf0481275dba18f1d18f4b59b664b2d2031a.
2018-03-01add universes to type inference variablesNiko Matsakis-1/+5
2018-03-01have `probe()` return `TypeVariableValue`Niko Matsakis-1/+3
2017-11-16make the `region_constraints` field an `Option`Niko Matsakis-1/+1
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-2/+2
2017-11-16move refcells out from `RegionVarBindings` and up into `InferCtxt`Niko Matsakis-1/+1
2017-07-05use field init shorthand in src/librustcZack M. Davis-1/+1
The field init shorthand syntax was stabilized in 1.17.0 (aebd94f); we are now free to use it in the compiler.
2017-04-30intern CodeExtentsNiko Matsakis-1/+1
Make a `CodeExtent<'tcx>` be something allocated in an arena instead of an index into the `RegionMaps`.
2017-04-12do not consult union-find during `fudge_regions_if_ok`Niko Matsakis-12/+4
2017-04-11generalize type variables tooNiko Matsakis-22/+53
When we are generalizing a super/sub-type, we have to replace type variables with a fresh variable (and not just region variables). So if we know that `Box<?T> <: ?U`, for example, we instantiate `?U` with `Box<?V>` and then relate `Box<?T>` to `Box<?V>` (and hence require that `?T <: ?V`). This change has some complex interactions, however: First, the occurs check must be updated to detect constraints like `?T <: ?U` and `?U <: Box<?T>`. If we're not careful, we'll create a never-ending sequence of new variables. To address this, we add a second unification set into `type_variables` that tracks type variables related through **either** equality **or** subtyping, and use that during the occurs-check. Second, the "fudge regions if ok" code was expecting no new type variables to be created. It must be updated to create new type variables outside of the probe. This is relatively straight-forward under the new scheme, since type variables are now independent from one another, and any relations are moderated by pending subtype obliations and so forth. This part would be tricky to backport though. cc #18653 cc #40951
2016-11-08introduce a `fudge_regions_if_ok` to address false region edgesNiko Matsakis-0/+137
Fixes #37655.