Skip to content

Commit

Permalink
rustc_error: make ErrorReported impossible to construct
Browse files Browse the repository at this point in the history
There are a few places were we have to construct it, though, and a few
places that are more invasive to change. To do this, we create a
constructor with a long obvious name.
  • Loading branch information
mark-i-m committed Mar 16, 2022
1 parent e439761 commit c56a10c
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/constant.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
//! Handling of `static`s, `const`s and promoted allocations
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
use rustc_errors::ErrorGuaranteed;
use rustc_middle::middle::codegen_fn_attrs::CodegenFnAttrFlags;
use rustc_middle::mir::interpret::{
read_target_uint, AllocId, ConstAllocation, ConstValue, ErrorHandled, GlobalAlloc, Scalar,
Expand Down Expand Up @@ -54,7 +53,7 @@ pub(crate) fn check_constants(fx: &mut FunctionCx<'_, '_, '_>) -> bool {
{
all_constants_ok = false;
match err {
ErrorHandled::Reported(ErrorGuaranteed) | ErrorHandled::Linted => {
ErrorHandled::Reported(_) | ErrorHandled::Linted => {
fx.tcx.sess.span_err(constant.span, "erroneous constant encountered");
}
ErrorHandled::TooGeneric => {
Expand Down

0 comments on commit c56a10c

Please sign in to comment.