diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2023-10-14 13:36:29 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-10-14 13:36:29 +0200 |
| commit | 24116aebe046ba152f705ea7548e5f423a300631 (patch) | |
| tree | 0c0e48b3e21390ad6f2ec91c6b763468ab695594 | |
| parent | 6fef4f089ffa929033a485242c83fc4d582c41a6 (diff) | |
| parent | 362b75badfca2515ccbfdad7c0738017e449c1c0 (diff) | |
Rollup merge of #116704 - compiler-errors:afit-lint-plus, r=tmandry
Fix AFIT lint message to mention pitfall Addresses https://github.com/rust-lang/rust/pull/116184#issuecomment-1745194387 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`
| -rw-r--r-- | compiler/rustc_lint/messages.ftl | 2 | ||||
| -rw-r--r-- | tests/ui/async-await/in-trait/warn.stderr | 2 |
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 e3ec3883224..d0278628c97 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; |
