Skip to content

Commit cec9f7f

Browse files
committed
Migrate more diagnostics
1 parent 4226dc2 commit cec9f7f

File tree

5 files changed

+537
-174
lines changed

5 files changed

+537
-174
lines changed

compiler/rustc_resolve/messages.ftl

+106
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ resolve_attempt_to_use_non_constant_value_in_constant_with_suggestion =
3838
resolve_attempt_to_use_non_constant_value_in_constant_without_suggestion =
3939
this would need to be a `{$suggestion}`
4040
41+
resolve_attributes_starting_with_rustc_are_reserved =
42+
attributes starting with `rustc` are reserved for use by the `rustc` compiler
43+
4144
resolve_bad_macro_import = bad macro import
4245
4346
resolve_binding_in_never_pattern =
@@ -70,12 +73,19 @@ resolve_cannot_determine_macro_resolution =
7073
cannot determine resolution for the {$kind} `{$path}`
7174
.note = import resolution is stuck, try simplifying macro imports
7275
76+
resolve_cannot_find_builtin_macro_with_name =
77+
cannot find a built-in macro with name `{$ident}`
78+
7379
resolve_cannot_find_ident_in_this_scope =
7480
cannot find {$expected} `{$ident}` in this scope
7581
7682
resolve_cannot_glob_import_possible_crates =
7783
cannot glob-import all possible crates
7884
85+
resolve_cannot_use_through_an_import =
86+
cannot use {$article} {$descr} through an import
87+
.note = the {$descr} imported here
88+
7989
resolve_change_import_binding =
8090
you can use `as` to change the binding name of the import
8191
@@ -88,6 +98,12 @@ resolve_consider_adding_macro_export =
8898
resolve_consider_declaring_with_pub =
8999
consider declaring type or module `{$ident}` with `pub`
90100
101+
resolve_consider_making_the_field_public =
102+
{ $number_of_fields ->
103+
[one] consider making the field publicly accessible
104+
*[other] consider making the fields publicly accessible
105+
}
106+
91107
resolve_consider_marking_as_pub =
92108
consider marking `{$ident}` as `pub` in the imported module
93109
@@ -108,6 +124,9 @@ resolve_const_param_in_non_trivial_anon_const =
108124
resolve_const_param_in_ty_of_const_param =
109125
const parameters may not be used in the type of const parameters
110126
127+
resolve_constructor_private_if_any_field_private =
128+
a constructor is private if any of the fields is private
129+
111130
resolve_elided_anonymous_lifetime_report_error =
112131
`&` without an explicit lifetime name cannot be used here
113132
.label = explicit lifetime name needed here
@@ -133,10 +152,20 @@ resolve_extern_crate_self_requires_renaming =
133152
`extern crate self;` requires renaming
134153
.suggestion = rename the `self` crate to be able to import it
135154
155+
resolve_failed_resolve_unresolve_import = failed to resolve: unresolved import
156+
157+
resolve_failed_resolve_unresolve_import_label = unresolved import
158+
136159
resolve_forward_declared_generic_param =
137160
generic parameters with a default cannot use forward declared identifiers
138161
.label = defaulted generic parameters cannot be forward declared
139162
163+
resolve_found_an_item_configured_out =
164+
found an item that was configured out
165+
166+
resolve_generic_arguments_in_macro_path =
167+
generic arguments in macro path
168+
140169
resolve_generic_params_from_outer_item =
141170
can't use {$is_self ->
142171
[true] `Self`
@@ -171,6 +200,12 @@ resolve_ident_bound_more_than_once_in_same_pattern =
171200
identifier `{$identifier}` is bound more than once in the same pattern
172201
.label = used in a pattern more than once
173202
203+
resolve_ident_imported_here_but_it_is_desc =
204+
`{$imported_ident}` is imported here, but it is {$imported_ident_desc}
205+
206+
resolve_ident_in_scope_but_it_is_desc =
207+
`{$imported_ident}` is in scope, but it is {$imported_ident_desc}
208+
174209
resolve_imported_crate = `$crate` may not be imported
175210
176211
resolve_imported_macro_not_found = imported macro not found
@@ -190,6 +225,13 @@ resolve_is_not_directly_importable =
190225
`{$target}` is not directly importable
191226
.label = cannot be imported directly
192227
228+
resolve_is_private =
229+
{$ident_descr} `{$ident}` is private
230+
.label = private {$ident_descr}
231+
232+
resolve_item_was_behind_feature =
233+
the item is gated behind the `{$feature}` feature
234+
193235
resolve_items_in_traits_are_not_importable =
194236
items in traits are not importable
195237
@@ -217,6 +259,7 @@ resolve_macro_expanded_extern_crate_cannot_shadow_extern_arguments =
217259
218260
resolve_macro_expected_found =
219261
expected {$expected}, found {$found} `{$macro_path}`
262+
.label = not {$article} {$expected}
220263
221264
resolve_macro_extern_deprecated =
222265
`#[macro_escape]` is a deprecated synonym for `#[macro_use]`
@@ -237,11 +280,45 @@ resolve_missing_macro_rules_name = maybe you have forgotten to define a name for
237280
resolve_module_only =
238281
visibility must resolve to a module
239282
283+
resolve_name_defined_multiple_time =
284+
the name `{$name}` is defined multiple times
285+
.note = `{$name}` must be defined only once in the {$descr} namespace of this {$container}
286+
287+
resolve_name_defined_multiple_time_old_binding_definition =
288+
previous definition of the {$old_kind} `{$name}` here
289+
290+
resolve_name_defined_multiple_time_old_binding_import =
291+
previous import of the {$old_kind} `{$name}` here
292+
293+
resolve_name_defined_multiple_time_redefined =
294+
`{$name}` redefined here
295+
296+
resolve_name_defined_multiple_time_reimported =
297+
`{$name}` reimported here
298+
240299
resolve_name_is_already_used_as_generic_parameter =
241300
the name `{$name}` is already used for a generic parameter in this item's generic parameters
242301
.label = already used
243302
.first_use_of_name = first use of `{$name}`
244303
304+
resolve_name_reserved_in_attribute_namespace =
305+
name `{$ident}` is reserved in attribute namespace
306+
307+
resolve_note_and_refers_to_the_item_defined_here =
308+
{$first ->
309+
[true] {$dots ->
310+
[true] the {$binding_descr} `{$binding_name}` is defined here...
311+
*[false] the {$binding_descr} `{$binding_name}` is defined here
312+
}
313+
*[false] {$dots ->
314+
[true] ...and refers to the {$binding_descr} `{$binding_name}` which is defined here...
315+
*[false] ...and refers to the {$binding_descr} `{$binding_name}` which is defined here
316+
}
317+
}
318+
319+
resolve_outer_ident_is_not_publicly_reexported =
320+
{$outer_ident_descr} `{$outer_ident}` is not publicly re-exported
321+
245322
resolve_param_in_enum_discriminant =
246323
generic parameters may not be used in enum discriminant values
247324
.label = cannot perform const operation using `{$name}`
@@ -275,6 +352,8 @@ resolve_relative_2018 =
275352
resolve_remove_surrounding_derive =
276353
remove from the surrounding `derive()`
277354
355+
resolve_remove_unnecessary_import = remove unnecessary import
356+
278357
resolve_self_import_can_only_appear_once_in_the_list =
279358
`self` import can only appear once in an import list
280359
.label = can only appear once in an import list
@@ -296,13 +375,33 @@ resolve_self_in_generic_param_default =
296375
generic parameters cannot use `Self` in their defaults
297376
.label = `Self` in generic parameter default
298377
378+
resolve_similarly_named_defined_here =
379+
similarly named {$candidate_descr} `{$candidate}` defined here
380+
381+
resolve_single_item_defined_here =
382+
{$candidate_descr} `{$candidate}` defined here
383+
299384
resolve_static_lifetime_is_reserved = invalid lifetime parameter name: `{$lifetime}`
300385
.label = 'static is a reserved lifetime name
301386
387+
resolve_suggestion_import_ident_directly =
388+
import `{$ident}` directly
389+
390+
resolve_suggestion_import_ident_through_reexport =
391+
import `{$ident}` through the re-export
392+
302393
resolve_tool_module_imported =
303394
cannot use a tool module through an import
304395
.note = the tool module imported here
305396
397+
resolve_tool_only_accepts_identifiers =
398+
`{$tool}` only accepts identifiers
399+
.label = not an identifier
400+
401+
resolve_tool_was_already_registered =
402+
tool `{$tool}` was already registered
403+
.label = already registered here
404+
306405
resolve_trait_impl_duplicate =
307406
duplicate definitions with name `{$name}`:
308407
.label = duplicate definition
@@ -368,3 +467,10 @@ resolve_variable_is_not_bound_in_all_patterns =
368467
variable `{$name}` is not bound in all patterns
369468
370469
resolve_variable_not_in_all_patterns = variable not in all patterns
470+
471+
resolve_you_could_import_this_desc = you could import this {$desc}
472+
473+
resolve_trait_impl_mismatch =
474+
item `{$name}` is an associated {$kind}, which doesn't match its trait `{$trait_path}`
475+
.label = does not match trait
476+
.trait_impl_mismatch_label_item = item in trait

0 commit comments

Comments
 (0)