John Kåre Alsaker
c9d9c249ec
Insert fields from TypeAndMut into TyRef to allow layout optimization
2018-05-08 16:21:58 +02:00
John Kåre Alsaker
710b4ad2a5
Store the GeneratorInterior in the new GeneratorSubsts
2018-05-08 16:21:58 +02:00
John Kåre Alsaker
0edc8f4270
Store generator movability outside GeneratorInterior
2018-05-08 16:21:58 +02:00
Irina Popa
04fa0e7bb3
rustc_target: move in syntax::abi and flip dependency.
2018-04-26 17:49:16 +03:00
Tyler Mandry
98546f8b26
Make Binder's field private and clean up its usage
2018-04-24 22:12:07 -05:00
Andrew Cann
9b15ddb29e
remove defaulting to unit
...
Types will no longer default to `()`, instead always defaulting to `!`.
This disables the associated warning and removes the flag from TyTuple
2018-03-14 12:44:51 +08:00
Niko Matsakis
6d0f9319df
refactor ParamEnv::empty(Reveal)
into two distinct methods
...
- `ParamEnv::empty()` -- does not reveal all, good for typeck
- `ParamEnv::reveal_all()` -- does, good for trans
- `param_env.with_reveal_all()` -- converts an existing parameter environment
2018-03-13 11:21:30 -04:00
Niko Matsakis
5ddcd09b53
add TypeRelation
and Lift
impls for Kind
2018-03-13 11:21:29 -04:00
Niko Matsakis
23837c1901
improve TypeFoldable/Lift macros and make a bunch of stuff use them
...
Improvements:
- Use Clone not Copy for the "simple cases"
- Separate TypeFoldable and Lift for the "simple cases"
- Support generics type parameters
- Support named fields in enum variants
- etc
2018-03-13 11:21:29 -04:00
Alexander Regueiro
b2b101befc
Prepare for using miri in trans
2018-03-08 08:09:01 +01:00
Oliver Schneider
28572d2c1f
Nuke the entire ctfe from orbit, it's the only way to be sure
2018-03-08 08:08:14 +01:00
Oliver Schneider
918b6d7633
Produce instead of pointers
2018-03-08 08:08:14 +01:00
varkor
8b2037c6fe
Introduce UnpackedKind
...
This adds an `UnpackedKind` type as a typesafe counterpart to `Kind`. This should make future changes to kinds (such as const generics!) more resilient, as the type-checker should catch more potential issues.
2018-02-23 01:13:54 +00:00
John Kåre Alsaker
ccf0d8399e
Adds support for immovable generators. Move checking of invalid borrows across suspension points to borrowck. Fixes #44197 , #45259 and #45093 .
2018-01-23 05:10:38 +01:00
Paul Lietar
77f7e85d7f
Implement RFC 1861: Extern types
2017-10-27 23:01:34 +02:00
Eduard-Mihai Burtescu
74349fa288
rustc: evaluate fixed-length array length expressions lazily.
2017-09-11 08:41:16 +03:00
Eduard-Mihai Burtescu
8a9b78f5cc
rustc: use ty::Const for the length of TyArray.
2017-09-11 08:41:15 +03:00
Eduard-Mihai Burtescu
3ce31eb990
rustc: replace usize with u64 and ConstUsize.
2017-09-11 08:41:15 +03:00
Alex Crichton
1210ebff43
Merge remote-tracking branch 'origin/master' into gen
2017-08-16 10:03:47 -07:00
Zack M. Davis
1b6c9605e4
use field init shorthand EVERYWHERE
...
Like #43008 (f668999
), but _much more aggressive_.
2017-08-15 15:29:17 -07:00
Alex Crichton
352577f4bb
Initial pass review comments
2017-08-09 13:56:19 -07:00
John Kåre Alsaker
d861982ca6
Generator literal support
2017-07-28 15:46:23 +02:00
Tobias Schottdorf
687ee7fee4
Downgrade ProjectionTy's TraitRef to its substs
...
Addresses the second part of #42171 by removing the `TraitRef` from
`ProjectionTy`, and directly storing its `Substs`.
Closes #42171 .
2017-07-11 10:33:09 -04:00
Zack M. Davis
f668999153
use field init shorthand in src/librustc
...
The field init shorthand syntax was stabilized in 1.17.0 (aebd94f
); we
are now free to use it in the compiler.
2017-07-05 22:37:10 -07:00
Eduard-Mihai Burtescu
a9d4069975
rustc_typeck: support functions in variance computation.
2017-06-27 16:39:58 +03:00
Eduard-Mihai Burtescu
33ecf72e8e
rustc: move the PolyFnSig out of TyFnDef.
2017-06-27 16:39:52 +03:00
Tobias Schottdorf
e5e664fb07
Upgrade ProjectionTy's Name to a DefId
...
Part of #42171 , in preparation for downgrading the contained `TraitRef` to
only its `substs`.
2017-05-31 12:35:13 -04:00
Niko Matsakis
d22d1feae1
do not fetch variance for items when equating
...
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-05-11 10:54:19 -04:00
Niko Matsakis
4824a199ca
factor variances into a proper query
...
There are now two queries: crate and item. The crate one computes the
variance of all items in the crate; it is sort of an implementation
detail, and not meant to be used. The item one reads from the crate one,
synthesizing correct deps in lieu of the red-green algorithm.
At the same time, remove the `variance_computed` flag, which was a
horrible hack used to force invariance early on (e.g. when type-checking
constants). This is only needed because of trait applications, and
traits are always invariant anyway. Therefore, we now change to take
advantage of the query system:
- When asked to compute variances for a trait, just return a vector
saying 'all invariant'.
- Remove the corresponding "inferreds" from traits, and tweak the
constraint generation code to understand that traits are always
inferred.
2017-05-03 16:42:07 -04:00
Niko Matsakis
c7dc39dbf0
intern CodeExtents
...
Make a `CodeExtent<'tcx>` be something allocated in an arena
instead of an index into the `RegionMaps`.
2017-04-30 17:02:59 -04:00
Eduard-Mihai Burtescu
612bb1f54e
rustc: rename some of the queries to match tcx methods.
2017-04-24 15:20:52 +03:00
Eduard-Mihai Burtescu
91374f8fe4
rustc: combine BareFnTy and ClosureTy into FnSig.
2017-02-25 17:47:15 +02:00
Esteban Küber
a7f63d12a7
Remove noop method Substs::params()
...
Re: 48b3dd11f5
2017-02-15 22:17:07 -08:00
Andrew Cann
2cc84df44c
Add warning for () to ! switch
2017-02-03 18:48:15 +08:00
Vadim Petrochenkov
ffba0cea62
Merge ty::TyBox into ty::TyAdt
2017-01-30 23:14:15 +03:00
Mark-Simulacrum
296ec5f9b7
Refactor FnSig to contain a Slice for its inputs and outputs.
2016-12-05 22:33:38 -07:00
Mark-Simulacrum
1eab19dba8
Refactor ty::FnSig to privatize all fields
2016-12-05 22:22:49 -07:00
Mark-Simulacrum
bb35d50cad
Refactor TyTrait to contain a interned ExistentialPredicate slice.
...
Renames TyTrait to TyDynamic.
2016-11-28 18:09:13 -07:00
Mark-Simulacrum
64e97d9b33
Remove BuiltinBound and BuiltinBounds.
2016-11-28 06:37:08 -07:00
Mark-Simulacrum
607af7218b
Refactor BuiltinBounds to Vec<DefId> on TraitObject.
2016-11-28 06:37:08 -07:00
Mark-Simulacrum
46c7a117f8
Privatize TraitObject.principal and add a method accessor, returning Option.
2016-11-28 06:37:08 -07:00
Ariel Ben-Yehuda
ca9b5664c3
rustc: move closure upvar types to the closure substs
...
This moves closures to the (DefId, Substs) scheme like all other items,
and saves a word from the size of TyS now that Substs is 2 words.
2016-11-12 19:00:50 +02:00
Mark-Simulacrum
982a48575b
Utilize AccumulateVec to avoid heap allocations in mk_{substs, type_list, tup} calls.
2016-10-25 20:06:17 -06:00
Mark-Simulacrum
83b198249f
Use TypedArena::alloc_slice in rustc.
2016-10-19 07:53:56 -06:00
Vadim Petrochenkov
f2b672d556
Refactor TyStruct
/TyEnum
/TyUnion
into TyAdt
2016-09-08 22:17:53 +03:00
Vadim Petrochenkov
641d8e9e4c
Some better support for unions through the compiler
2016-09-03 13:39:34 +03:00
Eduard Burtescu
7a8d4822d8
rustc: use Vec<Kind> in Substs, where Kind is a &TyS | &Region tagged pointer.
2016-08-27 01:15:07 +03:00
Eduard Burtescu
dffd238f8b
rustc: pass ty::Region behind an interned 'tcx reference.
2016-08-27 01:15:06 +03:00
Eduard Burtescu
5222fa58a1
rustc: use accessors for Substs::{types,regions}.
2016-08-27 00:25:04 +03:00
Nick Cameron
c32456da8f
Fix type error with ?
in existing code.
2016-08-22 09:31:26 +12:00