You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if let rustc_middle::ty::Adt(adt, _) = ty_cause.ty.kind() {
120
152
if is_mutex_guard(cx, adt.did) {
121
-
span_lint_and_note(
153
+
span_lint_and_then(
122
154
cx,
123
155
AWAIT_HOLDING_LOCK,
124
156
ty_cause.span,
125
-
"this MutexGuard is held across an 'await' point. Consider using an async-aware Mutex type or ensuring the MutexGuard is dropped before calling await",
126
-
ty_cause.scope_span.or(Some(span)),
127
-
"these are all the await points this lock is held through",
157
+
"this `MutexGuard` is held across an `await` point",
158
+
|diag| {
159
+
diag.help(
160
+
"consider using an async-aware `Mutex` type or ensuring the \
161
+
`MutexGuard` is dropped before calling await",
162
+
);
163
+
diag.span_note(
164
+
ty_cause.scope_span.unwrap_or(span),
165
+
"these are all the `await` points this lock is held through",
166
+
);
167
+
},
128
168
);
129
169
}
130
170
if is_refcell_ref(cx, adt.did) {
131
-
span_lint_and_note(
171
+
span_lint_and_then(
132
172
cx,
133
173
AWAIT_HOLDING_REFCELL_REF,
134
174
ty_cause.span,
135
-
"this RefCell Ref is held across an 'await' point. Consider ensuring the Ref is dropped before calling await",
136
-
ty_cause.scope_span.or(Some(span)),
137
-
"these are all the await points this ref is held through",
175
+
"this `RefCell` reference is held across an `await` point",
176
+
|diag| {
177
+
diag.help("ensure the reference is dropped before calling `await`");
178
+
diag.span_note(
179
+
ty_cause.scope_span.unwrap_or(span),
180
+
"these are all the `await` points this reference is held through",
0 commit comments