drop_tracking_mir: avoid good path bug.
This commit is contained in:
parent
0916616fec
commit
135db79bc8
1 changed files with 8 additions and 6 deletions
|
@ -1872,12 +1872,14 @@ fn check_must_not_suspend_def(
|
||||||
data: SuspendCheckData<'_>,
|
data: SuspendCheckData<'_>,
|
||||||
) -> bool {
|
) -> bool {
|
||||||
if let Some(attr) = tcx.get_attr(def_id, sym::must_not_suspend) {
|
if let Some(attr) = tcx.get_attr(def_id, sym::must_not_suspend) {
|
||||||
let msg = format!(
|
let msg = rustc_errors::DelayDm(|| {
|
||||||
"{}`{}`{} held across a suspend point, but should not be",
|
format!(
|
||||||
data.descr_pre,
|
"{}`{}`{} held across a suspend point, but should not be",
|
||||||
tcx.def_path_str(def_id),
|
data.descr_pre,
|
||||||
data.descr_post,
|
tcx.def_path_str(def_id),
|
||||||
);
|
data.descr_post,
|
||||||
|
)
|
||||||
|
});
|
||||||
tcx.struct_span_lint_hir(
|
tcx.struct_span_lint_hir(
|
||||||
rustc_session::lint::builtin::MUST_NOT_SUSPEND,
|
rustc_session::lint::builtin::MUST_NOT_SUSPEND,
|
||||||
hir_id,
|
hir_id,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue