diff options
| author | Goldstein <root@goldstein.rs> | 2024-08-18 17:15:29 +0300 |
|---|---|---|
| committer | Goldstein <root@goldstein.rs> | 2024-08-18 20:32:04 +0300 |
| commit | df6cb954bb50fa8567f7198c02db90edda3cd3e4 (patch) | |
| tree | ca6d0a37479c58560e37f89d21c619c5451d43ef /compiler | |
| parent | 3a9bf4551374893fdc522572ee569028186e22cc (diff) | |
| download | rust-df6cb954bb50fa8567f7198c02db90edda3cd3e4.tar.gz rust-df6cb954bb50fa8567f7198c02db90edda3cd3e4.zip | |
Fix wording of misapplied `must_not_suspend` error
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/rustc_passes/messages.ftl | 4 | ||||
| -rw-r--r-- | compiler/rustc_passes/src/check_attr.rs | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_passes/messages.ftl b/compiler/rustc_passes/messages.ftl index 7d4f351560b..dfc726efeb9 100644 --- a/compiler/rustc_passes/messages.ftl +++ b/compiler/rustc_passes/messages.ftl @@ -478,8 +478,8 @@ passes_multiple_start_functions = .previous = previous `#[start]` function here passes_must_not_suspend = - `must_not_suspend` attribute should be applied to a struct, enum, or trait - .label = is not a struct, enum, or trait + `must_not_suspend` attribute should be applied to a struct, enum, union, or trait + .label = is not a struct, enum, union, or trait passes_must_use_async = `must_use` attribute on `async` functions applies to the anonymous `Future` returned by the function, not the value within diff --git a/compiler/rustc_passes/src/check_attr.rs b/compiler/rustc_passes/src/check_attr.rs index 60c8c1e7a00..e3c2999142f 100644 --- a/compiler/rustc_passes/src/check_attr.rs +++ b/compiler/rustc_passes/src/check_attr.rs @@ -1363,7 +1363,7 @@ impl<'tcx> CheckAttrVisitor<'tcx> { } } - /// Checks if `#[must_not_suspend]` is applied to a function. + /// Checks if `#[must_not_suspend]` is applied to a struct, enum, union, or trait. fn check_must_not_suspend(&self, attr: &Attribute, span: Span, target: Target) { match target { Target::Struct | Target::Enum | Target::Union | Target::Trait => {} |
