Skip to content

Commit fe51d07

Browse files
authored
Rollup merge of #99712 - davidtwco:translation-migrate-passes-2, r=compiler-errors
passes: port more of `check_attr` module Continues from #99213. Port more diagnostics in `rustc_passes::check_attr` to using the diagnostic derive and translation machinery. r? `@compiler-errors`
2 parents 181bf05 + 76cf6bd commit fe51d07

File tree

6 files changed

+508
-278
lines changed

6 files changed

+508
-278
lines changed

compiler/rustc_error_messages/locales/en-US/passes.ftl

+107
Original file line numberDiff line numberDiff line change
@@ -149,3 +149,110 @@ passes-cold = {passes-should-be-applied-to-fn}
149149
passes-link = attribute should be applied to an `extern` block with non-Rust ABI
150150
.warn = {-passes-previously-accepted}
151151
.label = not an `extern` block
152+
153+
passes-link-name = attribute should be applied to a foreign function or static
154+
.warn = {-passes-previously-accepted}
155+
.label = not a foreign function or static
156+
.help = try `#[link(name = "{$value}")]` instead
157+
158+
passes-no-link = attribute should be applied to an `extern crate` item
159+
.label = not an `extern crate` item
160+
161+
passes-export-name = attribute should be applied to a free function, impl method or static
162+
.label = not a free function, impl method or static
163+
164+
passes-rustc-layout-scalar-valid-range-not-struct = attribute should be applied to a struct
165+
.label = not a struct
166+
167+
passes-rustc-layout-scalar-valid-range-arg = expected exactly one integer literal argument
168+
169+
passes-rustc-legacy-const-generics-only = #[rustc_legacy_const_generics] functions must only have const generics
170+
.label = non-const generic parameter
171+
172+
passes-rustc-legacy-const-generics-index = #[rustc_legacy_const_generics] must have one index for each generic parameter
173+
.label = generic parameters
174+
175+
passes-rustc-legacy-const-generics-index-exceed = index exceeds number of arguments
176+
.label = there {$arg_count ->
177+
[one] is
178+
*[other] are
179+
} only {$arg_count} {$arg_count ->
180+
[one] argument
181+
*[other] arguments
182+
}
183+
184+
passes-rustc-legacy-const-generics-index-negative = arguments should be non-negative integers
185+
186+
passes-rustc-dirty-clean = attribute requires -Z query-dep-graph to be enabled
187+
188+
passes-link-section = attribute should be applied to a function or static
189+
.warn = {-passes-previously-accepted}
190+
.label = not a function or static
191+
192+
passes-no-mangle-foreign = `#[no_mangle]` has no effect on a foreign {$foreign_item_kind}
193+
.warn = {-passes-previously-accepted}
194+
.label = foreign {$foreign_item_kind}
195+
.note = symbol names in extern blocks are not mangled
196+
.suggestion = remove this attribute
197+
198+
passes-no-mangle = attribute should be applied to a free function, impl method or static
199+
.warn = {-passes-previously-accepted}
200+
.label = not a free function, impl method or static
201+
202+
passes-repr-ident = meta item in `repr` must be an identifier
203+
204+
passes-repr-conflicting = conflicting representation hints
205+
206+
passes-used-static = attribute must be applied to a `static` variable
207+
208+
passes-used-compiler-linker = `used(compiler)` and `used(linker)` can't be used together
209+
210+
passes-allow-internal-unstable = attribute should be applied to a macro
211+
.label = not a macro
212+
213+
passes-debug-visualizer-placement = attribute should be applied to a module
214+
215+
passes-debug-visualizer-invalid = invalid argument
216+
.note-1 = expected: `natvis_file = "..."`
217+
.note-2 = OR
218+
.note-3 = expected: `gdb_script_file = "..."`
219+
220+
passes-rustc-allow-const-fn-unstable = attribute should be applied to `const fn`
221+
.label = not a `const fn`
222+
223+
passes-rustc-std-internal-symbol = attribute should be applied to functions or statics
224+
.label = not a function or static
225+
226+
passes-const-trait = attribute should be applied to a trait
227+
228+
passes-stability-promotable = attribute cannot be applied to an expression
229+
230+
passes-deprecated = attribute is ignored here
231+
232+
passes-macro-use = `#[{$name}]` only has an effect on `extern crate` and modules
233+
234+
passes-macro-export = `#[macro_export]` only has an effect on macro definitions
235+
236+
passes-plugin-registrar = `#[plugin_registrar]` only has an effect on functions
237+
238+
passes-unused-empty-lints-note = attribute `{$name}` with an empty list has no effect
239+
240+
passes-unused-no-lints-note = attribute `{$name}` without any lints has no effect
241+
242+
passes-unused-default-method-body-const-note =
243+
`default_method_body_is_const` has been replaced with `#[const_trait]` on traits
244+
245+
passes-unused = unused attribute
246+
.suggestion = remove this attribute
247+
248+
passes-non-exported-macro-invalid-attrs = attribute should be applied to function or closure
249+
.label = not a function or closure
250+
251+
passes-unused-duplicate = unused attribute
252+
.suggestion = remove this attribute
253+
.note = attribute also specified here
254+
.warn = {-passes-previously-accepted}
255+
256+
passes-unused-multiple = multiple `{$name}` attributes
257+
.suggestion = remove this attribute
258+
.note = attribute also specified here

0 commit comments

Comments
 (0)