135 Commits

Author SHA1 Message Date
Ralf Jung
8f05ff3e33 rename EvalResult -> InterpResult and EvalError -> InterpErrorInfo 2019-06-08 11:39:48 +02:00
Mark Mansi
74919df3a9 query-ify const_field 2019-06-02 23:03:58 -05:00
Ralf Jung
77be06b7ed no longer assume that there is a default tag: give the machine the chance to tag all allocations 2019-06-02 10:36:18 +02:00
Oliver Scherer
5b9848912a Make the type_name intrinsic's output deterministic 2019-05-30 11:19:22 +02:00
Mazdak Farrokhzad
ee08261c8c
Rollup merge of - TheSirC:fix/60229, r=eddyb
Changes the type `mir::Mir` into `mir::Body`

Fixes part 1 of  (previously attempted in ).

I stumbled upon the issue and it seems that the previous attempt at solving it was not merged. This is a second try more up-to-date.

The commit should have changed comments as well.
At the time of writting, it passes the tidy and check tool.
2019-05-29 00:19:55 +02:00
Claude-Alban RANÉLY-VERGÉ-DÉPRÉ
6e5e0daff2 Changes the type mir::Mir into mir::Body
The commit should have changed comments as well.
At the time of writting, it passes the tidy and check tool.

Revisions asked by eddyb :
- Renamed of all the occurences of {visit/super}_mir
- Renamed test structures `CachedMir` to `Cached`

Fixing the missing import on `AggregateKind`
2019-05-28 19:17:51 +02:00
Mazdak Farrokhzad
16ef483b79
Rollup merge of - RalfJung:scalar, r=oli-obk
rename Scalar::Bits to Scalar::Raw and bits field to data

Also use this opportunity to seal some abstraction leaks (other modules constructing `Scalar::Bits` directly instead of using a constructor).

r? @oli-obk
2019-05-28 18:15:39 +02:00
Andrew Xu
46b9ed4fa1 Rename "Associated*" to "Assoc*"
We are going to uniform the terminology of all associated items.
Methods that may or may not have `self` are called "associated
functions". Because `AssociatedFn` is a bit long, we rename `Associated`
to `Assoc`.
2019-05-26 17:49:02 +08:00
Ralf Jung
082da0c698 rename Scalar::Bits to Scalar::Raw and bits field to data 2019-05-26 11:08:03 +02:00
Oliver Scherer
fa17654f79 Make ConstValue::Slice solely take [u8] and str 2019-05-25 10:07:01 +02:00
Oliver Scherer
e694b63cd1 Don't use ty::Const without immediately interning 2019-05-25 10:07:01 +02:00
Eduard-Mihai Burtescu
b92b1a76e1 rustc: use DefKind instead of Def, where possible. 2019-05-03 22:50:09 +03:00
Eduard-Mihai Burtescu
a3fcab36d2 rustc: factor most DefId-containing variants out of Def and into DefKind. 2019-05-03 22:48:27 +03:00
Mazdak Farrokhzad
12bf981552
Rollup merge of - wesleywiser:refactor_const_eval, r=oli-obk
Refactor `eval_body_using_ecx` so that it doesn't need to query for MIR

This is the first step toward removing the `mir` field of `ConstPropagator` which will eventually allow us to actually const propagate in MIR.

r? @oli-obk
2019-05-02 01:09:28 +02:00
Wesley Wiser
eadf48e796 Refactor eval_body_using_ecx so that it doesn't need to query for MIR 2019-05-01 08:27:06 -04:00
flip1995
e1da67e69c
Fix lint findings in librustc_mir 2019-04-28 21:19:27 +02:00
Vadim Petrochenkov
6c187cc0c6 Change return type of TyCtxt::is_static to bool
Add `TyCtxt::is_mutable_static`
2019-04-21 14:41:51 +03:00
Ralf Jung
19485cc101 Miri: refactor new allocation tagging 2019-04-16 23:35:39 +02:00
Isaac Whitfield
bd7a8020cc Remove check_match from const_eval 2019-04-06 17:25:44 -07:00
kenta7777
3c8caaca7d renames EvalErrorKind to InterpError 2019-04-02 01:02:18 +09:00
Yuki OKUSHI
0778847833 Use ErrorReported 2019-03-29 04:42:03 +09:00
Yuki OKUSHI
6c8e3a5378 Remove unused variable 2019-03-29 04:32:36 +09:00
Yuki OKUSHI
f0de8e82b8 Return correct values 2019-03-29 04:32:36 +09:00
Yuki OKUSHI
0e76b34aa7 WIP: remove report_as_error 2019-03-29 04:32:36 +09:00
Yuki OKUSHI
ee0e1b7615 Set ok value 2019-03-29 04:32:36 +09:00
Yuki OKUSHI
526b355858 Remove err_count 2019-03-29 04:32:36 +09:00
Yuki OKUSHI
3ba7454152 Use track_errors 2019-03-29 04:32:36 +09:00
kenta7777
892f7c430d renames EvalContext to InterpretCx in docs and comments. 2019-03-27 10:57:03 +09:00
kenta7777
630d5a4895 renames EvalContext to InterpretCx. 2019-03-26 13:06:15 +09:00
bors
fb5ed488ff Auto merge of - estebank:untrack-errors, r=eddyb
Remove `track_errors` from `check_match`, `typeck_item_bodies` and `register_plugins`

In the spirit of continuing through errors in type checking (), remove `track_errors` from a couple of locations in the codebase.
2019-03-24 05:38:10 +00:00
Esteban Küber
8e043950c8 Swap const evaluation lint spans to point at problem in primary span 2019-03-23 13:05:30 -07:00
Esteban Küber
57236324ee Add note to address check_match errors 2019-03-22 20:32:10 -07:00
Esteban Küber
afdc38da0a address review comments 2019-03-22 20:15:32 -07:00
Oliver Scherer
5cd2806621 Revert the LazyConst PR 2019-03-16 21:04:10 +01:00
kennytm
3bf4398ed2
Rollup merge of - oli-obk:unions_are_a_good_thing, r=RalfJung
Unregress using scalar unions in constants.

fixes https://github.com/rust-lang/rust/issues/59126

r? @RalfJung

I also made a bunch of these invariants panic instead of report an error.
2019-03-16 22:40:10 +08:00
Ralf Jung
4653ae1e3e we can now print on entering/leaving the topmost frame, and make sure it stays that way 2019-03-15 13:25:10 +02:00
Eduard-Mihai Burtescu
e0c75ff40d rustc: rename item_path to def_path (except the module in ty). 2019-03-15 13:25:10 +02:00
Oliver Scherer
5074489456 Unregress using scalar unions in constants. 2019-03-12 17:37:22 +01:00
Mazdak Farrokhzad
19f969a465
Rollup merge of - oli-obk:unreachable_result_errors, r=RalfJung
Use early unwraps instead of bubbling up errors just to unwrap in the end

r? @RalfJung
2019-03-09 17:18:11 +01:00
ljedrz
cd06038b54 HirIdification: replace NodeId method calls 2019-03-07 09:22:43 +01:00
Oliver Scherer
5c0615b89c Use early unwraps instead of bubbling up errors just to unwrap in the end 2019-03-04 17:13:50 +01:00
bors
ea43c3c688 Auto merge of - ljedrz:HirIdify_some_nodes, r=Zoxc
Remove NodeId from some HIR nodes

The next iteration of https://github.com/rust-lang/rust/pull/57578.

Removes `NodeId` from:

- [x] `Lifetime`
- [x] `Ty`
- [x] `GenericParam`
- [x] `WhereClause`
- [x] `WhereEqPredicate`
- [x] `MacroDef`
- [x] `Block`
- [x] `Expr`

r? @Zoxc
2019-02-26 06:13:27 +00:00
ljedrz
021a140dcd hir: remove NodeId from Block 2019-02-24 17:09:26 +01:00
Oliver Scherer
27e438ad94 Make may_normalize explicit in the type system 2019-02-16 14:54:48 +01:00
Oliver Scherer
525983a2a4 Make validity checking use MPlaceTy instead of OpTy 2019-02-16 14:54:48 +01:00
Oliver Scherer
f7c493121d Reuse the Pointer type instead of passing reassembling it at many use sites 2019-02-16 14:29:27 +01:00
Oliver Scherer
b2bf37aec0 Burn some invariants we keep up into code 2019-02-16 13:27:54 +01:00
Oliver Scherer
235a6b7d06 Expose const -> op functions that don't allow violiting const eval invariants 2019-02-16 12:32:22 +01:00
Ralf Jung
b376ae6671 make bin_op and unary_op APIs consistently work on ImmTy 2019-02-13 10:14:56 +01:00
Ralf Jung
e73f96abe7 make OpTy.op private, and ImmTy.imm public instead 2019-02-13 10:14:56 +01:00