about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2023-10-13 19:11:16 +0000
committerMichael Goulet <michael@errs.io>2023-10-13 19:13:18 +0000
commit362b75badfca2515ccbfdad7c0738017e449c1c0 (patch)
tree365f6230d3c659b3d720d57c3e0fc91e36af611c
parent2763ca50da1192aa28295ef4dbe5d06443e1b90a (diff)
downloadrust-362b75badfca2515ccbfdad7c0738017e449c1c0.tar.gz
rust-362b75badfca2515ccbfdad7c0738017e449c1c0.zip
Fix AFIT lint message to mention pitfall
-rw-r--r--compiler/rustc_lint/messages.ftl2
-rw-r--r--tests/ui/async-await/in-trait/warn.stderr2
2 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_lint/messages.ftl b/compiler/rustc_lint/messages.ftl
index fa4b8e4c36b..197fe6552d7 100644
--- a/compiler/rustc_lint/messages.ftl
+++ b/compiler/rustc_lint/messages.ftl
@@ -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`
diff --git a/tests/ui/async-await/in-trait/warn.stderr b/tests/ui/async-await/in-trait/warn.stderr
index eac41a6e924..7cc64dff4b6 100644
--- a/tests/ui/async-await/in-trait/warn.stderr
+++ b/tests/ui/async-await/in-trait/warn.stderr
@@ -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;