bors
874dec25ed
Auto merge of #52115 - Dylan-DPC:feature/nll-liveness-regions, r=nikomatsakis
...
only compute liveness for variables whose types include regions
Closes #52034
r? @nikomatsakis
2018-07-21 21:01:17 +00:00
bors
509cbf3e8e
Auto merge of #52498 - oli-obk:const_prop, r=nikomatsakis
...
Const propagate casts
fixes #49760
So... This fixes the original issue about the missing warnings.
But our test suite contains fun things like
```rust
fn foo() {}
assert_eq!(foo as i16, foo as usize as i16);
```
Which, will result in
> a raw memory access tried to access part of a pointer value as raw bytes
on both sides of the assertion. Because well... that's exactly what's going on! We're ripping out 16 bits of a pointer.
2018-07-20 13:22:36 +00:00
dylan_DPC
4e3339efda
move NllLivenessMap and LocalWithRegion to liveness_map
2018-07-20 17:51:34 +05:30
Niko Matsakis
43b69c2777
make liveness generic over set of local variables
...
We used to hardcode that we wanted the liveness of *all* variables.
This can now be configured by selecting an alternative index type
V and providing a (partial) map from locals to that new type V.
2018-07-19 23:15:26 +05:30
dylan_DPC
f2b5583f60
add trait structs and other changes from V to local
2018-07-19 23:15:16 +05:30
dylan_DPC
38c7d1ab7c
add generic parameter
2018-07-19 23:14:10 +05:30
Oliver Schneider
9329957d32
Const-propagate casts
2018-07-18 18:52:43 +02:00
bors
29ee65411c
Auto merge of #52364 - ljedrz:mir_remove_clone, r=RalfJung
...
Remove a clone in mir/transform/add_validation
Remove a clone of `mir.local_decls`.
2018-07-18 11:49:38 +00:00
csmoe
5b0cf56f32
ItemKind
2018-07-16 15:09:17 +02:00
csmoe
6a16b38198
ExprKind
2018-07-16 15:09:16 +02:00
ljedrz
d5219a7caa
Remove a clone in mir/transform/add_validation.
2018-07-15 16:17:15 +02:00
Ralf Jung
f68323b28a
fix typo
2018-07-11 12:00:05 +02:00
Ralf Jung
f511c5ea4a
improve error message shown for unsafe operations: explain why undefined behavior could arise
...
Inspired by @gnzlbg at https://github.com/rust-lang/rust/issues/46043#issuecomment-381544673
2018-07-10 11:01:44 +02:00
Santiago Pastorino
25266c1840
Do not run AST borrowck when -Zborrowck=mir
2018-07-05 16:57:32 -03:00
Santiago Pastorino
0e31e2fa9b
Remove rustc_mir_borrowck attribute and use rustc_mir instead
2018-07-04 23:10:28 -03:00
Alexander Regueiro
13b82ecf80
Minor refactoring.
2018-06-30 23:53:52 +01:00
Alexander Regueiro
13931762e9
Loosened rules involving statics mentioning other statics.
...
Updated tests accordingly.
2018-06-30 23:52:33 +01:00
Oliver Schneider
4d473300a2
Turn the use of erroneous constants into errors again
2018-06-28 11:04:26 +02:00
Oliver Schneider
4eea1a4e5e
Don't const propagate the body of constants
2018-06-28 11:04:25 +02:00
Oliver Schneider
4bb9648b27
Merge ConstVal and ConstValue
2018-06-28 11:04:25 +02:00
Oliver Schneider
05994779ea
Move everything over from middle::const_val to mir::interpret
2018-06-28 11:02:31 +02:00
Oliver Schneider
6005b0ad2f
Move the Lrc outside the error type and name the fields
2018-06-28 11:01:35 +02:00
Oliver Schneider
6f8fe4eaef
Eliminate old CTFE's ErrKind
2018-06-28 11:01:35 +02:00
Without Boats
18ff7d091a
Parse async fn header.
...
This is gated on edition 2018 & the `async_await` feature gate.
The parser will accept `async fn` and `async unsafe fn` as fn
items. Along the same lines as `const fn`, only `async unsafe fn`
is permitted, not `unsafe async fn`.The parser will not accept
`async` functions as trait methods.
To do a little code clean up, four fields of the function type
struct have been merged into the new `FnHeader` struct: constness,
asyncness, unsafety, and ABI.
Also, a small bug in HIR printing is fixed: it previously printed
`const unsafe fn` as `unsafe const fn`, which is grammatically
incorrect.
2018-06-21 22:29:47 -07:00
Felix S. Klock II
cac61267a7
Thread info about form of variable bindings, including spans of arg types, down into mir::LocalDecls.
...
As a drive-by: the ref_for_guards created by `fn declare_binding`
should not have been tagged as user_variables in the first
place. These secret internal locals are *pointers* to user variables,
but themselves are not such (IMO. For now at least.)
2018-06-19 19:38:37 +02:00
Eduard-Mihai Burtescu
5a5c7ded0d
rustc: rename ty::maps to ty::query.
2018-06-14 18:05:12 +03:00
Oliver Schneider
8a74be6684
Add source information the const propagation of places
2018-06-05 20:49:47 +02:00
Oliver Schneider
5c0d1355f2
Refactor the const eval diagnostic API
2018-06-05 20:49:46 +02:00
Fabian Zaiser
589f9a87a8
Propagate uses of constants correctly so that array index checks work
2018-06-05 10:35:44 +02:00
bors
c610be92e2
Auto merge of #51307 - oli-obk:miri_fixes, r=eddyb
...
ScalarPairs are offset==0 field + other non-zst field
r? @eddyb
fixes #51300
2018-06-04 23:10:15 +00:00
Oliver Schneider
f7eedfab8e
Simplify value field access
2018-06-04 14:50:29 +02:00
Oliver Schneider
9d613c27b7
Do not promote union field accesses
2018-06-03 19:06:31 +02:00
Oliver Schneider
47f37d67f1
Correctly access ScalarPair fields during const eval
2018-06-02 23:34:25 +02:00
Mark Simulacrum
5c374739b6
Specify that packed types must derive, not implement, Copy
2018-06-02 07:24:34 -06:00
Linus Färnstrand
376b6407a8
Make ctpop, cttz, ctlz and bswap const fns
2018-05-31 19:18:42 +02:00
Eduard-Mihai Burtescu
06d88cda08
rustc: rename mir::LocalDecl's syntactic_source_info to source_info.
2018-05-30 20:30:10 +03:00
Eduard-Mihai Burtescu
6c53972478
rustc: turn mir::LocalDecl's visibility_source_info into a SourceScope.
2018-05-30 20:30:10 +03:00
Eduard-Mihai Burtescu
3da186b67f
rustc: use syntactic (instead of visibility) source info where appropriate.
2018-05-30 20:30:10 +03:00
Eduard-Mihai Burtescu
0895590c53
rustc: rename mir::LocalDecl's source_info to visibility_source_info.
2018-05-30 20:30:10 +03:00
Eduard-Mihai Burtescu
b10c157bd8
rustc: turn mir::LocalDecl's syntactic_scope into a SourceInfo.
2018-05-30 20:30:10 +03:00
Eduard-Mihai Burtescu
ca1ac6b6fb
rustc: rename mir::SourceScopeInfo to mir::SourceScopeLocalData.
2018-05-30 20:30:09 +03:00
Eduard-Mihai Burtescu
85d44c4276
rustc: rename mir::VisibilityScope to mir::SourceScope.
2018-05-30 20:30:09 +03:00
Felix S. Klock II
24abe6f363
rust-lang/rust#27282 : Add StatementKind::ReadForMatch to MIR.
...
(This is just the data structure changes and some boilerplate match
code that followed from it; the actual emission of these statements
comes in a follow-up commit.)
2018-05-29 23:01:36 +02:00
bors
990d8aa743
Auto merge of #50967 - oli-obk:miri_api_refactor, r=eddyb
...
Miri api refactor
r? @eddyb
cc @Zoxc
based on https://github.com/rust-lang/rust/pull/50916
2018-05-25 13:59:48 +00:00
Oliver Schneider
cc60a22b10
Get rid of scalar_size
2018-05-24 20:49:37 +02:00
Oliver Schneider
f82256e473
primval -> scalar rename
2018-05-24 20:49:37 +02:00
Oliver Schneider
64a75ecc80
change Value::Bytes to Value::Bits
2018-05-24 20:49:37 +02:00
Oliver Schneider
ef2177cffc
Rename ByVal(Pair) to Scalar(Pair)
2018-05-24 20:47:35 +02:00
Oliver Schneider
1606e137e7
Rename PrimVal to Scalar
2018-05-24 20:47:35 +02:00
Oliver Schneider
a11f7856f4
Always mark unstable const fn as not const
2018-05-24 17:22:31 +02:00