Skip to content

Commit 135db79

Browse files
committed
drop_tracking_mir: avoid good path bug.
1 parent 0916616 commit 135db79

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

compiler/rustc_mir_transform/src/generator.rs

+8-6
Original file line numberDiff line numberDiff line change
@@ -1872,12 +1872,14 @@ fn check_must_not_suspend_def(
18721872
data: SuspendCheckData<'_>,
18731873
) -> bool {
18741874
if let Some(attr) = tcx.get_attr(def_id, sym::must_not_suspend) {
1875-
let msg = format!(
1876-
"{}`{}`{} held across a suspend point, but should not be",
1877-
data.descr_pre,
1878-
tcx.def_path_str(def_id),
1879-
data.descr_post,
1880-
);
1875+
let msg = rustc_errors::DelayDm(|| {
1876+
format!(
1877+
"{}`{}`{} held across a suspend point, but should not be",
1878+
data.descr_pre,
1879+
tcx.def_path_str(def_id),
1880+
data.descr_post,
1881+
)
1882+
});
18811883
tcx.struct_span_lint_hir(
18821884
rustc_session::lint::builtin::MUST_NOT_SUSPEND,
18831885
hir_id,

0 commit comments

Comments
 (0)