]> git.lizzy.rs Git - rust.git/commit
Auto merge of #71049 - eddyb:const-err, r=oli-obk
authorbors <bors@rust-lang.org>
Fri, 17 Apr 2020 11:52:01 +0000 (11:52 +0000)
committerbors <bors@rust-lang.org>
Fri, 17 Apr 2020 11:52:01 +0000 (11:52 +0000)
commit8d67f576b56e8fc98a31123e5963f8d00e40611c
tree41ca42929c30c4fe7da7021b9f4dc7355e7ffe47
parentb2c1a606feb1fbdb0ac0acba76f881ef172ed474
parent77f38dc284c3adab8c529e478fe8b2fa5e4a82d3
Auto merge of #71049 - eddyb:const-err, r=oli-obk

Add `ConstKind::Error` and convert `ErrorHandled::Reported` to it.

By replicating the `ty::Error` approach to encoding "an error has occurred", all of the mechanisms that skip redundant/downstream errors are engaged and help out (see the reduction in test output).

This PR also adds `ErrorHandled::Linted` for the lint case because using `ErrorHandled::Reported` *without* having emitted an error that is *guaranteed* to stop compilation, is incorrect now.

r? @oli-obk cc @rust-lang/wg-const-eval @varkor @yodaldevoid
src/librustc_infer/infer/error_reporting/mod.rs
src/librustc_middle/mir/interpret/error.rs
src/librustc_mir/borrow_check/mod.rs
src/librustc_mir/monomorphize/collector.rs
src/librustc_trait_selection/traits/error_reporting/mod.rs
src/librustc_typeck/check/writeback.rs