Skip to content

Commit 767c865

Browse files
authored
Rollup merge of #108456 - clubby789:ast-passes-diag-migrate, r=compiler-errors
Complete migrating `ast_passes` to derive diagnostics cc #100717 ```@rustbot``` label +A-translation
2 parents a223ff7 + 885f9e7 commit 767c865

16 files changed

+833
-437
lines changed

compiler/rustc_ast_passes/locales/en-US.ftl

+147
Original file line numberDiff line numberDiff line change
@@ -87,3 +87,150 @@ ast_passes_fn_without_body =
8787
.suggestion = provide a definition for the function
8888
8989
ast_passes_extern_block_suggestion = if you meant to declare an externally defined function, use an `extern` block
90+
91+
ast_passes_bound_in_context = bounds on `type`s in {$ctx} have no effect
92+
93+
ast_passes_extern_types_cannot = `type`s inside `extern` blocks cannot have {$descr}
94+
.suggestion = remove the {$remove_descr}
95+
.label = `extern` block begins here
96+
97+
ast_passes_extern_keyword_link = for more information, visit https://doc.rust-lang.org/std/keyword.extern.html
98+
99+
ast_passes_body_in_extern = incorrect `{$kind}` inside `extern` block
100+
.cannot_have = cannot have a body
101+
.invalid = the invalid body
102+
.existing = `extern` blocks define existing foreign {$kind}s and {$kind}s inside of them cannot have a body
103+
104+
ast_passes_fn_body_extern = incorrect function inside `extern` block
105+
.cannot_have = cannot have a body
106+
.suggestion = remove the invalid body
107+
.help = you might have meant to write a function accessible through FFI, which can be done by writing `extern fn` outside of the `extern` block
108+
.label = `extern` blocks define existing foreign functions and functions inside of them cannot have a body
109+
110+
ast_passes_extern_fn_qualifiers = functions in `extern` blocks cannot have qualifiers
111+
.label = in this `extern` block
112+
.suggestion = remove the qualifiers
113+
114+
ast_passes_extern_item_ascii = items in `extern` blocks cannot use non-ascii identifiers
115+
.label = in this `extern` block
116+
.note = this limitation may be lifted in the future; see issue #83942 <https://github.com/rust-lang/rust/issues/83942> for more information
117+
118+
ast_passes_bad_c_variadic = only foreign or `unsafe extern "C"` functions may be C-variadic
119+
120+
ast_passes_item_underscore = `{$kind}` items in this context need a name
121+
.label = `_` is not a valid name for this `{$kind}` item
122+
123+
ast_passes_nomangle_ascii = `#[no_mangle]` requires ASCII identifier
124+
125+
ast_passes_module_nonascii = trying to load file for module `{$name}` with non-ascii identifier name
126+
.help = consider using the `#[path]` attribute to specify filesystem path
127+
128+
ast_passes_auto_generic = auto traits cannot have generic parameters
129+
.label = auto trait cannot have generic parameters
130+
.suggestion = remove the parameters
131+
132+
ast_passes_auto_super_lifetime = auto traits cannot have super traits or lifetime bounds
133+
.label = {ast_passes_auto_super_lifetime}
134+
.suggestion = remove the super traits or lifetime bounds
135+
136+
ast_passes_auto_items = auto traits cannot have associated items
137+
.label = {ast_passes_auto_items}
138+
.suggestion = remove these associated items
139+
140+
ast_passes_generic_before_constraints = generic arguments must come before the first constraint
141+
.constraints = {$constraint_len ->
142+
[one] constraint
143+
*[other] constraints
144+
}
145+
.args = generic {$args_len ->
146+
[one] argument
147+
*[other] arguments
148+
}
149+
.empty_string = {""},
150+
.suggestion = move the {$constraint_len ->
151+
[one] constraint
152+
*[other] constraints
153+
} after the generic {$args_len ->
154+
[one] argument
155+
*[other] arguments
156+
}
157+
158+
ast_passes_pattern_in_fn_pointer = patterns aren't allowed in function pointer types
159+
160+
ast_passes_trait_object_single_bound = only a single explicit lifetime bound is permitted
161+
162+
ast_passes_impl_trait_path = `impl Trait` is not allowed in path parameters
163+
164+
ast_passes_nested_impl_trait = nested `impl Trait` is not allowed
165+
.outer = outer `impl Trait`
166+
.inner = nested `impl Trait` here
167+
168+
ast_passes_at_least_one_trait = at least one trait must be specified
169+
170+
ast_passes_extern_without_abi = extern declarations without an explicit ABI are deprecated
171+
172+
ast_passes_out_of_order_params = {$param_ord} parameters must be declared prior to {$max_param} parameters
173+
.suggestion = reorder the parameters: lifetimes, then consts and types
174+
175+
ast_passes_obsolete_auto = `impl Trait for .. {"{}"}` is an obsolete syntax
176+
.help = use `auto trait Trait {"{}"}` instead
177+
178+
ast_passes_unsafe_negative_impl = negative impls cannot be unsafe
179+
.negative = negative because of this
180+
.unsafe = unsafe because of this
181+
182+
ast_passes_inherent_cannot_be = inherent impls cannot be {$annotation}
183+
.because = {$annotation} because of this
184+
.type = inherent impl for this type
185+
.only_trait = only trait implementations may be annotated with {$annotation}
186+
187+
ast_passes_unsafe_item = {$kind} cannot be declared unsafe
188+
189+
ast_passes_fieldless_union = unions cannot have zero fields
190+
191+
ast_passes_where_after_type_alias = where clauses are not allowed after the type for type aliases
192+
.note = see issue #89122 <https://github.com/rust-lang/rust/issues/89122> for more information
193+
194+
ast_passes_generic_default_trailing = generic parameters with a default must be trailing
195+
196+
ast_passes_nested_lifetimes = nested quantification of lifetimes
197+
198+
ast_passes_optional_trait_supertrait = `?Trait` is not permitted in supertraits
199+
.note = traits are `?{$path_str}` by default
200+
201+
ast_passes_optional_trait_object = `?Trait` is not permitted in trait object types
202+
203+
ast_passes_tilde_const_disallowed = `~const` is not allowed here
204+
.trait = trait objects cannot have `~const` trait bounds
205+
.closure = closures cannot have `~const` trait bounds
206+
.function = this function is not `const`, so it cannot have `~const` trait bounds
207+
208+
ast_passes_optional_const_exclusive = `~const` and `?` are mutually exclusive
209+
210+
ast_passes_const_and_async = functions cannot be both `const` and `async`
211+
.const = `const` because of this
212+
.async = `async` because of this
213+
.label = {""}
214+
215+
ast_passes_pattern_in_foreign = patterns aren't allowed in foreign function declarations
216+
.label = pattern not allowed in foreign function
217+
218+
ast_passes_pattern_in_bodiless = patterns aren't allowed in functions without bodies
219+
.label = pattern not allowed in function without body
220+
221+
ast_passes_equality_in_where = equality constraints are not yet supported in `where` clauses
222+
.label = not supported
223+
.suggestion = if `{$ident}` is an associated type you're trying to set, use the associated type binding syntax
224+
.suggestion_path = if `{$trait_segment}::{$potential_assoc}` is an associated type you're trying to set, use the associated type binding syntax
225+
.note = see issue #20041 <https://github.com/rust-lang/rust/issues/20041> for more information
226+
227+
ast_passes_stability_outside_std = stability attributes may not be used outside of the standard library
228+
229+
ast_passes_feature_on_non_nightly = `#![feature]` may not be used on the {$channel} release channel
230+
.suggestion = remove the attribute
231+
.stable_since = the feature `{$name}` has been stable since `{$since}` and no longer requires an attribute to enable
232+
233+
ast_passes_incompatbile_features = `{$f1}` and `{$f2}` are incompatible, using them at the same time is not allowed
234+
.help = remove one of these features
235+
236+
ast_passes_show_span = {$msg}

0 commit comments

Comments
 (0)