Commit Graph

54 Commits

Author SHA1 Message Date
csmoe 64f61c7888 remove indexed_vec re-export from rustc_data_structures 2019-09-29 16:48:31 +00:00
varkor bea3d67c77 Rename `subst::Kind` to `subst::GenericArg` 2019-09-26 11:48:05 +01:00
Vadim Petrochenkov 614037171b cleanup: Remove `extern crate serialize as rustc_serialize`s 2019-07-23 19:20:16 +03:00
Niko Matsakis eca55b58d6 rename to "member constraints" 2019-07-02 12:25:22 -04:00
Niko Matsakis a18c779fa2 pacify the mercilous tidy
long lines, trailing newlines
2019-07-02 12:15:21 -04:00
Niko Matsakis ddc63ce19f propagate the pick-constraints through queries 2019-07-02 12:15:20 -04:00
Niko Matsakis 09bba9b89d introduce `QueryRegionConstraints` struct 2019-07-02 12:15:19 -04:00
Niko Matsakis 7e66a96d58 introduce `QueryRegionConstraints` struct (no-op) 2019-07-02 12:15:19 -04:00
Niko Matsakis fd5f7673a7 rename `QueryRegionConstraint` to `QueryOutlivesConstraint` 2019-07-02 12:15:19 -04:00
John Kåre Alsaker 007aabae93 Remove unnecessary lift calls 2019-06-14 21:11:50 +02:00
Eduard-Mihai Burtescu f3f9d6dfd9 Unify all uses of 'gcx and 'tcx. 2019-06-14 18:58:23 +03:00
Eduard-Mihai Burtescu 17cdd356da rustc: replace `TyCtxt<'tcx, 'gcx, 'tcx>` with `TyCtxt<'gcx, 'tcx>`. 2019-06-12 13:38:27 +03:00
Eduard-Mihai Burtescu 2441253508 Fix fallout from `deny(unused_lifetimes)`. 2019-06-12 13:38:27 +03:00
Eduard-Mihai Burtescu 37799a5552 rustc: replace `TyCtxt<'a, 'gcx, 'tcx>` with `TyCtxt<'tcx, 'gcx, 'tcx>`. 2019-06-12 13:38:27 +03:00
varkor 8577bb49bf Refactor `ConstVariableOrigin` into `ConstVariableOrigin` and `ConstVariableOriginKind` 2019-06-05 16:45:16 +01:00
varkor 4dcc49c685 Refactor `TypeVariableOrigin` into `TypeVariableOrigin` and `TypeVariableOriginKind` 2019-06-05 16:45:16 +01:00
varkor fc16b0a147 Fix rebase from LazyConst removal 2019-05-01 23:11:19 +01:00
varkor 2308d2d68a Handle `ConstValue::Placeholder` in `canonicalizer` 2019-05-01 23:10:57 +01:00
varkor e70797b575 Add `PlaceholderConst` 2019-05-01 23:10:57 +01:00
varkor d4e0951fff Add `CanonicalVarKind::Const`
Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
2019-05-01 23:10:57 +01:00
John Kåre Alsaker 53269c7f6e Update trait queries 2019-04-25 18:23:36 +02:00
varkor fa18c129c3 Add `next_int_var` and `next_float_var` 2019-03-27 09:44:55 +00:00
John Kåre Alsaker 3936aff216 Use derive macro for HashStable 2019-03-13 00:03:13 +01:00
varkor 63b7572d0d Stub methods in infer
Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
2019-03-05 22:10:02 +00:00
Alexander Regueiro c3e182cf43 rustc: doc comments 2019-02-10 23:42:32 +00:00
Mark Mansi e957ed9d10 move librustc to 2018 2019-02-05 12:45:47 -06:00
scalexm ba6314a0d6 Integrate chalk engine 2018-12-27 19:21:16 +01:00
Mark Rousskov 2a663555dd Remove licenses 2018-12-25 21:08:33 -07:00
Mark Mansi 6494f1e60e rustc-guide has moved 2018-11-26 15:03:13 -06:00
scalexm cdb96be11e Handle placeholder types in canonicalization 2018-11-24 01:24:40 +01:00
scalexm 7401e3def5 Distinguish between placeholder kinds 2018-11-24 01:24:40 +01:00
scalexm 45be1ac0fc Remove `ReCanonical` in favor of `ReLateBound` 2018-11-03 11:41:55 +01:00
scalexm 3dd303aa89 Rename `BoundTyIndex` to `BoundVar` 2018-11-03 11:41:55 +01:00
Niko Matsakis 7f9ab60afb extend query response to potentially contain fresh universes
The idea here is that an incoming query may refer to some universes,
and they query response may contain fresh universes that go beyond
those. When we instantiate the query response in the caller's scope,
therefore, we map those new universes into fresh universes for the
caller.
2018-10-27 09:06:03 -04:00
Niko Matsakis 3ef27d82e0 allow canonicalized regions to carry universe and track max-universe
But.. we don't really use it for anything right now.
2018-10-27 09:06:01 -04:00
Fabian Drinck 2581bdc143 Rename CanonicalVar to BoundTyIndex 2018-10-20 18:39:29 +02:00
Niko Matsakis a3409a1640 make `instantiate_canonical_with_fresh_inference_vars` public again
This used to be public, then I made it private in a previous PR, but
there really wasn't a strong need for that.
2018-10-15 16:24:31 -04:00
Niko Matsakis 6ace43cf77 hide `SmallCanonicalVarValues` in `OriginalQueryValues` struct 2018-10-15 11:42:07 -04:00
Niko Matsakis bca294da1f rename `QueryResult` to `QueryResponse`
`Result` really sounds like the rustc result type
2018-10-15 08:57:22 -04:00
Niko Matsakis fd046a2ede bundle up "canonical instantiation" with infcx creation 2018-10-15 08:57:22 -04:00
Niko Matsakis beb3374b1c pacify the mercilous tidy: canonical ignore comments 2018-08-24 13:27:38 -04:00
Niko Matsakis 2d1d3fef62 support user annotations in fns, methods 2018-08-24 13:27:38 -04:00
Igor Gutorov 4d81fe9243 Use optimized SmallVec implementation 2018-08-23 10:45:53 +03:00
varkor 87c7e57020 Rename ty::Slice to ty::List 2018-08-22 16:05:27 +01:00
kennytm b5519db323
Rollup merge of #53496 - matthiaskrgr:codespell_08_2018, r=varkor
Fix typos found by codespell.
2018-08-21 17:51:49 +08:00
Donato Sciarra 82607d2cf3 mv (mod) codemap source_map 2018-08-19 23:01:00 +02:00
Matthias Krüger 71120ef1e5 Fix typos found by codespell. 2018-08-19 17:41:28 +02:00
Nicholas Nethercote 7cc527770d Avoid most allocations in `Canonicalizer`.
Extra allocations are a significant cost of NLL, and the most common
ones come from within `Canonicalizer`. In particular, `canonical_var()`
contains this code:

    indices
	.entry(kind)
	.or_insert_with(|| {
	    let cvar1 = variables.push(info);
	    let cvar2 = var_values.push(kind);
	    assert_eq!(cvar1, cvar2);
	    cvar1
	})
	.clone()

`variables` and `var_values` are `Vec`s. `indices` is a `HashMap` used
to track what elements have been inserted into `var_values`. If `kind`
hasn't been seen before, `indices`, `variables` and `var_values` all get
a new element. (The number of elements in each container is always the
same.) This results in lots of allocations.

In practice, most of the time these containers only end up holding a few
elements. This PR changes them to avoid heap allocations in the common
case, by changing the `Vec`s to `SmallVec`s and only using `indices`
once enough elements are present. (When the number of elements is small,
a direct linear search of `var_values` is as good or better than a
hashmap lookup.)

The changes to `variables` are straightforward and contained within
`Canonicalizer`. The changes to `indices` are more complex but also
contained within `Canonicalizer`. The changes to `var_values` are more
intrusive because they require defining a new type
`SmallCanonicalVarValues` -- which is to `CanonicalVarValues` as
`SmallVec` is to `Vec -- and passing stack-allocated values of that type
in from outside.

All this speeds up a number of NLL "check" builds, the best by 2%.
2018-07-17 13:42:11 +10:00
Niko Matsakis 1d664622b6 remove `Canonicalization` trait, which serves no purpose 2018-06-26 10:59:38 -04:00
Niko Matsakis 21592cdecd move `Debug` bounds onto `Lift`
Just for convenience.
2018-06-26 10:49:24 -04:00