Skip to content

Commit

Permalink
Rollup merge of #116704 - compiler-errors:afit-lint-plus, r=tmandry
Browse files Browse the repository at this point in the history
Fix AFIT lint message to mention pitfall

Addresses #116184 (comment) by adding a short note. Not sure exactly of the wording -- I don't think this should be a blocker for the stabilization PR since we can iterate on this lint's messaging in the next few weeks in the worst case.

r? `@tmandry` cc `@traviscross` `@jonhoo`
  • Loading branch information
matthiaskrgr committed Oct 14, 2023
2 parents 6fef4f0 + 362b75b commit 24116ae
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 24116ae

Please sign in to comment.