Skip to content

Commit 193b93c

Browse files
Check for post-mono failures
1 parent db32f75 commit 193b93c

File tree

1 file changed

+6
-1
lines changed
  • compiler/rustc_monomorphize/src/mono_checks

1 file changed

+6
-1
lines changed

compiler/rustc_monomorphize/src/mono_checks/mod.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//! checks in a way that is friendly to incremental compilation.
44
55
use rustc_middle::query::Providers;
6-
use rustc_middle::ty::{Instance, TyCtxt};
6+
use rustc_middle::ty::{Instance, InstanceKind, TyCtxt};
77

88
mod abi_check;
99
mod move_check;
@@ -12,6 +12,11 @@ fn check_mono_item<'tcx>(tcx: TyCtxt<'tcx>, instance: Instance<'tcx>) {
1212
let body = tcx.instance_mir(instance.def);
1313
abi_check::check_feature_dependent_abi(tcx, instance, body);
1414
move_check::check_moves(tcx, instance, body);
15+
if let InstanceKind::Item(def_id) = instance.def {
16+
if tcx.instantiate_and_check_impossible_predicates((def_id, instance.args)) {
17+
tcx.dcx().span_err(tcx.def_span(def_id), "post-mono");
18+
}
19+
}
1520
}
1621

1722
pub(super) fn provide(providers: &mut Providers) {

0 commit comments

Comments
 (0)