X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Flibrustc_mir%2Fconst_eval.rs;h=8c774e0d54cced74b57d1fb037c4127ed9df4b0e;hb=fb5ed488ff1a251db895c545592488a67be67112;hp=2e15f0de69f7019b064116ed0678daccadf3aa89;hpb=57236324ee7c914b7446f6c09057b4e06c4210b9;p=rust.git diff --git a/src/librustc_mir/const_eval.rs b/src/librustc_mir/const_eval.rs index 2e15f0de69f..8c774e0d54c 100644 --- a/src/librustc_mir/const_eval.rs +++ b/src/librustc_mir/const_eval.rs @@ -666,6 +666,7 @@ pub fn const_eval_raw_provider<'a, 'tcx>( tcx.at(tcx.def_span(def_id)), "any use of this value will cause an error", hir_id, + Some(err.span), ) }, // promoting runtime code is only allowed to error if it references broken constants @@ -682,6 +683,7 @@ pub fn const_eval_raw_provider<'a, 'tcx>( tcx.at(span), "reaching this expression at runtime will panic or abort", tcx.hir().as_local_hir_id(def_id).unwrap(), + Some(err.span), ) } // anything else (array lengths, enum initializers, constant patterns) are reported