about summary refs log tree commit diff
path: root/src/librustc/infer/glb.rs
AgeCommit message (Collapse)AuthorLines
2020-02-16Move librustc/{traits,infer} to librustc_infer.Camille GILLOT-118/+0
2020-02-10Reduce the number of `RefCell`s in `InferCtxt`.Nicholas Nethercote-1/+6
`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.
2019-12-22Format the worldMark Rousskov-21/+33
2019-09-22Infer consts consistently. Moved some logic into super_combined_consts,ben-5/+0
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-6/+5
2019-06-14Unify all uses of 'gcx and 'tcx.Eduard-Mihai Burtescu-10/+10
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-3/+3
2019-05-01Implement TypeRelation::constsvarkor-0/+13
Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
2019-02-05move librustc to 2018Mark Mansi-3/+3
2019-01-04Revert "add coherence future-compat warnings for marker-only trait objects"Ariel Ben-Yehuda-5/+1
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-1/+5
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-10-31kill old-style-lub warningsNiko Matsakis-22/+2
2017-11-17issue better error message when LUB/GLB diverge under new behaviorNiko Matsakis-0/+3
2017-11-17make LUB/GLB of higher-ranked things actually do EQNiko Matsakis-1/+24
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-1/+1
2017-11-16move refcells out from `RegionVarBindings` and up into `InferCtxt`Niko Matsakis-1/+1
2017-11-16extract the `tcx` out from `RegionVarBindings`Niko Matsakis-1/+1
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-11add FIXME for bivariant lub/glbNiko Matsakis-0/+1
2017-04-11remove bivarianceNiko Matsakis-1/+1
There is one fishy part of these changes: when computing the LUB/GLB of a "bivariant" type parameter, I currently return the `a` value. Bivariant type parameters are only allowed in a very particular situation, where the type parameter is only used as an associated type output, like this: ```rust pub struct Foo<A, B> where A: Fn() -> B { data: A } ``` In principle, if one had `T=Foo<A, &'a u32>` and `U=Foo<A, &'b u32>` and (e.g.) `A: for<'a> Fn() -> &'a u32`, then I think that computing the LUB of `T` and `U` might do the wrong thing. Probably the right behavior is just to create a fresh type variable. However, that particular example would not compile (because the where-clause is illegal; `'a` does not appear in any input type). I was not able to make an example that *would* compile and demonstrate this shortcoming, and handling the LUB/GLB was mildly inconvenient, so I left it as is. I am considering whether to revisit this.
2016-12-03Add TypeVariableOrigin enumKeith Yeung-0/+5
2016-08-27rustc: pass ty::Region behind an interned 'tcx reference.Eduard Burtescu-1/+2
2016-07-25Tidy upMasood Malekghassemi-3/+9
2016-07-25Use &mut for CombineFields in inference relationsMasood Malekghassemi-12/+7
2016-07-25Move `a_is_expected` out of `CombineFields`Masood Malekghassemi-9/+10
2016-07-25Rename infcx lifetimes in inference relationsMasood Malekghassemi-8/+8
2016-05-11rustc: Generalize a minimum set of functions over 'tcx != 'gcx.Eduard Burtescu-13/+12
2016-05-11rustc: Split 'tcx into 'gcx and 'tcx for InferCtxt and its users.Eduard Burtescu-8/+8
2016-05-11rustc: Replace &'a TyCtxt<'tcx> with a TyCtxt<'a, 'tcx> wrapper.Eduard Burtescu-1/+1
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/+85