Commit Graph

143 Commits

Author SHA1 Message Date
Santiago Pastorino
1688719214 Promote Refs to constants instead of static 2020-01-10 09:08:24 +01:00
Mazdak Farrokhzad
ebfd8673a7 Remove rustc_hir reexports in rustc::hir. 2020-01-05 12:49:22 +01:00
Oliver Scherer
b5b5258d74 Retire to_ptr which should already have no users but still kept getting new ones 2019-12-26 22:50:14 +01:00
Mark Rousskov
a06baa56b9 Format the world 2019-12-22 17:42:47 -05:00
Mazdak Farrokhzad
a7aec3f207 1. ast::Mutability::{Mutable -> Mut, Immutable -> Not}.
2. mir::Mutability -> ast::Mutability.
2019-12-20 22:22:44 +01:00
Alexander Regueiro
51cb60cd3f Aggregation of drive-by cosmetic changes. 2019-11-21 18:50:38 +00:00
bors
d8014582b8 Auto merge of #66384 - cjgillot:typefoldable, r=Zoxc
Derive TypeFoldable using a proc-macro

A new proc macro is added in librustc_macros.
It is used to derive TypeFoldable inside librustc and librustc_traits.

For now, the macro uses the `'tcx` lifetime implicitly, and does not allow for a more robust selection of the adequate lifetime.

The Clone-based TypeFoldable implementations are not migrated.

Closes #65674
2019-11-17 15:25:10 +00:00
Camille GILLOT
17692b5849 Use TypeFoldable derive macro. 2019-11-13 21:36:57 +01:00
Camille GILLOT
4caa66f25d Centril review. 2019-11-12 20:50:47 +01:00
Camille GILLOT
e5fb784823 Create intermediate enum ty::ConstKind. 2019-11-12 20:14:52 +01:00
Camille GILLOT
ed640c6a27 Merge hir::Mutability into ast::Mutability. 2019-11-10 12:21:05 +01:00
varkor
7f13a4a80a Remove FIXME 2019-10-22 12:26:32 +01:00
ben
a59eb6d554 Pretty print function pointer const values. 2019-10-09 05:10:00 +13:00
ben
2afd277bc3 Fix calling function pointer const parameters. Also fixes inference of
function pointer const parameters.
2019-10-09 05:10:00 +13:00
Mazdak Farrokhzad
17e1f23209
Rollup merge of #64817 - csmoe:closure, r=nikomatsakis
Replace ClosureSubsts with SubstsRef

Addresses https://github.com/rust-lang/rust/issues/42340 part 3
https://github.com/rust-lang/rust/pull/59312 might benefit from this clean up.
r? @nikomatsakis
2019-10-04 07:24:34 +02:00
csmoe
eab060f4da clean ClosureSubsts in rustc::ty 2019-09-29 16:17:46 +00:00
ben
c94fea092e Move get_slice_bytes to rustc::mir::interpret so it can be reused. 2019-09-28 14:35:04 +12:00
ben
875fa72f9e Add inline function get_slice_bytes to remove code duplication. 2019-09-28 13:30:26 +12:00
ben
22b87a5515 Add support for relating slices in super_relate_consts. 2019-09-28 10:05:37 +12:00
varkor
bea3d67c77 Rename subst::Kind to subst::GenericArg 2019-09-26 11:48:05 +01:00
varkor
e2e0f9af85 Rename sty to kind 2019-09-25 15:50:04 +01:00
Oliver Scherer
7dbc4b95fc Remove some duplication when resolving constants 2019-08-21 02:29:08 +02:00
Oliver Scherer
7710820d18 Fiddle param env through to try_eval_bits in most places 2019-08-05 17:48:05 +02:00
Oliver Scherer
9b87d22ea8 Don't abort on unevaluated constants without at least tryting to eval them 2019-08-05 17:48:04 +02:00
varkor
87e73c1f82 Remove redundant method with const variable resolution 2019-07-31 01:51:20 +01:00
John Kåre Alsaker
c9325181d6 Don't use lift to detect local types 2019-06-26 13:04:05 +02:00
Oliver Scherer
811b996e58 Change ByRef to a struct variant to clarify its fields via names 2019-06-19 19:43:13 +02:00
Eduard-Mihai Burtescu
f3f9d6dfd9 Unify all uses of 'gcx and 'tcx. 2019-06-14 18:58:23 +03:00
Eduard-Mihai Burtescu
fff08cb043 Run rustfmt --file-lines ... for changes from previous commits. 2019-06-12 13:38:28 +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
37799a5552 rustc: replace TyCtxt<'a, 'gcx, 'tcx> with TyCtxt<'tcx, 'gcx, 'tcx>. 2019-06-12 13:38:27 +03:00
varkor
294916065a Fix nits 2019-05-28 21:35:20 +01:00
varkor
854995313a Reintroduce TypeError::FixedArraySize 2019-05-28 21:35:20 +01:00
varkor
d5c6cb8778 Eagerly evaluate in super_relate_consts 2019-05-28 21:35:20 +01:00
varkor
73f7e426be Relate identical parameters in array lengths 2019-05-28 21:34:42 +01:00
Ralf Jung
082da0c698 rename Scalar::Bits to Scalar::Raw and bits field to data 2019-05-26 11:08:03 +02:00
varkor
c3694e5ee6 Rename ParamTy::idx to ParamTy::index 2019-05-06 13:12:04 +01:00
varkor
97c0c6653b Remove spurious assertion 2019-05-01 23:11:19 +01:00
varkor
f241693662 Fix missing parenthesis 2019-05-01 23:11:19 +01:00
varkor
fc16b0a147 Fix rebase from LazyConst removal 2019-05-01 23:11:19 +01:00
varkor
f5712d2de0 Add ConstValue::Placeholder 2019-05-01 23:10:57 +01:00
varkor
245a474ab7 Inline ConstError into TypeError 2019-05-01 23:10:57 +01:00
varkor
d113ff8ada Handle generic consts in relate and infer
Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
2019-05-01 23:10:57 +01:00
varkor
cafa10d96e Define super_relate_consts
Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
2019-05-01 23:10:05 +01:00
varkor
f1c83de1dd Add consts to TypeRelation
Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
2019-05-01 23:10:05 +01:00
Mazdak Farrokhzad
a8b854bde0
Rollup merge of #60287 - Zoxc:the-arena-variances_of, r=eddyb
Use references for variances_of

Based on https://github.com/rust-lang/rust/pull/60280.

cc @varkor
r? @eddyb
2019-05-01 08:29:09 +02:00
varkor
a3470c6189 Update handling of Tuple 2019-04-26 21:09:32 +01:00
John Kåre Alsaker
d2ff829433 Update variances_of 2019-04-25 22:29:29 +02:00
Oliver Scherer
5cd2806621 Revert the LazyConst PR 2019-03-16 21:04:10 +01:00
Eduard-Mihai Burtescu
01fa283d6f rustc: remove fmt::{Debug,Display} from ty::TyKind. 2019-03-15 09:26:13 +02:00