add error_occured field to ConstQualifs, fix #76064
This commit is contained in:
parent
7f5a42b073
commit
8bce9af78c
6 changed files with 30 additions and 6 deletions
|
@ -9,6 +9,7 @@ use crate::interpret::{
|
|||
use rustc_hir::def::DefKind;
|
||||
use rustc_middle::mir;
|
||||
use rustc_middle::mir::interpret::ErrorHandled;
|
||||
use rustc_errors::ErrorReported;
|
||||
use rustc_middle::traits::Reveal;
|
||||
use rustc_middle::ty::print::with_no_trimmed_paths;
|
||||
use rustc_middle::ty::{self, subst::Subst, TyCtxt};
|
||||
|
@ -274,6 +275,10 @@ pub fn eval_to_allocation_raw_provider<'tcx>(
|
|||
return Err(ErrorHandled::Reported(error_reported));
|
||||
}
|
||||
}
|
||||
let qualif = tcx.mir_const_qualif_opt_const_arg(def);
|
||||
if qualif.error_occured {
|
||||
return Err(ErrorHandled::Reported(ErrorReported {}));
|
||||
}
|
||||
}
|
||||
|
||||
let is_static = tcx.is_static(def.did);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue