Skip to content

Commit fd44ccf

Browse files
authored
Unrolled build for rust-lang#123896
Rollup merge of rust-lang#123896 - JeanCASPAR:rustc_resolve-to-session-diagnostic, r=jieyouxu Migrate some diagnostics in `rustc_resolve` to session diagnostic Hello, I migrated some diagnostics in `rustc_resolve` to session diagnostic. r? ``@davidtwco``
2 parents 0230848 + 992c505 commit fd44ccf

File tree

6 files changed

+795
-278
lines changed

6 files changed

+795
-278
lines changed

compiler/rustc_resolve/messages.ftl

+157-2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ resolve_added_macro_use =
1111
resolve_ancestor_only =
1212
visibilities can only be restricted to ancestor modules
1313
14+
resolve_arguments_macro_use_not_allowed = arguments to `macro_use` are not allowed here
15+
1416
resolve_associated_const_with_similar_name_exists =
1517
there is an associated constant with a similar name
1618
@@ -20,6 +22,10 @@ resolve_associated_fn_with_similar_name_exists =
2022
resolve_associated_type_with_similar_name_exists =
2123
there is an associated type with a similar name
2224
25+
resolve_attempt_to_define_builtin_macro_twice =
26+
attempted to define built-in macro more than once
27+
.note = previously defined here
28+
2329
resolve_attempt_to_use_non_constant_value_in_constant =
2430
attempt to use a non-constant value in a constant
2531
@@ -32,6 +38,11 @@ resolve_attempt_to_use_non_constant_value_in_constant_with_suggestion =
3238
resolve_attempt_to_use_non_constant_value_in_constant_without_suggestion =
3339
this would need to be a `{$suggestion}`
3440
41+
resolve_attributes_starting_with_rustc_are_reserved =
42+
attributes starting with `rustc` are reserved for use by the `rustc` compiler
43+
44+
resolve_bad_macro_import = bad macro import
45+
3546
resolve_binding_in_never_pattern =
3647
never patterns cannot contain variable bindings
3748
.suggestion = use a wildcard `_` instead
@@ -62,12 +73,19 @@ resolve_cannot_determine_macro_resolution =
6273
cannot determine resolution for the {$kind} `{$path}`
6374
.note = import resolution is stuck, try simplifying macro imports
6475
76+
resolve_cannot_find_builtin_macro_with_name =
77+
cannot find a built-in macro with name `{$ident}`
78+
6579
resolve_cannot_find_ident_in_this_scope =
6680
cannot find {$expected} `{$ident}` in this scope
6781
6882
resolve_cannot_glob_import_possible_crates =
6983
cannot glob-import all possible crates
7084
85+
resolve_cannot_use_through_an_import =
86+
cannot use {$article} {$descr} through an import
87+
.note = the {$descr} imported here
88+
7189
resolve_change_import_binding =
7290
you can use `as` to change the binding name of the import
7391
@@ -80,6 +98,12 @@ resolve_consider_adding_macro_export =
8098
resolve_consider_declaring_with_pub =
8199
consider declaring type or module `{$ident}` with `pub`
82100
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+
83107
resolve_consider_marking_as_pub =
84108
consider marking `{$ident}` as `pub` in the imported module
85109
@@ -100,17 +124,44 @@ resolve_const_param_in_non_trivial_anon_const =
100124
resolve_const_param_in_ty_of_const_param =
101125
const parameters may not be used in the type of const parameters
102126
103-
resolve_expected_found =
127+
resolve_constructor_private_if_any_field_private =
128+
a constructor is private if any of the fields is private
129+
130+
resolve_elided_anonymous_lifetime_report_error =
131+
`&` without an explicit lifetime name cannot be used here
132+
.label = explicit lifetime name needed here
133+
134+
resolve_elided_anonymous_lifetime_report_error_suggestion =
135+
consider introducing a higher-ranked lifetime here
136+
137+
resolve_expected_module_found =
104138
expected module, found {$res} `{$path_str}`
105139
.label = not a module
106140
141+
resolve_explicit_anonymous_lifetime_report_error =
142+
`'_` cannot be used here
143+
.label = `'_` is a reserved lifetime name
144+
107145
resolve_explicit_unsafe_traits =
108146
unsafe traits like `{$ident}` should be implemented explicitly
109147
148+
resolve_extern_crate_loading_macro_not_at_crate_root =
149+
an `extern crate` loading macros must be at the crate root
150+
151+
resolve_extern_crate_self_requires_renaming =
152+
`extern crate self;` requires renaming
153+
.suggestion = rename the `self` crate to be able to import it
154+
110155
resolve_forward_declared_generic_param =
111156
generic parameters with a default cannot use forward declared identifiers
112157
.label = defaulted generic parameters cannot be forward declared
113158
159+
resolve_found_an_item_configured_out =
160+
found an item that was configured out
161+
162+
resolve_generic_arguments_in_macro_path =
163+
generic arguments in macro path
164+
114165
resolve_generic_params_from_outer_item =
115166
can't use {$is_self ->
116167
[true] `Self`
@@ -135,7 +186,6 @@ resolve_generic_params_from_outer_item_static = a `static` is a separate item fr
135186
136187
resolve_generic_params_from_outer_item_ty_param = type parameter from outer item
137188
138-
139189
resolve_ident_bound_more_than_once_in_parameter_list =
140190
identifier `{$identifier}` is bound more than once in this parameter list
141191
.label = used as parameter more than once
@@ -144,8 +194,18 @@ resolve_ident_bound_more_than_once_in_same_pattern =
144194
identifier `{$identifier}` is bound more than once in the same pattern
145195
.label = used in a pattern more than once
146196
197+
resolve_ident_imported_here_but_it_is_desc =
198+
`{$imported_ident}` is imported here, but it is {$imported_ident_desc}
199+
200+
resolve_ident_in_scope_but_it_is_desc =
201+
`{$imported_ident}` is in scope, but it is {$imported_ident_desc}
202+
203+
resolve_implicit_elided_lifetimes_not_allowed_here = implicit elided lifetime not allowed here
204+
147205
resolve_imported_crate = `$crate` may not be imported
148206
207+
resolve_imported_macro_not_found = imported macro not found
208+
149209
resolve_imports_cannot_refer_to =
150210
imports cannot refer to {$what}
151211
@@ -161,6 +221,13 @@ resolve_is_not_directly_importable =
161221
`{$target}` is not directly importable
162222
.label = cannot be imported directly
163223
224+
resolve_is_private =
225+
{$ident_descr} `{$ident}` is private
226+
.label = private {$ident_descr}
227+
228+
resolve_item_was_behind_feature =
229+
the item is gated behind the `{$feature}` feature
230+
164231
resolve_items_in_traits_are_not_importable =
165232
items in traits are not importable
166233
@@ -183,11 +250,23 @@ resolve_lowercase_self =
183250
resolve_macro_defined_later =
184251
a macro with the same name exists, but it appears later at here
185252
253+
resolve_macro_expanded_extern_crate_cannot_shadow_extern_arguments =
254+
macro-expanded `extern crate` items cannot shadow names passed with `--extern`
255+
186256
resolve_macro_expected_found =
187257
expected {$expected}, found {$found} `{$macro_path}`
258+
.label = not {$article} {$expected}
259+
260+
resolve_macro_extern_deprecated =
261+
`#[macro_escape]` is a deprecated synonym for `#[macro_use]`
262+
.help = try an outer attribute: `#[macro_use]`
188263
189264
resolve_macro_use_extern_crate_self = `#[macro_use]` is not supported on `extern crate self`
190265
266+
resolve_macro_use_name_already_in_use =
267+
`{$name}` is already in scope
268+
.note = macro-expanded `#[macro_use]`s may not shadow existing macros (see RFC 1560)
269+
191270
resolve_method_not_member_of_trait =
192271
method `{$method}` is not a member of trait `{$trait_}`
193272
.label = not a member of trait `{$trait_}`
@@ -197,11 +276,45 @@ resolve_missing_macro_rules_name = maybe you have forgotten to define a name for
197276
resolve_module_only =
198277
visibility must resolve to a module
199278
279+
resolve_name_defined_multiple_time =
280+
the name `{$name}` is defined multiple times
281+
.note = `{$name}` must be defined only once in the {$descr} namespace of this {$container}
282+
283+
resolve_name_defined_multiple_time_old_binding_definition =
284+
previous definition of the {$old_kind} `{$name}` here
285+
286+
resolve_name_defined_multiple_time_old_binding_import =
287+
previous import of the {$old_kind} `{$name}` here
288+
289+
resolve_name_defined_multiple_time_redefined =
290+
`{$name}` redefined here
291+
292+
resolve_name_defined_multiple_time_reimported =
293+
`{$name}` reimported here
294+
200295
resolve_name_is_already_used_as_generic_parameter =
201296
the name `{$name}` is already used for a generic parameter in this item's generic parameters
202297
.label = already used
203298
.first_use_of_name = first use of `{$name}`
204299
300+
resolve_name_reserved_in_attribute_namespace =
301+
name `{$ident}` is reserved in attribute namespace
302+
303+
resolve_note_and_refers_to_the_item_defined_here =
304+
{$first ->
305+
[true] {$dots ->
306+
[true] the {$binding_descr} `{$binding_name}` is defined here...
307+
*[false] the {$binding_descr} `{$binding_name}` is defined here
308+
}
309+
*[false] {$dots ->
310+
[true] ...and refers to the {$binding_descr} `{$binding_name}` which is defined here...
311+
*[false] ...and refers to the {$binding_descr} `{$binding_name}` which is defined here
312+
}
313+
}
314+
315+
resolve_outer_ident_is_not_publicly_reexported =
316+
{$outer_ident_descr} `{$outer_ident}` is not publicly re-exported
317+
205318
resolve_param_in_enum_discriminant =
206319
generic parameters may not be used in enum discriminant values
207320
.label = cannot perform const operation using `{$name}`
@@ -217,6 +330,8 @@ resolve_param_in_ty_of_const_param =
217330
the type of const parameters must not depend on other generic parameters
218331
.label = the type must not depend on the parameter `{$name}`
219332
333+
resolve_pattern_doesnt_bind_name = pattern doesn't bind `{$name}`
334+
220335
resolve_proc_macro_same_crate = can't use a procedural macro from the same crate that defines it
221336
.help = you can define integration tests in a directory named `tests`
222337
@@ -233,6 +348,8 @@ resolve_relative_2018 =
233348
resolve_remove_surrounding_derive =
234349
remove from the surrounding `derive()`
235350
351+
resolve_remove_unnecessary_import = remove unnecessary import
352+
236353
resolve_self_import_can_only_appear_once_in_the_list =
237354
`self` import can only appear once in an import list
238355
.label = can only appear once in an import list
@@ -254,16 +371,43 @@ resolve_self_in_generic_param_default =
254371
generic parameters cannot use `Self` in their defaults
255372
.label = `Self` in generic parameter default
256373
374+
resolve_similarly_named_defined_here =
375+
similarly named {$candidate_descr} `{$candidate}` defined here
376+
377+
resolve_single_item_defined_here =
378+
{$candidate_descr} `{$candidate}` defined here
379+
380+
resolve_static_lifetime_is_reserved = invalid lifetime parameter name: `{$lifetime}`
381+
.label = 'static is a reserved lifetime name
382+
383+
resolve_suggestion_import_ident_directly =
384+
import `{$ident}` directly
385+
386+
resolve_suggestion_import_ident_through_reexport =
387+
import `{$ident}` through the re-export
388+
257389
resolve_tool_module_imported =
258390
cannot use a tool module through an import
259391
.note = the tool module imported here
260392
393+
resolve_tool_only_accepts_identifiers =
394+
`{$tool}` only accepts identifiers
395+
.label = not an identifier
396+
397+
resolve_tool_was_already_registered =
398+
tool `{$tool}` was already registered
399+
.label = already registered here
400+
261401
resolve_trait_impl_duplicate =
262402
duplicate definitions with name `{$name}`:
263403
.label = duplicate definition
264404
.old_span_label = previous definition here
265405
.trait_item_span = item in trait
266406
407+
resolve_trait_impl_mismatch =
408+
item `{$name}` is an associated {$kind}, which doesn't match its trait `{$trait_path}`
409+
.label = does not match trait
410+
.trait_impl_mismatch_label_item = item in trait
267411
resolve_try_using_similarly_named_label =
268412
try using similarly named label
269413
@@ -284,12 +428,18 @@ resolve_undeclared_label =
284428
use of undeclared label `{$name}`
285429
.label = undeclared label `{$name}`
286430
431+
resolve_underscore_lifetime_is_reserved = `'_` cannot be used here
432+
.label = `'_` is a reserved lifetime name
433+
287434
resolve_unexpected_res_change_ty_to_const_param_sugg =
288435
you might have meant to write a const parameter here
289436
290437
resolve_unexpected_res_use_at_op_in_slice_pat_with_range_sugg =
291438
if you meant to collect the rest of the slice in `{$ident}`, use the at operator
292439
440+
resolve_unnamed_crate_root_import =
441+
crate root imports need to be explicitly named: `use crate as name;`
442+
293443
resolve_unreachable_label =
294444
use of unreachable label `{$name}`
295445
.label = unreachable label `{$name}`
@@ -312,3 +462,8 @@ resolve_variable_bound_with_different_mode =
312462
variable `{$variable_name}` is bound inconsistently across alternatives separated by `|`
313463
.label = bound in different ways
314464
.first_binding_span = first binding
465+
466+
resolve_variable_is_not_bound_in_all_patterns =
467+
variable `{$name}` is not bound in all patterns
468+
469+
resolve_variable_not_in_all_patterns = variable not in all patterns

0 commit comments

Comments
 (0)