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
6288faa3a3
trans_apply_param_substs
=> subst_and_normalize_erasing_regions
...
Consolidate `trans_apply_param_substs` and
`trans_apply_param_substs_env`. Also remove `trans_impl_self_ty`
2018-03-13 11:22:08 -04: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
Oliver Schneider
c0fc6a8b6b
simplify constant value pair field access
2018-03-08 08:35:39 +01:00
Oliver Schneider
b5ace9a906
Unify the const folding errors
...
before they differed depending on whether optimizations were on or not
2018-03-08 08:35:39 +01:00
Oliver Schneider
aedd4c61ea
Regenerate tests
2018-03-08 08:35:38 +01:00
Oliver Schneider
3dc7e93db6
Generator assertions are unconditionally triggered
2018-03-08 08:35:38 +01:00
Oliver Schneider
df283df887
Don't use the undefined bytes of PrimVal::Bytes
2018-03-08 08:34:18 +01:00
Oliver Schneider
d98a2b90b2
Rebase fallout
2018-03-08 08:34:17 +01:00
Oliver Schneider
5b698a1040
Unregress error spans in constant errors
2018-03-08 08:34:17 +01:00
Oliver Schneider
3c663d0607
Tidy fix
2018-03-08 08:34:16 +01:00
Oliver Schneider
8c53d54b98
Update tests
2018-03-08 08:34:16 +01:00
Oliver Schneider
d2f363ba89
Report all errors other than those about insufficient type information
2018-03-08 08:34:15 +01:00
Oliver Schneider
64fbf5d5ad
Compute the ParamEnv only once and use it to call tcx.const_eval
2018-03-08 08:34:15 +01:00
Oliver Schneider
dde68dcfe5
Can only const prop temporaries
...
Variables might error in branches that are not reachable due to the variable value.
2018-03-08 08:34:15 +01:00
Oliver Schneider
1561b4ad50
Simplify const propagator by removing unused code paths
2018-03-08 08:34:15 +01:00
Oliver Schneider
411fcf58fd
Rename OptimizationFinder and don't propagate any borrows
2018-03-08 08:34:15 +01:00
Oliver Schneider
57ae890265
Simplify const prop checks through PlaceContext
2018-03-08 08:34:15 +01:00
Oliver Schneider
0462d092d2
Figure out const propgatable locals in a single pass
2018-03-08 08:34:14 +01:00
Oliver Schneider
ceb634a732
Update tests
2018-03-08 08:34:14 +01:00
Oliver Schneider
13c0dc56df
Only report bitshift lints on bitshift ops
2018-03-08 08:34:14 +01:00
Oliver Schneider
929a4cece5
Use IndexVec instead of FxHashMap
2018-03-08 08:34:14 +01:00
Oliver Schneider
8c8a433532
Merge const linting pass into const prop
2018-03-08 08:34:14 +01:00
Oliver Schneider
c568807989
Remove single field struct by just using the field
2018-03-08 08:34:13 +01:00
Oliver Schneider
4667346042
Remove the fragile const propagator and just do linting
2018-03-08 08:34:13 +01:00
Oliver Schneider
21554b96af
Fix ICE in const prop
2018-03-08 08:34:13 +01:00
Oliver Schneider
00c95b29bc
Revert all changes to the instcombine pass
2018-03-08 08:34:13 +01:00
Oliver Schneider
54615ec989
Split const prop into its own pass
2018-03-08 08:34:12 +01:00
Oliver Schneider
edb2af58e4
Don't use scary block reorderings
2018-03-08 08:34:12 +01:00
Oliver Schneider
3b8d2e0016
Rename ConstVal::to_u128 to to_raw_bits
2018-03-08 08:34:10 +01:00
Oliver Schneider
2f2c90e733
Destructure Rc wrapped ErrorKind in miri
2018-03-08 08:34:10 +01:00
Oliver Schneider
f14e746b2f
Enable const prop to also evaluate constants, not just literals
2018-03-08 08:34:08 +01:00
Oliver Schneider
7d2d4e3202
Add InterpretInterner to StableHashingContext for AllocId serialization
2018-03-08 08:34:08 +01:00
Oliver Schneider
b33e4e784e
Fully use miri in trans
2018-03-08 08:34:05 +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
Wesley Wiser
97b30f0961
Replace attr::contains_name(..., "cold")
...
Part of #47320
2018-03-06 19:58:02 -05:00
Wesley Wiser
4f840a683a
Add inline
to TransFnAttrs
...
Part of #47320
2018-03-06 19:58:02 -05:00
kennytm
57cfbeaf64
Rollup merge of #48727 - leodasvacas:refactor-contrived-match, r=rkruppe
...
Refactor contrived match.
2018-03-06 20:52:29 +08:00
Michael Woerister
542bc75dea
Turn features() into a query.
2018-03-05 11:05:01 +01:00
leonardo.yvens
0b0e1b71d5
Refactor contrived match.
2018-03-04 08:31:09 -03:00
Manish Goregaokar
3c95814294
Perform manual fixups
2018-03-02 21:02:37 -08:00
Manish Goregaokar
8d730ed527
Run Rustfix on librustc_mir
2018-03-02 21:02:37 -08:00
John Kåre Alsaker
b74e97cf42
Replace Rc with Lrc for shared data
2018-03-02 10:48:52 +01:00
Manish Goregaokar
f59ab8e96a
Rollup merge of #48355 - mikhail-m1:subslice_pattern_array_drop2, r=nikomatsakis
...
Fixes #47311 .
r? @nrc
2018-02-28 15:09:22 -08:00
Mikhail Modin
12c7e27330
restore Subslice move out from array after elaborate drops and borrowck
2018-02-25 18:59:16 +03:00
Manish Goregaokar
2dba874d57
Rollup merge of #48452 - varkor:unpacked-kind, r=eddyb
...
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 will be able to catch more potential issues.
r? @eddyb
cc @yodaldevoid
2018-02-24 15:52:15 -08:00
Manish Goregaokar
a1a1409647
Rollup merge of #48317 - ExpHP:unused-unsafe-is-no-fn, r=estebank
...
unused_unsafe: don't label irrelevant fns
Fixes #48131
Diagnostic bugfix to remove an errant note. Stops the search for an enclosing unsafe scope at the first safe fn encountered.
```rust
pub unsafe fn outer() {
fn inner() {
unsafe { /* unnecessary */ }
}
inner()
}
```
**Before:**
```
warning: unnecessary `unsafe` block
--> src/main.rs:3:9
|
1 | pub unsafe fn outer() {
| --------------------- because it's nested under this `unsafe` fn
2 | fn inner() {
3 | unsafe { /* unnecessary */ }
| ^^^^^^ unnecessary `unsafe` block
|
= note: #[warn(unused_unsafe)] on by default
```
**After:**
```
warning: unnecessary `unsafe` block
--> src/main.rs:3:9
|
3 | unsafe { /* unnecessary */ }
| ^^^^^^ unnecessary `unsafe` block
|
= note: #[warn(unused_unsafe)] on by default
```
2018-02-24 12:48:01 -08: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
Eduard-Mihai Burtescu
c9fcedeb4c
rustc_mir: optimize the deaggregator's expansion of statements.
2018-02-20 02:50:26 +02:00