Rollup merge of #60457 - wesleywiser:const_prop_refactoring, r=oli-obk

Const prop refactoring

This is rebased on top of #60428 so only the top commit is new.

This is the refactoring to remove the `mir` field from `ConstPropagator` which is necessary before we can begin to actually propagate constants.

r? @oli-obk
This commit is contained in:
Mazdak Farrokhzad 2019-05-03 16:25:05 +02:00 committed by GitHub
commit 3fe5fac96d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 81 additions and 56 deletions

View file

@ -13,4 +13,5 @@ const FOO: u8 = [5u8][1];
fn main() {
black_box((FOO, FOO));
//~^ ERROR erroneous constant used
//~| ERROR erroneous constant
}

View file

@ -13,11 +13,17 @@ LL | #![warn(const_err)]
| ^^^^^^^^^
error[E0080]: erroneous constant used
--> $DIR/const-err.rs:14:15
--> $DIR/const-err.rs:14:16
|
LL | black_box((FOO, FOO));
| ^^^^^^^^^^ referenced constant has errors
| ^^^ referenced constant has errors
error: aborting due to previous error
error[E0080]: erroneous constant used
--> $DIR/const-err.rs:14:21
|
LL | black_box((FOO, FOO));
| ^^^ referenced constant has errors
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0080`.