diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-01-04 12:54:23 +1100 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-01-10 07:33:07 +1100 |
| commit | 2ea7a37e1113febac8603729e33fdd94f2738807 (patch) | |
| tree | 06b41ca2baec6e8b67695ae1fbb716e115b4653b /compiler/rustc_const_eval/src | |
| parent | 3c4f1d85af07f394da922f0bd9ff7c0a91e81f45 (diff) | |
| download | rust-2ea7a37e1113febac8603729e33fdd94f2738807.tar.gz rust-2ea7a37e1113febac8603729e33fdd94f2738807.zip | |
Add `DiagCtxt::delayed_bug`.
We have `span_delayed_bug` and often pass it a `DUMMY_SP`. This commit adds `delayed_bug`, which matches pairs like `err`/`span_err` and `warn`/`span_warn`.
Diffstat (limited to 'compiler/rustc_const_eval/src')
| -rw-r--r-- | compiler/rustc_const_eval/src/const_eval/machine.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/rustc_const_eval/src/const_eval/machine.rs b/compiler/rustc_const_eval/src/const_eval/machine.rs index 19489f1e7ef..6947ace17c5 100644 --- a/compiler/rustc_const_eval/src/const_eval/machine.rs +++ b/compiler/rustc_const_eval/src/const_eval/machine.rs @@ -391,10 +391,10 @@ impl<'mir, 'tcx> interpret::Machine<'mir, 'tcx> for CompileTimeInterpreter<'mir, if ecx.tcx.is_ctfe_mir_available(def) { Ok(ecx.tcx.mir_for_ctfe(def)) } else if ecx.tcx.def_kind(def) == DefKind::AssocConst { - let guar = ecx.tcx.dcx().span_delayed_bug( - rustc_span::DUMMY_SP, - "This is likely a const item that is missing from its impl", - ); + let guar = ecx + .tcx + .dcx() + .delayed_bug("This is likely a const item that is missing from its impl"); throw_inval!(AlreadyReported(guar.into())); } else { // `find_mir_or_eval_fn` checks that this is a const fn before even calling us, |
