Skip to content

Commit c56a10c

Browse files
committed
rustc_error: make ErrorReported impossible to construct
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.
1 parent e439761 commit c56a10c

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/constant.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
//! Handling of `static`s, `const`s and promoted allocations
22
33
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
4-
use rustc_errors::ErrorGuaranteed;
54
use rustc_middle::middle::codegen_fn_attrs::CodegenFnAttrFlags;
65
use rustc_middle::mir::interpret::{
76
read_target_uint, AllocId, ConstAllocation, ConstValue, ErrorHandled, GlobalAlloc, Scalar,
@@ -54,7 +53,7 @@ pub(crate) fn check_constants(fx: &mut FunctionCx<'_, '_, '_>) -> bool {
5453
{
5554
all_constants_ok = false;
5655
match err {
57-
ErrorHandled::Reported(ErrorGuaranteed) | ErrorHandled::Linted => {
56+
ErrorHandled::Reported(_) | ErrorHandled::Linted => {
5857
fx.tcx.sess.span_err(constant.span, "erroneous constant encountered");
5958
}
6059
ErrorHandled::TooGeneric => {

0 commit comments

Comments
 (0)