Skip to content

Commit

Permalink
Fix AFIT lint message to mention pitfall
Browse files Browse the repository at this point in the history
  • Loading branch information
compiler-errors committed Oct 13, 2023
1 parent 2763ca5 commit 362b75b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion compiler/rustc_lint/messages.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ lint_array_into_iter =
lint_async_fn_in_trait = use of `async fn` in public traits is discouraged as auto trait bounds cannot be specified
.note = you can suppress this lint if you plan to use the trait only in your own code, or do not care about auto traits like `Send` on the `Future`
.suggestion = you can alternatively desugar to a normal `fn` that returns `impl Future` and add any desired bounds such as `Send`
.suggestion = you can alternatively desugar to a normal `fn` that returns `impl Future` and add any desired bounds such as `Send`, but these cannot be relaxed without a breaking API change
lint_atomic_ordering_fence = memory fences cannot have `Relaxed` ordering
.help = consider using ordering modes `Acquire`, `Release`, `AcqRel` or `SeqCst`
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/async-await/in-trait/warn.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ note: the lint level is defined here
|
LL | #![deny(async_fn_in_trait)]
| ^^^^^^^^^^^^^^^^^
help: you can alternatively desugar to a normal `fn` that returns `impl Future` and add any desired bounds such as `Send`
help: you can alternatively desugar to a normal `fn` that returns `impl Future` and add any desired bounds such as `Send`, but these cannot be relaxed without a breaking API change
|
LL - async fn not_send();
LL + fn not_send() -> impl std::future::Future<Output = ()> + Send;
Expand Down

0 comments on commit 362b75b

Please sign in to comment.