From 7e2ecb3cd84eae18e838624feeb2e5cf46b9cc57 Mon Sep 17 00:00:00 2001 From: est31 Date: Fri, 3 Mar 2023 00:18:38 +0100 Subject: Simplify message paths This makes it easier to open the messages file while developing on features. The commit was the result of automatted changes: for p in compiler/rustc_*; do mv $p/locales/en-US.ftl $p/messages.ftl; rmdir $p/locales; done for p in compiler/rustc_*; do sed -i "s#\.\./locales/en-US.ftl#../messages.ftl#" $p/src/lib.rs; done --- compiler/rustc_ast_lowering/locales/en-US.ftl | 141 ----- compiler/rustc_ast_lowering/messages.ftl | 141 +++++ compiler/rustc_ast_lowering/src/lib.rs | 2 +- compiler/rustc_ast_passes/locales/en-US.ftl | 236 ------- compiler/rustc_ast_passes/messages.ftl | 236 +++++++ compiler/rustc_ast_passes/src/lib.rs | 2 +- compiler/rustc_attr/locales/en-US.ftl | 107 ---- compiler/rustc_attr/messages.ftl | 107 ++++ compiler/rustc_attr/src/lib.rs | 2 +- compiler/rustc_borrowck/locales/en-US.ftl | 129 ---- compiler/rustc_borrowck/messages.ftl | 129 ++++ compiler/rustc_borrowck/src/lib.rs | 2 +- compiler/rustc_builtin_macros/locales/en-US.ftl | 5 - compiler/rustc_builtin_macros/messages.ftl | 5 + compiler/rustc_builtin_macros/src/lib.rs | 2 +- compiler/rustc_codegen_gcc/locales/en-US.ftl | 68 --- compiler/rustc_codegen_gcc/messages.ftl | 68 +++ compiler/rustc_codegen_gcc/src/lib.rs | 2 +- compiler/rustc_codegen_llvm/locales/en-US.ftl | 89 --- compiler/rustc_codegen_llvm/messages.ftl | 89 +++ compiler/rustc_codegen_llvm/src/lib.rs | 2 +- compiler/rustc_codegen_ssa/locales/en-US.ftl | 293 --------- compiler/rustc_codegen_ssa/messages.ftl | 293 +++++++++ compiler/rustc_codegen_ssa/src/lib.rs | 2 +- compiler/rustc_const_eval/locales/en-US.ftl | 83 --- compiler/rustc_const_eval/messages.ftl | 83 +++ compiler/rustc_const_eval/src/lib.rs | 2 +- compiler/rustc_driver_impl/locales/en-US.ftl | 19 - compiler/rustc_driver_impl/messages.ftl | 19 + compiler/rustc_driver_impl/src/lib.rs | 2 +- compiler/rustc_error_messages/locales/en-US.ftl | 1 - compiler/rustc_error_messages/messages.ftl | 1 + compiler/rustc_error_messages/src/lib.rs | 2 +- compiler/rustc_errors/locales/en-US.ftl | 19 - compiler/rustc_errors/messages.ftl | 19 + compiler/rustc_errors/src/lib.rs | 2 +- compiler/rustc_expand/locales/en-US.ftl | 138 ----- compiler/rustc_expand/messages.ftl | 138 +++++ compiler/rustc_expand/src/lib.rs | 2 +- compiler/rustc_hir_analysis/locales/en-US.ftl | 175 ------ compiler/rustc_hir_analysis/messages.ftl | 175 ++++++ compiler/rustc_hir_analysis/src/lib.rs | 2 +- compiler/rustc_hir_typeck/locales/en-US.ftl | 79 --- compiler/rustc_hir_typeck/messages.ftl | 79 +++ compiler/rustc_hir_typeck/src/lib.rs | 2 +- compiler/rustc_incremental/locales/en-US.ftl | 118 ---- compiler/rustc_incremental/messages.ftl | 118 ++++ compiler/rustc_incremental/src/lib.rs | 2 +- compiler/rustc_infer/locales/en-US.ftl | 350 ----------- compiler/rustc_infer/messages.ftl | 350 +++++++++++ compiler/rustc_infer/src/lib.rs | 2 +- compiler/rustc_interface/locales/en-US.ftl | 52 -- compiler/rustc_interface/messages.ftl | 52 ++ compiler/rustc_interface/src/lib.rs | 2 +- compiler/rustc_lint/locales/en-US.ftl | 510 ---------------- compiler/rustc_lint/messages.ftl | 510 ++++++++++++++++ compiler/rustc_lint/src/lib.rs | 2 +- compiler/rustc_metadata/locales/en-US.ftl | 288 --------- compiler/rustc_metadata/messages.ftl | 288 +++++++++ compiler/rustc_metadata/src/lib.rs | 2 +- compiler/rustc_middle/locales/en-US.ftl | 36 -- compiler/rustc_middle/messages.ftl | 36 ++ compiler/rustc_middle/src/lib.rs | 2 +- compiler/rustc_mir_build/locales/en-US.ftl | 382 ------------ compiler/rustc_mir_build/messages.ftl | 382 ++++++++++++ compiler/rustc_mir_build/src/lib.rs | 2 +- compiler/rustc_mir_dataflow/locales/en-US.ftl | 29 - compiler/rustc_mir_dataflow/messages.ftl | 29 + compiler/rustc_mir_dataflow/src/lib.rs | 2 +- compiler/rustc_monomorphize/locales/en-US.ftl | 32 - compiler/rustc_monomorphize/messages.ftl | 32 + compiler/rustc_monomorphize/src/lib.rs | 2 +- compiler/rustc_parse/locales/en-US.ftl | 733 ---------------------- compiler/rustc_parse/messages.ftl | 733 ++++++++++++++++++++++ compiler/rustc_parse/src/lib.rs | 2 +- compiler/rustc_passes/locales/en-US.ftl | 748 ----------------------- compiler/rustc_passes/messages.ftl | 748 +++++++++++++++++++++++ compiler/rustc_passes/src/lib.rs | 2 +- compiler/rustc_plugin_impl/locales/en-US.ftl | 4 - compiler/rustc_plugin_impl/messages.ftl | 4 + compiler/rustc_plugin_impl/src/lib.rs | 2 +- compiler/rustc_privacy/locales/en-US.ftl | 23 - compiler/rustc_privacy/messages.ftl | 23 + compiler/rustc_privacy/src/lib.rs | 2 +- compiler/rustc_query_system/locales/en-US.ftl | 30 - compiler/rustc_query_system/messages.ftl | 30 + compiler/rustc_query_system/src/lib.rs | 2 +- compiler/rustc_resolve/locales/en-US.ftl | 211 ------- compiler/rustc_resolve/messages.ftl | 211 +++++++ compiler/rustc_resolve/src/lib.rs | 2 +- compiler/rustc_session/locales/en-US.ftl | 95 --- compiler/rustc_session/messages.ftl | 95 +++ compiler/rustc_session/src/lib.rs | 2 +- compiler/rustc_symbol_mangling/locales/en-US.ftl | 1 - compiler/rustc_symbol_mangling/messages.ftl | 1 + compiler/rustc_symbol_mangling/src/lib.rs | 2 +- compiler/rustc_trait_selection/locales/en-US.ftl | 22 - compiler/rustc_trait_selection/messages.ftl | 22 + compiler/rustc_trait_selection/src/lib.rs | 2 +- compiler/rustc_ty_utils/locales/en-US.ftl | 47 -- compiler/rustc_ty_utils/messages.ftl | 47 ++ compiler/rustc_ty_utils/src/lib.rs | 2 +- 102 files changed, 5327 insertions(+), 5327 deletions(-) delete mode 100644 compiler/rustc_ast_lowering/locales/en-US.ftl create mode 100644 compiler/rustc_ast_lowering/messages.ftl delete mode 100644 compiler/rustc_ast_passes/locales/en-US.ftl create mode 100644 compiler/rustc_ast_passes/messages.ftl delete mode 100644 compiler/rustc_attr/locales/en-US.ftl create mode 100644 compiler/rustc_attr/messages.ftl delete mode 100644 compiler/rustc_borrowck/locales/en-US.ftl create mode 100644 compiler/rustc_borrowck/messages.ftl delete mode 100644 compiler/rustc_builtin_macros/locales/en-US.ftl create mode 100644 compiler/rustc_builtin_macros/messages.ftl delete mode 100644 compiler/rustc_codegen_gcc/locales/en-US.ftl create mode 100644 compiler/rustc_codegen_gcc/messages.ftl delete mode 100644 compiler/rustc_codegen_llvm/locales/en-US.ftl create mode 100644 compiler/rustc_codegen_llvm/messages.ftl delete mode 100644 compiler/rustc_codegen_ssa/locales/en-US.ftl create mode 100644 compiler/rustc_codegen_ssa/messages.ftl delete mode 100644 compiler/rustc_const_eval/locales/en-US.ftl create mode 100644 compiler/rustc_const_eval/messages.ftl delete mode 100644 compiler/rustc_driver_impl/locales/en-US.ftl create mode 100644 compiler/rustc_driver_impl/messages.ftl delete mode 100644 compiler/rustc_error_messages/locales/en-US.ftl create mode 100644 compiler/rustc_error_messages/messages.ftl delete mode 100644 compiler/rustc_errors/locales/en-US.ftl create mode 100644 compiler/rustc_errors/messages.ftl delete mode 100644 compiler/rustc_expand/locales/en-US.ftl create mode 100644 compiler/rustc_expand/messages.ftl delete mode 100644 compiler/rustc_hir_analysis/locales/en-US.ftl create mode 100644 compiler/rustc_hir_analysis/messages.ftl delete mode 100644 compiler/rustc_hir_typeck/locales/en-US.ftl create mode 100644 compiler/rustc_hir_typeck/messages.ftl delete mode 100644 compiler/rustc_incremental/locales/en-US.ftl create mode 100644 compiler/rustc_incremental/messages.ftl delete mode 100644 compiler/rustc_infer/locales/en-US.ftl create mode 100644 compiler/rustc_infer/messages.ftl delete mode 100644 compiler/rustc_interface/locales/en-US.ftl create mode 100644 compiler/rustc_interface/messages.ftl delete mode 100644 compiler/rustc_lint/locales/en-US.ftl create mode 100644 compiler/rustc_lint/messages.ftl delete mode 100644 compiler/rustc_metadata/locales/en-US.ftl create mode 100644 compiler/rustc_metadata/messages.ftl delete mode 100644 compiler/rustc_middle/locales/en-US.ftl create mode 100644 compiler/rustc_middle/messages.ftl delete mode 100644 compiler/rustc_mir_build/locales/en-US.ftl create mode 100644 compiler/rustc_mir_build/messages.ftl delete mode 100644 compiler/rustc_mir_dataflow/locales/en-US.ftl create mode 100644 compiler/rustc_mir_dataflow/messages.ftl delete mode 100644 compiler/rustc_monomorphize/locales/en-US.ftl create mode 100644 compiler/rustc_monomorphize/messages.ftl delete mode 100644 compiler/rustc_parse/locales/en-US.ftl create mode 100644 compiler/rustc_parse/messages.ftl delete mode 100644 compiler/rustc_passes/locales/en-US.ftl create mode 100644 compiler/rustc_passes/messages.ftl delete mode 100644 compiler/rustc_plugin_impl/locales/en-US.ftl create mode 100644 compiler/rustc_plugin_impl/messages.ftl delete mode 100644 compiler/rustc_privacy/locales/en-US.ftl create mode 100644 compiler/rustc_privacy/messages.ftl delete mode 100644 compiler/rustc_query_system/locales/en-US.ftl create mode 100644 compiler/rustc_query_system/messages.ftl delete mode 100644 compiler/rustc_resolve/locales/en-US.ftl create mode 100644 compiler/rustc_resolve/messages.ftl delete mode 100644 compiler/rustc_session/locales/en-US.ftl create mode 100644 compiler/rustc_session/messages.ftl delete mode 100644 compiler/rustc_symbol_mangling/locales/en-US.ftl create mode 100644 compiler/rustc_symbol_mangling/messages.ftl delete mode 100644 compiler/rustc_trait_selection/locales/en-US.ftl create mode 100644 compiler/rustc_trait_selection/messages.ftl delete mode 100644 compiler/rustc_ty_utils/locales/en-US.ftl create mode 100644 compiler/rustc_ty_utils/messages.ftl diff --git a/compiler/rustc_ast_lowering/locales/en-US.ftl b/compiler/rustc_ast_lowering/locales/en-US.ftl deleted file mode 100644 index 3ccd84398ec..00000000000 --- a/compiler/rustc_ast_lowering/locales/en-US.ftl +++ /dev/null @@ -1,141 +0,0 @@ -ast_lowering_generic_type_with_parentheses = - parenthesized type parameters may only be used with a `Fn` trait - .label = only `Fn` traits may use parentheses - -ast_lowering_use_angle_brackets = use angle brackets instead - -ast_lowering_invalid_abi = - invalid ABI: found `{$abi}` - .label = invalid ABI - .note = invoke `{$command}` for a full list of supported calling conventions. - -ast_lowering_invalid_abi_suggestion = did you mean - -ast_lowering_assoc_ty_parentheses = - parenthesized generic arguments cannot be used in associated type constraints - -ast_lowering_remove_parentheses = remove these parentheses - -ast_lowering_misplaced_impl_trait = - `impl Trait` only allowed in function and inherent method return types, not in {$position} - -ast_lowering_misplaced_assoc_ty_binding = - associated type bounds are only allowed in where clauses and function signatures, not in {$position} - -ast_lowering_underscore_expr_lhs_assign = - in expressions, `_` can only be used on the left-hand side of an assignment - .label = `_` not allowed here - -ast_lowering_base_expression_double_dot = - base expression required after `..` - .label = add a base expression here - -ast_lowering_await_only_in_async_fn_and_blocks = - `await` is only allowed inside `async` functions and blocks - .label = only allowed inside `async` functions and blocks - -ast_lowering_this_not_async = this is not `async` - -ast_lowering_generator_too_many_parameters = - too many parameters for a generator (expected 0 or 1 parameters) - -ast_lowering_closure_cannot_be_static = closures cannot be static - -ast_lowering_async_non_move_closure_not_supported = - `async` non-`move` closures with parameters are not currently supported - .help = consider using `let` statements to manually capture variables by reference before entering an `async move` closure - -ast_lowering_functional_record_update_destructuring_assignment = - functional record updates are not allowed in destructuring assignments - .suggestion = consider removing the trailing pattern - -ast_lowering_async_generators_not_supported = - `async` generators are not yet supported - -ast_lowering_inline_asm_unsupported_target = - inline assembly is unsupported on this target - -ast_lowering_att_syntax_only_x86 = - the `att_syntax` option is only supported on x86 - -ast_lowering_abi_specified_multiple_times = - `{$prev_name}` ABI specified multiple times - .label = previously specified here - .note = these ABIs are equivalent on the current target - -ast_lowering_clobber_abi_not_supported = - `clobber_abi` is not supported on this target - -ast_lowering_invalid_abi_clobber_abi = - invalid ABI for `clobber_abi` - .note = the following ABIs are supported on this target: {$supported_abis} - -ast_lowering_invalid_register = - invalid register `{$reg}`: {$error} - -ast_lowering_invalid_register_class = - invalid register class `{$reg_class}`: {$error} - -ast_lowering_invalid_asm_template_modifier_reg_class = - invalid asm template modifier for this register class - -ast_lowering_argument = argument - -ast_lowering_template_modifier = template modifier - -ast_lowering_support_modifiers = - the `{$class_name}` register class supports the following template modifiers: {$modifiers} - -ast_lowering_does_not_support_modifiers = - the `{$class_name}` register class does not support template modifiers - -ast_lowering_invalid_asm_template_modifier_const = - asm template modifiers are not allowed for `const` arguments - -ast_lowering_invalid_asm_template_modifier_sym = - asm template modifiers are not allowed for `sym` arguments - -ast_lowering_register_class_only_clobber = - register class `{$reg_class_name}` can only be used as a clobber, not as an input or output - -ast_lowering_register_conflict = - register `{$reg1_name}` conflicts with register `{$reg2_name}` - .help = use `lateout` instead of `out` to avoid conflict - -ast_lowering_register1 = register `{$reg1_name}` - -ast_lowering_register2 = register `{$reg2_name}` - -ast_lowering_sub_tuple_binding = - `{$ident_name} @` is not allowed in a {$ctx} - .label = this is only allowed in slice patterns - .help = remove this and bind each tuple field independently - -ast_lowering_sub_tuple_binding_suggestion = if you don't need to use the contents of {$ident}, discard the tuple's remaining fields - -ast_lowering_extra_double_dot = - `..` can only be used once per {$ctx} pattern - .label = can only be used once per {$ctx} pattern - -ast_lowering_previously_used_here = previously used here - -ast_lowering_misplaced_double_dot = - `..` patterns are not allowed here - .note = only allowed in tuple, tuple struct, and slice patterns - -ast_lowering_misplaced_relax_trait_bound = - `?Trait` bounds are only permitted at the point where a type parameter is declared - -ast_lowering_not_supported_for_lifetime_binder_async_closure = - `for<...>` binders on `async` closures are not currently supported - -ast_lowering_arbitrary_expression_in_pattern = - arbitrary expressions aren't allowed in patterns - -ast_lowering_inclusive_range_with_no_end = inclusive range with no end - -ast_lowering_trait_fn_async = - functions in traits cannot be declared `async` - .label = `async` because of this - .note = `async` trait functions are not currently supported - .note2 = consider using the `async-trait` crate: https://crates.io/crates/async-trait diff --git a/compiler/rustc_ast_lowering/messages.ftl b/compiler/rustc_ast_lowering/messages.ftl new file mode 100644 index 00000000000..3ccd84398ec --- /dev/null +++ b/compiler/rustc_ast_lowering/messages.ftl @@ -0,0 +1,141 @@ +ast_lowering_generic_type_with_parentheses = + parenthesized type parameters may only be used with a `Fn` trait + .label = only `Fn` traits may use parentheses + +ast_lowering_use_angle_brackets = use angle brackets instead + +ast_lowering_invalid_abi = + invalid ABI: found `{$abi}` + .label = invalid ABI + .note = invoke `{$command}` for a full list of supported calling conventions. + +ast_lowering_invalid_abi_suggestion = did you mean + +ast_lowering_assoc_ty_parentheses = + parenthesized generic arguments cannot be used in associated type constraints + +ast_lowering_remove_parentheses = remove these parentheses + +ast_lowering_misplaced_impl_trait = + `impl Trait` only allowed in function and inherent method return types, not in {$position} + +ast_lowering_misplaced_assoc_ty_binding = + associated type bounds are only allowed in where clauses and function signatures, not in {$position} + +ast_lowering_underscore_expr_lhs_assign = + in expressions, `_` can only be used on the left-hand side of an assignment + .label = `_` not allowed here + +ast_lowering_base_expression_double_dot = + base expression required after `..` + .label = add a base expression here + +ast_lowering_await_only_in_async_fn_and_blocks = + `await` is only allowed inside `async` functions and blocks + .label = only allowed inside `async` functions and blocks + +ast_lowering_this_not_async = this is not `async` + +ast_lowering_generator_too_many_parameters = + too many parameters for a generator (expected 0 or 1 parameters) + +ast_lowering_closure_cannot_be_static = closures cannot be static + +ast_lowering_async_non_move_closure_not_supported = + `async` non-`move` closures with parameters are not currently supported + .help = consider using `let` statements to manually capture variables by reference before entering an `async move` closure + +ast_lowering_functional_record_update_destructuring_assignment = + functional record updates are not allowed in destructuring assignments + .suggestion = consider removing the trailing pattern + +ast_lowering_async_generators_not_supported = + `async` generators are not yet supported + +ast_lowering_inline_asm_unsupported_target = + inline assembly is unsupported on this target + +ast_lowering_att_syntax_only_x86 = + the `att_syntax` option is only supported on x86 + +ast_lowering_abi_specified_multiple_times = + `{$prev_name}` ABI specified multiple times + .label = previously specified here + .note = these ABIs are equivalent on the current target + +ast_lowering_clobber_abi_not_supported = + `clobber_abi` is not supported on this target + +ast_lowering_invalid_abi_clobber_abi = + invalid ABI for `clobber_abi` + .note = the following ABIs are supported on this target: {$supported_abis} + +ast_lowering_invalid_register = + invalid register `{$reg}`: {$error} + +ast_lowering_invalid_register_class = + invalid register class `{$reg_class}`: {$error} + +ast_lowering_invalid_asm_template_modifier_reg_class = + invalid asm template modifier for this register class + +ast_lowering_argument = argument + +ast_lowering_template_modifier = template modifier + +ast_lowering_support_modifiers = + the `{$class_name}` register class supports the following template modifiers: {$modifiers} + +ast_lowering_does_not_support_modifiers = + the `{$class_name}` register class does not support template modifiers + +ast_lowering_invalid_asm_template_modifier_const = + asm template modifiers are not allowed for `const` arguments + +ast_lowering_invalid_asm_template_modifier_sym = + asm template modifiers are not allowed for `sym` arguments + +ast_lowering_register_class_only_clobber = + register class `{$reg_class_name}` can only be used as a clobber, not as an input or output + +ast_lowering_register_conflict = + register `{$reg1_name}` conflicts with register `{$reg2_name}` + .help = use `lateout` instead of `out` to avoid conflict + +ast_lowering_register1 = register `{$reg1_name}` + +ast_lowering_register2 = register `{$reg2_name}` + +ast_lowering_sub_tuple_binding = + `{$ident_name} @` is not allowed in a {$ctx} + .label = this is only allowed in slice patterns + .help = remove this and bind each tuple field independently + +ast_lowering_sub_tuple_binding_suggestion = if you don't need to use the contents of {$ident}, discard the tuple's remaining fields + +ast_lowering_extra_double_dot = + `..` can only be used once per {$ctx} pattern + .label = can only be used once per {$ctx} pattern + +ast_lowering_previously_used_here = previously used here + +ast_lowering_misplaced_double_dot = + `..` patterns are not allowed here + .note = only allowed in tuple, tuple struct, and slice patterns + +ast_lowering_misplaced_relax_trait_bound = + `?Trait` bounds are only permitted at the point where a type parameter is declared + +ast_lowering_not_supported_for_lifetime_binder_async_closure = + `for<...>` binders on `async` closures are not currently supported + +ast_lowering_arbitrary_expression_in_pattern = + arbitrary expressions aren't allowed in patterns + +ast_lowering_inclusive_range_with_no_end = inclusive range with no end + +ast_lowering_trait_fn_async = + functions in traits cannot be declared `async` + .label = `async` because of this + .note = `async` trait functions are not currently supported + .note2 = consider using the `async-trait` crate: https://crates.io/crates/async-trait diff --git a/compiler/rustc_ast_lowering/src/lib.rs b/compiler/rustc_ast_lowering/src/lib.rs index 0862db1c345..2f0ce467136 100644 --- a/compiler/rustc_ast_lowering/src/lib.rs +++ b/compiler/rustc_ast_lowering/src/lib.rs @@ -92,7 +92,7 @@ mod lifetime_collector; mod pat; mod path; -fluent_messages! { "../locales/en-US.ftl" } +fluent_messages! { "../messages.ftl" } struct LoweringContext<'a, 'hir> { tcx: TyCtxt<'hir>, diff --git a/compiler/rustc_ast_passes/locales/en-US.ftl b/compiler/rustc_ast_passes/locales/en-US.ftl deleted file mode 100644 index 747bd52b22c..00000000000 --- a/compiler/rustc_ast_passes/locales/en-US.ftl +++ /dev/null @@ -1,236 +0,0 @@ -ast_passes_forbidden_let = - `let` expressions are not supported here - .note = only supported directly in conditions of `if` and `while` expressions - .not_supported_or = `||` operators are not supported in let chain expressions - .not_supported_parentheses = `let`s wrapped in parentheses are not supported in a context with let chains - -ast_passes_forbidden_let_stable = - expected expression, found statement (`let`) - .note = variable declaration using `let` is a statement - -ast_passes_deprecated_where_clause_location = - where clause not allowed here - -ast_passes_keyword_lifetime = - lifetimes cannot use keyword names - -ast_passes_invalid_label = - invalid label name `{$name}` - -ast_passes_invalid_visibility = - unnecessary visibility qualifier - .implied = `pub` not permitted here because it's implied - .individual_impl_items = place qualifiers on individual impl items instead - .individual_foreign_items = place qualifiers on individual foreign items instead - -ast_passes_trait_fn_const = - functions in traits cannot be declared const - .label = functions in traits cannot be const - -ast_passes_forbidden_lifetime_bound = - lifetime bounds cannot be used in this context - -ast_passes_forbidden_non_lifetime_param = - only lifetime parameters can be used in this context - -ast_passes_fn_param_too_many = - function can not have more than {$max_num_args} arguments - -ast_passes_fn_param_c_var_args_only = - C-variadic function must be declared with at least one named argument - -ast_passes_fn_param_c_var_args_not_last = - `...` must be the last argument of a C-variadic function - -ast_passes_fn_param_doc_comment = - documentation comments cannot be applied to function parameters - .label = doc comments are not allowed here - -ast_passes_fn_param_forbidden_attr = - allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters - -ast_passes_fn_param_forbidden_self = - `self` parameter is only allowed in associated functions - .label = not semantically valid as function parameter - .note = associated functions are those in `impl` or `trait` definitions - -ast_passes_forbidden_default = - `default` is only allowed on items in trait impls - .label = `default` because of this - -ast_passes_assoc_const_without_body = - associated constant in `impl` without body - .suggestion = provide a definition for the constant - -ast_passes_assoc_fn_without_body = - associated function in `impl` without body - .suggestion = provide a definition for the function - -ast_passes_assoc_type_without_body = - associated type in `impl` without body - .suggestion = provide a definition for the type - -ast_passes_const_without_body = - free constant item without body - .suggestion = provide a definition for the constant - -ast_passes_static_without_body = - free static item without body - .suggestion = provide a definition for the static - -ast_passes_ty_alias_without_body = - free type alias without body - .suggestion = provide a definition for the type - -ast_passes_fn_without_body = - free function without a body - .suggestion = provide a definition for the function - -ast_passes_extern_block_suggestion = if you meant to declare an externally defined function, use an `extern` block - -ast_passes_bound_in_context = bounds on `type`s in {$ctx} have no effect - -ast_passes_extern_types_cannot = `type`s inside `extern` blocks cannot have {$descr} - .suggestion = remove the {$remove_descr} - .label = `extern` block begins here - -ast_passes_extern_keyword_link = for more information, visit https://doc.rust-lang.org/std/keyword.extern.html - -ast_passes_body_in_extern = incorrect `{$kind}` inside `extern` block - .cannot_have = cannot have a body - .invalid = the invalid body - .existing = `extern` blocks define existing foreign {$kind}s and {$kind}s inside of them cannot have a body - -ast_passes_fn_body_extern = incorrect function inside `extern` block - .cannot_have = cannot have a body - .suggestion = remove the invalid body - .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 - .label = `extern` blocks define existing foreign functions and functions inside of them cannot have a body - -ast_passes_extern_fn_qualifiers = functions in `extern` blocks cannot have qualifiers - .label = in this `extern` block - .suggestion = remove the qualifiers - -ast_passes_extern_item_ascii = items in `extern` blocks cannot use non-ascii identifiers - .label = in this `extern` block - .note = this limitation may be lifted in the future; see issue #83942 for more information - -ast_passes_bad_c_variadic = only foreign or `unsafe extern "C"` functions may be C-variadic - -ast_passes_item_underscore = `{$kind}` items in this context need a name - .label = `_` is not a valid name for this `{$kind}` item - -ast_passes_nomangle_ascii = `#[no_mangle]` requires ASCII identifier - -ast_passes_module_nonascii = trying to load file for module `{$name}` with non-ascii identifier name - .help = consider using the `#[path]` attribute to specify filesystem path - -ast_passes_auto_generic = auto traits cannot have generic parameters - .label = auto trait cannot have generic parameters - .suggestion = remove the parameters - -ast_passes_auto_super_lifetime = auto traits cannot have super traits or lifetime bounds - .label = {ast_passes_auto_super_lifetime} - .suggestion = remove the super traits or lifetime bounds - -ast_passes_auto_items = auto traits cannot have associated items - .label = {ast_passes_auto_items} - .suggestion = remove these associated items - -ast_passes_generic_before_constraints = generic arguments must come before the first constraint - .constraints = {$constraint_len -> - [one] constraint - *[other] constraints - } - .args = generic {$args_len -> - [one] argument - *[other] arguments - } - .empty_string = {""}, - .suggestion = move the {$constraint_len -> - [one] constraint - *[other] constraints - } after the generic {$args_len -> - [one] argument - *[other] arguments - } - -ast_passes_pattern_in_fn_pointer = patterns aren't allowed in function pointer types - -ast_passes_trait_object_single_bound = only a single explicit lifetime bound is permitted - -ast_passes_impl_trait_path = `impl Trait` is not allowed in path parameters - -ast_passes_nested_impl_trait = nested `impl Trait` is not allowed - .outer = outer `impl Trait` - .inner = nested `impl Trait` here - -ast_passes_at_least_one_trait = at least one trait must be specified - -ast_passes_extern_without_abi = extern declarations without an explicit ABI are deprecated - -ast_passes_out_of_order_params = {$param_ord} parameters must be declared prior to {$max_param} parameters - .suggestion = reorder the parameters: lifetimes, then consts and types - -ast_passes_obsolete_auto = `impl Trait for .. {"{}"}` is an obsolete syntax - .help = use `auto trait Trait {"{}"}` instead - -ast_passes_unsafe_negative_impl = negative impls cannot be unsafe - .negative = negative because of this - .unsafe = unsafe because of this - -ast_passes_inherent_cannot_be = inherent impls cannot be {$annotation} - .because = {$annotation} because of this - .type = inherent impl for this type - .only_trait = only trait implementations may be annotated with {$annotation} - -ast_passes_unsafe_item = {$kind} cannot be declared unsafe - -ast_passes_fieldless_union = unions cannot have zero fields - -ast_passes_where_after_type_alias = where clauses are not allowed after the type for type aliases - .note = see issue #89122 for more information - -ast_passes_generic_default_trailing = generic parameters with a default must be trailing - -ast_passes_nested_lifetimes = nested quantification of lifetimes - -ast_passes_optional_trait_supertrait = `?Trait` is not permitted in supertraits - .note = traits are `?{$path_str}` by default - -ast_passes_optional_trait_object = `?Trait` is not permitted in trait object types - -ast_passes_tilde_const_disallowed = `~const` is not allowed here - .trait = trait objects cannot have `~const` trait bounds - .closure = closures cannot have `~const` trait bounds - .function = this function is not `const`, so it cannot have `~const` trait bounds - -ast_passes_optional_const_exclusive = `~const` and `?` are mutually exclusive - -ast_passes_const_and_async = functions cannot be both `const` and `async` - .const = `const` because of this - .async = `async` because of this - .label = {""} - -ast_passes_pattern_in_foreign = patterns aren't allowed in foreign function declarations - .label = pattern not allowed in foreign function - -ast_passes_pattern_in_bodiless = patterns aren't allowed in functions without bodies - .label = pattern not allowed in function without body - -ast_passes_equality_in_where = equality constraints are not yet supported in `where` clauses - .label = not supported - .suggestion = if `{$ident}` is an associated type you're trying to set, use the associated type binding syntax - .suggestion_path = if `{$trait_segment}::{$potential_assoc}` is an associated type you're trying to set, use the associated type binding syntax - .note = see issue #20041 for more information - -ast_passes_stability_outside_std = stability attributes may not be used outside of the standard library - -ast_passes_feature_on_non_nightly = `#![feature]` may not be used on the {$channel} release channel - .suggestion = remove the attribute - .stable_since = the feature `{$name}` has been stable since `{$since}` and no longer requires an attribute to enable - -ast_passes_incompatbile_features = `{$f1}` and `{$f2}` are incompatible, using them at the same time is not allowed - .help = remove one of these features - -ast_passes_show_span = {$msg} diff --git a/compiler/rustc_ast_passes/messages.ftl b/compiler/rustc_ast_passes/messages.ftl new file mode 100644 index 00000000000..747bd52b22c --- /dev/null +++ b/compiler/rustc_ast_passes/messages.ftl @@ -0,0 +1,236 @@ +ast_passes_forbidden_let = + `let` expressions are not supported here + .note = only supported directly in conditions of `if` and `while` expressions + .not_supported_or = `||` operators are not supported in let chain expressions + .not_supported_parentheses = `let`s wrapped in parentheses are not supported in a context with let chains + +ast_passes_forbidden_let_stable = + expected expression, found statement (`let`) + .note = variable declaration using `let` is a statement + +ast_passes_deprecated_where_clause_location = + where clause not allowed here + +ast_passes_keyword_lifetime = + lifetimes cannot use keyword names + +ast_passes_invalid_label = + invalid label name `{$name}` + +ast_passes_invalid_visibility = + unnecessary visibility qualifier + .implied = `pub` not permitted here because it's implied + .individual_impl_items = place qualifiers on individual impl items instead + .individual_foreign_items = place qualifiers on individual foreign items instead + +ast_passes_trait_fn_const = + functions in traits cannot be declared const + .label = functions in traits cannot be const + +ast_passes_forbidden_lifetime_bound = + lifetime bounds cannot be used in this context + +ast_passes_forbidden_non_lifetime_param = + only lifetime parameters can be used in this context + +ast_passes_fn_param_too_many = + function can not have more than {$max_num_args} arguments + +ast_passes_fn_param_c_var_args_only = + C-variadic function must be declared with at least one named argument + +ast_passes_fn_param_c_var_args_not_last = + `...` must be the last argument of a C-variadic function + +ast_passes_fn_param_doc_comment = + documentation comments cannot be applied to function parameters + .label = doc comments are not allowed here + +ast_passes_fn_param_forbidden_attr = + allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters + +ast_passes_fn_param_forbidden_self = + `self` parameter is only allowed in associated functions + .label = not semantically valid as function parameter + .note = associated functions are those in `impl` or `trait` definitions + +ast_passes_forbidden_default = + `default` is only allowed on items in trait impls + .label = `default` because of this + +ast_passes_assoc_const_without_body = + associated constant in `impl` without body + .suggestion = provide a definition for the constant + +ast_passes_assoc_fn_without_body = + associated function in `impl` without body + .suggestion = provide a definition for the function + +ast_passes_assoc_type_without_body = + associated type in `impl` without body + .suggestion = provide a definition for the type + +ast_passes_const_without_body = + free constant item without body + .suggestion = provide a definition for the constant + +ast_passes_static_without_body = + free static item without body + .suggestion = provide a definition for the static + +ast_passes_ty_alias_without_body = + free type alias without body + .suggestion = provide a definition for the type + +ast_passes_fn_without_body = + free function without a body + .suggestion = provide a definition for the function + +ast_passes_extern_block_suggestion = if you meant to declare an externally defined function, use an `extern` block + +ast_passes_bound_in_context = bounds on `type`s in {$ctx} have no effect + +ast_passes_extern_types_cannot = `type`s inside `extern` blocks cannot have {$descr} + .suggestion = remove the {$remove_descr} + .label = `extern` block begins here + +ast_passes_extern_keyword_link = for more information, visit https://doc.rust-lang.org/std/keyword.extern.html + +ast_passes_body_in_extern = incorrect `{$kind}` inside `extern` block + .cannot_have = cannot have a body + .invalid = the invalid body + .existing = `extern` blocks define existing foreign {$kind}s and {$kind}s inside of them cannot have a body + +ast_passes_fn_body_extern = incorrect function inside `extern` block + .cannot_have = cannot have a body + .suggestion = remove the invalid body + .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 + .label = `extern` blocks define existing foreign functions and functions inside of them cannot have a body + +ast_passes_extern_fn_qualifiers = functions in `extern` blocks cannot have qualifiers + .label = in this `extern` block + .suggestion = remove the qualifiers + +ast_passes_extern_item_ascii = items in `extern` blocks cannot use non-ascii identifiers + .label = in this `extern` block + .note = this limitation may be lifted in the future; see issue #83942 for more information + +ast_passes_bad_c_variadic = only foreign or `unsafe extern "C"` functions may be C-variadic + +ast_passes_item_underscore = `{$kind}` items in this context need a name + .label = `_` is not a valid name for this `{$kind}` item + +ast_passes_nomangle_ascii = `#[no_mangle]` requires ASCII identifier + +ast_passes_module_nonascii = trying to load file for module `{$name}` with non-ascii identifier name + .help = consider using the `#[path]` attribute to specify filesystem path + +ast_passes_auto_generic = auto traits cannot have generic parameters + .label = auto trait cannot have generic parameters + .suggestion = remove the parameters + +ast_passes_auto_super_lifetime = auto traits cannot have super traits or lifetime bounds + .label = {ast_passes_auto_super_lifetime} + .suggestion = remove the super traits or lifetime bounds + +ast_passes_auto_items = auto traits cannot have associated items + .label = {ast_passes_auto_items} + .suggestion = remove these associated items + +ast_passes_generic_before_constraints = generic arguments must come before the first constraint + .constraints = {$constraint_len -> + [one] constraint + *[other] constraints + } + .args = generic {$args_len -> + [one] argument + *[other] arguments + } + .empty_string = {""}, + .suggestion = move the {$constraint_len -> + [one] constraint + *[other] constraints + } after the generic {$args_len -> + [one] argument + *[other] arguments + } + +ast_passes_pattern_in_fn_pointer = patterns aren't allowed in function pointer types + +ast_passes_trait_object_single_bound = only a single explicit lifetime bound is permitted + +ast_passes_impl_trait_path = `impl Trait` is not allowed in path parameters + +ast_passes_nested_impl_trait = nested `impl Trait` is not allowed + .outer = outer `impl Trait` + .inner = nested `impl Trait` here + +ast_passes_at_least_one_trait = at least one trait must be specified + +ast_passes_extern_without_abi = extern declarations without an explicit ABI are deprecated + +ast_passes_out_of_order_params = {$param_ord} parameters must be declared prior to {$max_param} parameters + .suggestion = reorder the parameters: lifetimes, then consts and types + +ast_passes_obsolete_auto = `impl Trait for .. {"{}"}` is an obsolete syntax + .help = use `auto trait Trait {"{}"}` instead + +ast_passes_unsafe_negative_impl = negative impls cannot be unsafe + .negative = negative because of this + .unsafe = unsafe because of this + +ast_passes_inherent_cannot_be = inherent impls cannot be {$annotation} + .because = {$annotation} because of this + .type = inherent impl for this type + .only_trait = only trait implementations may be annotated with {$annotation} + +ast_passes_unsafe_item = {$kind} cannot be declared unsafe + +ast_passes_fieldless_union = unions cannot have zero fields + +ast_passes_where_after_type_alias = where clauses are not allowed after the type for type aliases + .note = see issue #89122 for more information + +ast_passes_generic_default_trailing = generic parameters with a default must be trailing + +ast_passes_nested_lifetimes = nested quantification of lifetimes + +ast_passes_optional_trait_supertrait = `?Trait` is not permitted in supertraits + .note = traits are `?{$path_str}` by default + +ast_passes_optional_trait_object = `?Trait` is not permitted in trait object types + +ast_passes_tilde_const_disallowed = `~const` is not allowed here + .trait = trait objects cannot have `~const` trait bounds + .closure = closures cannot have `~const` trait bounds + .function = this function is not `const`, so it cannot have `~const` trait bounds + +ast_passes_optional_const_exclusive = `~const` and `?` are mutually exclusive + +ast_passes_const_and_async = functions cannot be both `const` and `async` + .const = `const` because of this + .async = `async` because of this + .label = {""} + +ast_passes_pattern_in_foreign = patterns aren't allowed in foreign function declarations + .label = pattern not allowed in foreign function + +ast_passes_pattern_in_bodiless = patterns aren't allowed in functions without bodies + .label = pattern not allowed in function without body + +ast_passes_equality_in_where = equality constraints are not yet supported in `where` clauses + .label = not supported + .suggestion = if `{$ident}` is an associated type you're trying to set, use the associated type binding syntax + .suggestion_path = if `{$trait_segment}::{$potential_assoc}` is an associated type you're trying to set, use the associated type binding syntax + .note = see issue #20041 for more information + +ast_passes_stability_outside_std = stability attributes may not be used outside of the standard library + +ast_passes_feature_on_non_nightly = `#![feature]` may not be used on the {$channel} release channel + .suggestion = remove the attribute + .stable_since = the feature `{$name}` has been stable since `{$since}` and no longer requires an attribute to enable + +ast_passes_incompatbile_features = `{$f1}` and `{$f2}` are incompatible, using them at the same time is not allowed + .help = remove one of these features + +ast_passes_show_span = {$msg} diff --git a/compiler/rustc_ast_passes/src/lib.rs b/compiler/rustc_ast_passes/src/lib.rs index 6207a32b28d..e2c666604b3 100644 --- a/compiler/rustc_ast_passes/src/lib.rs +++ b/compiler/rustc_ast_passes/src/lib.rs @@ -21,4 +21,4 @@ pub mod feature_gate; pub mod node_count; pub mod show_span; -fluent_messages! { "../locales/en-US.ftl" } +fluent_messages! { "../messages.ftl" } diff --git a/compiler/rustc_attr/locales/en-US.ftl b/compiler/rustc_attr/locales/en-US.ftl deleted file mode 100644 index a7f8c993d42..00000000000 --- a/compiler/rustc_attr/locales/en-US.ftl +++ /dev/null @@ -1,107 +0,0 @@ -attr_expected_one_cfg_pattern = - expected 1 cfg-pattern - -attr_invalid_predicate = - invalid predicate `{$predicate}` - -attr_multiple_item = - multiple '{$item}' items - -attr_incorrect_meta_item = - incorrect meta item - -attr_unknown_meta_item = - unknown meta item '{$item}' - .label = expected one of {$expected} - -attr_missing_since = - missing 'since' - -attr_missing_note = - missing 'note' - -attr_multiple_stability_levels = - multiple stability levels - -attr_invalid_issue_string = - `issue` must be a non-zero numeric string or "none" - .must_not_be_zero = `issue` must not be "0", use "none" instead - .empty = cannot parse integer from empty string - .invalid_digit = invalid digit found in string - .pos_overflow = number too large to fit in target type - .neg_overflow = number too small to fit in target type - -attr_missing_feature = - missing 'feature' - -attr_non_ident_feature = - 'feature' is not an identifier - -attr_missing_issue = - missing 'issue' - -attr_incorrect_repr_format_packed_one_or_zero_arg = - incorrect `repr(packed)` attribute format: `packed` takes exactly one parenthesized argument, or no parentheses at all - -attr_invalid_repr_hint_no_paren = - invalid representation hint: `{$name}` does not take a parenthesized argument list - -attr_invalid_repr_hint_no_value = - invalid representation hint: `{$name}` does not take a value - -attr_unsupported_literal_generic = - unsupported literal -attr_unsupported_literal_cfg_string = - literal in `cfg` predicate value must be a string -attr_unsupported_literal_deprecated_string = - literal in `deprecated` value must be a string -attr_unsupported_literal_deprecated_kv_pair = - item in `deprecated` must be a key/value pair -attr_unsupported_literal_suggestion = - consider removing the prefix - -attr_invalid_repr_align_need_arg = - invalid `repr(align)` attribute: `align` needs an argument - .suggestion = supply an argument here - -attr_invalid_repr_generic = - invalid `repr({$repr_arg})` attribute: {$error_part} - -attr_incorrect_repr_format_align_one_arg = - incorrect `repr(align)` attribute format: `align` takes exactly one argument in parentheses - -attr_incorrect_repr_format_generic = - incorrect `repr({$repr_arg})` attribute format - .suggestion = use parentheses instead - -attr_rustc_promotable_pairing = - `rustc_promotable` attribute must be paired with either a `rustc_const_unstable` or a `rustc_const_stable` attribute - -attr_rustc_allowed_unstable_pairing = - `rustc_allowed_through_unstable_modules` attribute must be paired with a `stable` attribute - -attr_cfg_predicate_identifier = - `cfg` predicate key must be an identifier - -attr_deprecated_item_suggestion = - suggestions on deprecated items are unstable - .help = add `#![feature(deprecated_suggestion)]` to the crate root - .note = see #94785 for more details - -attr_expected_single_version_literal = - expected single version literal - -attr_expected_version_literal = - expected a version literal - -attr_expects_feature_list = - `{$name}` expects a list of feature names - -attr_expects_features = - `{$name}` expects feature names - -attr_soft_no_args = - `soft` should not have any arguments - -attr_unknown_version_literal = - unknown version literal format, assuming it refers to a future version diff --git a/compiler/rustc_attr/messages.ftl b/compiler/rustc_attr/messages.ftl new file mode 100644 index 00000000000..a7f8c993d42 --- /dev/null +++ b/compiler/rustc_attr/messages.ftl @@ -0,0 +1,107 @@ +attr_expected_one_cfg_pattern = + expected 1 cfg-pattern + +attr_invalid_predicate = + invalid predicate `{$predicate}` + +attr_multiple_item = + multiple '{$item}' items + +attr_incorrect_meta_item = + incorrect meta item + +attr_unknown_meta_item = + unknown meta item '{$item}' + .label = expected one of {$expected} + +attr_missing_since = + missing 'since' + +attr_missing_note = + missing 'note' + +attr_multiple_stability_levels = + multiple stability levels + +attr_invalid_issue_string = + `issue` must be a non-zero numeric string or "none" + .must_not_be_zero = `issue` must not be "0", use "none" instead + .empty = cannot parse integer from empty string + .invalid_digit = invalid digit found in string + .pos_overflow = number too large to fit in target type + .neg_overflow = number too small to fit in target type + +attr_missing_feature = + missing 'feature' + +attr_non_ident_feature = + 'feature' is not an identifier + +attr_missing_issue = + missing 'issue' + +attr_incorrect_repr_format_packed_one_or_zero_arg = + incorrect `repr(packed)` attribute format: `packed` takes exactly one parenthesized argument, or no parentheses at all + +attr_invalid_repr_hint_no_paren = + invalid representation hint: `{$name}` does not take a parenthesized argument list + +attr_invalid_repr_hint_no_value = + invalid representation hint: `{$name}` does not take a value + +attr_unsupported_literal_generic = + unsupported literal +attr_unsupported_literal_cfg_string = + literal in `cfg` predicate value must be a string +attr_unsupported_literal_deprecated_string = + literal in `deprecated` value must be a string +attr_unsupported_literal_deprecated_kv_pair = + item in `deprecated` must be a key/value pair +attr_unsupported_literal_suggestion = + consider removing the prefix + +attr_invalid_repr_align_need_arg = + invalid `repr(align)` attribute: `align` needs an argument + .suggestion = supply an argument here + +attr_invalid_repr_generic = + invalid `repr({$repr_arg})` attribute: {$error_part} + +attr_incorrect_repr_format_align_one_arg = + incorrect `repr(align)` attribute format: `align` takes exactly one argument in parentheses + +attr_incorrect_repr_format_generic = + incorrect `repr({$repr_arg})` attribute format + .suggestion = use parentheses instead + +attr_rustc_promotable_pairing = + `rustc_promotable` attribute must be paired with either a `rustc_const_unstable` or a `rustc_const_stable` attribute + +attr_rustc_allowed_unstable_pairing = + `rustc_allowed_through_unstable_modules` attribute must be paired with a `stable` attribute + +attr_cfg_predicate_identifier = + `cfg` predicate key must be an identifier + +attr_deprecated_item_suggestion = + suggestions on deprecated items are unstable + .help = add `#![feature(deprecated_suggestion)]` to the crate root + .note = see #94785 for more details + +attr_expected_single_version_literal = + expected single version literal + +attr_expected_version_literal = + expected a version literal + +attr_expects_feature_list = + `{$name}` expects a list of feature names + +attr_expects_features = + `{$name}` expects feature names + +attr_soft_no_args = + `soft` should not have any arguments + +attr_unknown_version_literal = + unknown version literal format, assuming it refers to a future version diff --git a/compiler/rustc_attr/src/lib.rs b/compiler/rustc_attr/src/lib.rs index 5fede0a58ac..49818c14f27 100644 --- a/compiler/rustc_attr/src/lib.rs +++ b/compiler/rustc_attr/src/lib.rs @@ -26,4 +26,4 @@ pub use rustc_ast::attr::*; pub(crate) use rustc_ast::HashStableContext; -fluent_messages! { "../locales/en-US.ftl" } +fluent_messages! { "../messages.ftl" } diff --git a/compiler/rustc_borrowck/locales/en-US.ftl b/compiler/rustc_borrowck/locales/en-US.ftl deleted file mode 100644 index a3b6b5e8138..00000000000 --- a/compiler/rustc_borrowck/locales/en-US.ftl +++ /dev/null @@ -1,129 +0,0 @@ -borrowck_move_unsized = - cannot move a value of type `{$ty}` - .label = the size of `{$ty}` cannot be statically determined - -borrowck_higher_ranked_lifetime_error = - higher-ranked lifetime error - -borrowck_could_not_prove = - could not prove `{$predicate}` - -borrowck_could_not_normalize = - could not normalize `{$value}` - -borrowck_higher_ranked_subtype_error = - higher-ranked subtype error - -borrowck_generic_does_not_live_long_enough = - `{$kind}` does not live long enough - -borrowck_move_borrowed = - cannot move out of `{$desc}` because it is borrowed - -borrowck_var_does_not_need_mut = - variable does not need to be mutable - .suggestion = remove this `mut` - -borrowck_var_cannot_escape_closure = - captured variable cannot escape `FnMut` closure body - .note = `FnMut` closures only have access to their captured variables while they are executing... - .cannot_escape = ...therefore, they cannot allow references to captured variables to escape - -borrowck_var_here_defined = variable defined here - -borrowck_var_here_captured = variable captured here - -borrowck_closure_inferred_mut = inferred to be a `FnMut` closure - -borrowck_returned_closure_escaped = - returns a closure that contains a reference to a captured variable, which then escapes the closure body - -borrowck_returned_async_block_escaped = - returns an `async` block that contains a reference to a captured variable, which then escapes the closure body - -borrowck_returned_ref_escaped = - returns a reference to a captured variable which escapes the closure body - -borrowck_lifetime_constraints_error = - lifetime may not live long enough - -borrowck_returned_lifetime_wrong = - {$mir_def_name} was supposed to return data with lifetime `{$outlived_fr_name}` but it is returning data with lifetime `{$fr_name}` - -borrowck_returned_lifetime_short = - {$category_desc}requires that `{$free_region_name}` must outlive `{$outlived_fr_name}` - -borrowck_used_impl_require_static = - the used `impl` has a `'static` requirement - -borrowck_capture_kind_label = - capture is {$kind_desc} because of use here - -borrowck_var_borrow_by_use_place_in_generator = - borrow occurs due to use of {$place} in closure in generator - -borrowck_var_borrow_by_use_place_in_closure = - borrow occurs due to use of {$place} in closure - -borrowck_var_borrow_by_use_place = - borrow occurs due to use of {$place} - -borrowck_borrow_due_to_use_generator = - borrow occurs due to use in generator - -borrowck_use_due_to_use_generator = - use occurs due to use in generator - -borrowck_assign_due_to_use_generator = - assign occurs due to use in generator - -borrowck_assign_part_due_to_use_generator = - assign to part occurs due to use in generator - -borrowck_borrow_due_to_use_closure = - borrow occurs due to use in closure - -borrowck_use_due_to_use_closure = - use occurs due to use in closure - -borrowck_assign_due_to_use_closure = - assignment occurs due to use in closure - -borrowck_assign_part_due_to_use_closure = - assignment to part occurs due to use in closure - -borrowck_capture_immute = - capture is immutable because of use here - -borrowck_capture_mut = - capture is mutable because of use here - -borrowck_capture_move = - capture is moved because of use here - -borrowck_var_move_by_use_place_in_generator = - move occurs due to use of {$place} in generator - -borrowck_var_move_by_use_place_in_closure = - move occurs due to use of {$place} in closure - -borrowck_cannot_move_when_borrowed = - cannot move out of {$place -> - [value] value - *[other] {$place} - } because it is borrowed - .label = borrow of {$borrow_place -> - [value] value - *[other] {$borrow_place} - } occurs here - .move_label = move out of {$value_place -> - [value] value - *[other] {$value_place} - } occurs here - -borrowck_opaque_type_non_generic_param = - expected generic {$kind} parameter, found `{$ty}` - .label = {STREQ($ty, "'static") -> - [true] cannot use static lifetime; use a bound lifetime instead or remove the lifetime parameter from the opaque type - *[other] this generic parameter must be used with a generic {$kind} parameter - } diff --git a/compiler/rustc_borrowck/messages.ftl b/compiler/rustc_borrowck/messages.ftl new file mode 100644 index 00000000000..a3b6b5e8138 --- /dev/null +++ b/compiler/rustc_borrowck/messages.ftl @@ -0,0 +1,129 @@ +borrowck_move_unsized = + cannot move a value of type `{$ty}` + .label = the size of `{$ty}` cannot be statically determined + +borrowck_higher_ranked_lifetime_error = + higher-ranked lifetime error + +borrowck_could_not_prove = + could not prove `{$predicate}` + +borrowck_could_not_normalize = + could not normalize `{$value}` + +borrowck_higher_ranked_subtype_error = + higher-ranked subtype error + +borrowck_generic_does_not_live_long_enough = + `{$kind}` does not live long enough + +borrowck_move_borrowed = + cannot move out of `{$desc}` because it is borrowed + +borrowck_var_does_not_need_mut = + variable does not need to be mutable + .suggestion = remove this `mut` + +borrowck_var_cannot_escape_closure = + captured variable cannot escape `FnMut` closure body + .note = `FnMut` closures only have access to their captured variables while they are executing... + .cannot_escape = ...therefore, they cannot allow references to captured variables to escape + +borrowck_var_here_defined = variable defined here + +borrowck_var_here_captured = variable captured here + +borrowck_closure_inferred_mut = inferred to be a `FnMut` closure + +borrowck_returned_closure_escaped = + returns a closure that contains a reference to a captured variable, which then escapes the closure body + +borrowck_returned_async_block_escaped = + returns an `async` block that contains a reference to a captured variable, which then escapes the closure body + +borrowck_returned_ref_escaped = + returns a reference to a captured variable which escapes the closure body + +borrowck_lifetime_constraints_error = + lifetime may not live long enough + +borrowck_returned_lifetime_wrong = + {$mir_def_name} was supposed to return data with lifetime `{$outlived_fr_name}` but it is returning data with lifetime `{$fr_name}` + +borrowck_returned_lifetime_short = + {$category_desc}requires that `{$free_region_name}` must outlive `{$outlived_fr_name}` + +borrowck_used_impl_require_static = + the used `impl` has a `'static` requirement + +borrowck_capture_kind_label = + capture is {$kind_desc} because of use here + +borrowck_var_borrow_by_use_place_in_generator = + borrow occurs due to use of {$place} in closure in generator + +borrowck_var_borrow_by_use_place_in_closure = + borrow occurs due to use of {$place} in closure + +borrowck_var_borrow_by_use_place = + borrow occurs due to use of {$place} + +borrowck_borrow_due_to_use_generator = + borrow occurs due to use in generator + +borrowck_use_due_to_use_generator = + use occurs due to use in generator + +borrowck_assign_due_to_use_generator = + assign occurs due to use in generator + +borrowck_assign_part_due_to_use_generator = + assign to part occurs due to use in generator + +borrowck_borrow_due_to_use_closure = + borrow occurs due to use in closure + +borrowck_use_due_to_use_closure = + use occurs due to use in closure + +borrowck_assign_due_to_use_closure = + assignment occurs due to use in closure + +borrowck_assign_part_due_to_use_closure = + assignment to part occurs due to use in closure + +borrowck_capture_immute = + capture is immutable because of use here + +borrowck_capture_mut = + capture is mutable because of use here + +borrowck_capture_move = + capture is moved because of use here + +borrowck_var_move_by_use_place_in_generator = + move occurs due to use of {$place} in generator + +borrowck_var_move_by_use_place_in_closure = + move occurs due to use of {$place} in closure + +borrowck_cannot_move_when_borrowed = + cannot move out of {$place -> + [value] value + *[other] {$place} + } because it is borrowed + .label = borrow of {$borrow_place -> + [value] value + *[other] {$borrow_place} + } occurs here + .move_label = move out of {$value_place -> + [value] value + *[other] {$value_place} + } occurs here + +borrowck_opaque_type_non_generic_param = + expected generic {$kind} parameter, found `{$ty}` + .label = {STREQ($ty, "'static") -> + [true] cannot use static lifetime; use a bound lifetime instead or remove the lifetime parameter from the opaque type + *[other] this generic parameter must be used with a generic {$kind} parameter + } diff --git a/compiler/rustc_borrowck/src/lib.rs b/compiler/rustc_borrowck/src/lib.rs index f84a4691d32..5e77f6b190a 100644 --- a/compiler/rustc_borrowck/src/lib.rs +++ b/compiler/rustc_borrowck/src/lib.rs @@ -100,7 +100,7 @@ use places_conflict::{places_conflict, PlaceConflictBias}; use region_infer::RegionInferenceContext; use renumber::RegionCtxt; -fluent_messages! { "../locales/en-US.ftl" } +fluent_messages! { "../messages.ftl" } // FIXME(eddyb) perhaps move this somewhere more centrally. #[derive(Debug)] diff --git a/compiler/rustc_builtin_macros/locales/en-US.ftl b/compiler/rustc_builtin_macros/locales/en-US.ftl deleted file mode 100644 index 4d088e27b36..00000000000 --- a/compiler/rustc_builtin_macros/locales/en-US.ftl +++ /dev/null @@ -1,5 +0,0 @@ -builtin_macros_requires_cfg_pattern = - macro requires a cfg-pattern as an argument - .label = cfg-pattern required - -builtin_macros_expected_one_cfg_pattern = expected 1 cfg-pattern diff --git a/compiler/rustc_builtin_macros/messages.ftl b/compiler/rustc_builtin_macros/messages.ftl new file mode 100644 index 00000000000..4d088e27b36 --- /dev/null +++ b/compiler/rustc_builtin_macros/messages.ftl @@ -0,0 +1,5 @@ +builtin_macros_requires_cfg_pattern = + macro requires a cfg-pattern as an argument + .label = cfg-pattern required + +builtin_macros_expected_one_cfg_pattern = expected 1 cfg-pattern diff --git a/compiler/rustc_builtin_macros/src/lib.rs b/compiler/rustc_builtin_macros/src/lib.rs index 8afb6e56069..71177b8789b 100644 --- a/compiler/rustc_builtin_macros/src/lib.rs +++ b/compiler/rustc_builtin_macros/src/lib.rs @@ -56,7 +56,7 @@ pub mod proc_macro_harness; pub mod standard_library_imports; pub mod test_harness; -fluent_messages! { "../locales/en-US.ftl" } +fluent_messages! { "../messages.ftl" } pub fn register_builtin_macros(resolver: &mut dyn ResolverExpand) { let mut register = |name, kind| resolver.register_builtin_macro(name, kind); diff --git a/compiler/rustc_codegen_gcc/locales/en-US.ftl b/compiler/rustc_codegen_gcc/locales/en-US.ftl deleted file mode 100644 index 0a94a08f8dc..00000000000 --- a/compiler/rustc_codegen_gcc/locales/en-US.ftl +++ /dev/null @@ -1,68 +0,0 @@ -codegen_gcc_unwinding_inline_asm = - GCC backend does not support unwinding from inline asm - -codegen_gcc_lto_not_supported = - LTO is not supported. You may get a linker error. - -codegen_gcc_invalid_monomorphization_basic_integer = - invalid monomorphization of `{$name}` intrinsic: expected basic integer type, found `{$ty}` - -codegen_gcc_invalid_monomorphization_invalid_float_vector = - invalid monomorphization of `{$name}` intrinsic: unsupported element type `{$elem_ty}` of floating-point vector `{$vec_ty}` - -codegen_gcc_invalid_monomorphization_not_float = - invalid monomorphization of `{$name}` intrinsic: `{$ty}` is not a floating-point type - -codegen_gcc_invalid_monomorphization_unrecognized = - invalid monomorphization of `{$name}` intrinsic: unrecognized intrinsic `{$name}` - -codegen_gcc_invalid_monomorphization_expected_signed_unsigned = - invalid monomorphization of `{$name}` intrinsic: expected element type `{$elem_ty}` of vector type `{$vec_ty}` to be a signed or unsigned integer type - -codegen_gcc_invalid_monomorphization_unsupported_element = - invalid monomorphization of `{$name}` intrinsic: unsupported {$name} from `{$in_ty}` with element `{$elem_ty}` to `{$ret_ty}` - -codegen_gcc_invalid_monomorphization_invalid_bitmask = - invalid monomorphization of `{$name}` intrinsic: invalid bitmask `{$ty}`, expected `u{$expected_int_bits}` or `[u8; {$expected_bytes}]` - -codegen_gcc_invalid_monomorphization_simd_shuffle = - invalid monomorphization of `{$name}` intrinsic: simd_shuffle index must be an array of `u32`, got `{$ty}` - -codegen_gcc_invalid_monomorphization_expected_simd = - invalid monomorphization of `{$name}` intrinsic: expected SIMD {$expected_ty} type, found non-SIMD `{$found_ty}` - -codegen_gcc_invalid_monomorphization_mask_type = - invalid monomorphization of `{$name}` intrinsic: mask element type is `{$ty}`, expected `i_` - -codegen_gcc_invalid_monomorphization_return_length = - invalid monomorphization of `{$name}` intrinsic: expected return type of length {$in_len}, found `{$ret_ty}` with length {$out_len} - -codegen_gcc_invalid_monomorphization_return_length_input_type = - invalid monomorphization of `{$name}` intrinsic: expected return type with length {$in_len} (same as input type `{$in_ty}`), found `{$ret_ty}` with length {$out_len} - -codegen_gcc_invalid_monomorphization_return_element = - invalid monomorphization of `{$name}` intrinsic: expected return element type `{$in_elem}` (element of input `{$in_ty}`), found `{$ret_ty}` with element type `{$out_ty}` - -codegen_gcc_invalid_monomorphization_return_type = - invalid monomorphization of `{$name}` intrinsic: expected return type `{$in_elem}` (element of input `{$in_ty}`), found `{$ret_ty}` - -codegen_gcc_invalid_monomorphization_inserted_type = - invalid monomorphization of `{$name}` intrinsic: expected inserted type `{$in_elem}` (element of input `{$in_ty}`), found `{$out_ty}` - -codegen_gcc_invalid_monomorphization_return_integer_type = - invalid monomorphization of `{$name}` intrinsic: expected return type with integer elements, found `{$ret_ty}` with non-integer `{$out_ty}` - -codegen_gcc_invalid_monomorphization_mismatched_lengths = - invalid monomorphization of `{$name}` intrinsic: mismatched lengths: mask length `{$m_len}` != other vector length `{$v_len}` - -codegen_gcc_invalid_monomorphization_unsupported_cast = - invalid monomorphization of `{$name}` intrinsic: unsupported cast from `{$in_ty}` with element `{$in_elem}` to `{$ret_ty}` with element `{$out_elem}` - -codegen_gcc_invalid_monomorphization_unsupported_operation = - invalid monomorphization of `{$name}` intrinsic: unsupported operation on `{$in_ty}` with element `{$in_elem}` - -codegen_gcc_invalid_minimum_alignment = - invalid minimum global alignment: {$err} - -codegen_gcc_tied_target_features = the target features {$features} must all be either enabled or disabled together - .help = add the missing features in a `target_feature` attribute diff --git a/compiler/rustc_codegen_gcc/messages.ftl b/compiler/rustc_codegen_gcc/messages.ftl new file mode 100644 index 00000000000..0a94a08f8dc --- /dev/null +++ b/compiler/rustc_codegen_gcc/messages.ftl @@ -0,0 +1,68 @@ +codegen_gcc_unwinding_inline_asm = + GCC backend does not support unwinding from inline asm + +codegen_gcc_lto_not_supported = + LTO is not supported. You may get a linker error. + +codegen_gcc_invalid_monomorphization_basic_integer = + invalid monomorphization of `{$name}` intrinsic: expected basic integer type, found `{$ty}` + +codegen_gcc_invalid_monomorphization_invalid_float_vector = + invalid monomorphization of `{$name}` intrinsic: unsupported element type `{$elem_ty}` of floating-point vector `{$vec_ty}` + +codegen_gcc_invalid_monomorphization_not_float = + invalid monomorphization of `{$name}` intrinsic: `{$ty}` is not a floating-point type + +codegen_gcc_invalid_monomorphization_unrecognized = + invalid monomorphization of `{$name}` intrinsic: unrecognized intrinsic `{$name}` + +codegen_gcc_invalid_monomorphization_expected_signed_unsigned = + invalid monomorphization of `{$name}` intrinsic: expected element type `{$elem_ty}` of vector type `{$vec_ty}` to be a signed or unsigned integer type + +codegen_gcc_invalid_monomorphization_unsupported_element = + invalid monomorphization of `{$name}` intrinsic: unsupported {$name} from `{$in_ty}` with element `{$elem_ty}` to `{$ret_ty}` + +codegen_gcc_invalid_monomorphization_invalid_bitmask = + invalid monomorphization of `{$name}` intrinsic: invalid bitmask `{$ty}`, expected `u{$expected_int_bits}` or `[u8; {$expected_bytes}]` + +codegen_gcc_invalid_monomorphization_simd_shuffle = + invalid monomorphization of `{$name}` intrinsic: simd_shuffle index must be an array of `u32`, got `{$ty}` + +codegen_gcc_invalid_monomorphization_expected_simd = + invalid monomorphization of `{$name}` intrinsic: expected SIMD {$expected_ty} type, found non-SIMD `{$found_ty}` + +codegen_gcc_invalid_monomorphization_mask_type = + invalid monomorphization of `{$name}` intrinsic: mask element type is `{$ty}`, expected `i_` + +codegen_gcc_invalid_monomorphization_return_length = + invalid monomorphization of `{$name}` intrinsic: expected return type of length {$in_len}, found `{$ret_ty}` with length {$out_len} + +codegen_gcc_invalid_monomorphization_return_length_input_type = + invalid monomorphization of `{$name}` intrinsic: expected return type with length {$in_len} (same as input type `{$in_ty}`), found `{$ret_ty}` with length {$out_len} + +codegen_gcc_invalid_monomorphization_return_element = + invalid monomorphization of `{$name}` intrinsic: expected return element type `{$in_elem}` (element of input `{$in_ty}`), found `{$ret_ty}` with element type `{$out_ty}` + +codegen_gcc_invalid_monomorphization_return_type = + invalid monomorphization of `{$name}` intrinsic: expected return type `{$in_elem}` (element of input `{$in_ty}`), found `{$ret_ty}` + +codegen_gcc_invalid_monomorphization_inserted_type = + invalid monomorphization of `{$name}` intrinsic: expected inserted type `{$in_elem}` (element of input `{$in_ty}`), found `{$out_ty}` + +codegen_gcc_invalid_monomorphization_return_integer_type = + invalid monomorphization of `{$name}` intrinsic: expected return type with integer elements, found `{$ret_ty}` with non-integer `{$out_ty}` + +codegen_gcc_invalid_monomorphization_mismatched_lengths = + invalid monomorphization of `{$name}` intrinsic: mismatched lengths: mask length `{$m_len}` != other vector length `{$v_len}` + +codegen_gcc_invalid_monomorphization_unsupported_cast = + invalid monomorphization of `{$name}` intrinsic: unsupported cast from `{$in_ty}` with element `{$in_elem}` to `{$ret_ty}` with element `{$out_elem}` + +codegen_gcc_invalid_monomorphization_unsupported_operation = + invalid monomorphization of `{$name}` intrinsic: unsupported operation on `{$in_ty}` with element `{$in_elem}` + +codegen_gcc_invalid_minimum_alignment = + invalid minimum global alignment: {$err} + +codegen_gcc_tied_target_features = the target features {$features} must all be either enabled or disabled together + .help = add the missing features in a `target_feature` attribute diff --git a/compiler/rustc_codegen_gcc/src/lib.rs b/compiler/rustc_codegen_gcc/src/lib.rs index 1b7feb5f8a1..0b661505acc 100644 --- a/compiler/rustc_codegen_gcc/src/lib.rs +++ b/compiler/rustc_codegen_gcc/src/lib.rs @@ -87,7 +87,7 @@ use rustc_span::Symbol; use rustc_span::fatal_error::FatalError; use tempfile::TempDir; -fluent_messages! { "../locales/en-US.ftl" } +fluent_messages! { "../messages.ftl" } pub struct PrintOnPanic String>(pub F); diff --git a/compiler/rustc_codegen_llvm/locales/en-US.ftl b/compiler/rustc_codegen_llvm/locales/en-US.ftl deleted file mode 100644 index e5df417370b..00000000000 --- a/compiler/rustc_codegen_llvm/locales/en-US.ftl +++ /dev/null @@ -1,89 +0,0 @@ -codegen_llvm_unknown_ctarget_feature = - unknown feature specified for `-Ctarget-feature`: `{$feature}` - .note = it is still passed through to the codegen backend - .possible_feature = you might have meant: `{$rust_feature}` - .consider_filing_feature_request = consider filing a feature request - -codegen_llvm_unknown_ctarget_feature_prefix = - unknown feature specified for `-Ctarget-feature`: `{$feature}` - .note = features must begin with a `+` to enable or `-` to disable it - -codegen_llvm_error_creating_import_library = - Error creating import library for {$lib_name}: {$error} - -codegen_llvm_symbol_already_defined = - symbol `{$symbol_name}` is already defined - -codegen_llvm_invalid_minimum_alignment = - invalid minimum global alignment: {$err} - -codegen_llvm_sanitizer_memtag_requires_mte = - `-Zsanitizer=memtag` requires `-Ctarget-feature=+mte` - -codegen_llvm_error_writing_def_file = - Error writing .DEF file: {$error} - -codegen_llvm_error_calling_dlltool = - Error calling dlltool: {$error} - -codegen_llvm_dlltool_fail_import_library = - Dlltool could not create import library: {$stdout}\n{$stderr} - -codegen_llvm_target_feature_disable_or_enable = - the target features {$features} must all be either enabled or disabled together - -codegen_llvm_missing_features = - add the missing features in a `target_feature` attribute - -codegen_llvm_dynamic_linking_with_lto = - cannot prefer dynamic linking when performing LTO - .note = only 'staticlib', 'bin', and 'cdylib' outputs are supported with LTO - -codegen_llvm_parse_target_machine_config = - failed to parse target machine config to target machine: {$error} - -codegen_llvm_lto_disallowed = lto can only be run for executables, cdylibs and static library outputs - -codegen_llvm_lto_dylib = lto cannot be used for `dylib` crate type without `-Zdylib-lto` - -codegen_llvm_lto_bitcode_from_rlib = failed to get bitcode from object file for LTO ({$llvm_err}) - -codegen_llvm_write_output = could not write output to {$path} -codegen_llvm_write_output_with_llvm_err = could not write output to {$path}: {$llvm_err} - -codegen_llvm_target_machine = could not create LLVM TargetMachine for triple: {$triple} -codegen_llvm_target_machine_with_llvm_err = could not create LLVM TargetMachine for triple: {$triple}: {$llvm_err} - -codegen_llvm_run_passes = failed to run LLVM passes -codegen_llvm_run_passes_with_llvm_err = failed to run LLVM passes: {$llvm_err} - -codegen_llvm_serialize_module = failed to serialize module {$name} -codegen_llvm_serialize_module_with_llvm_err = failed to serialize module {$name}: {$llvm_err} - -codegen_llvm_write_ir = failed to write LLVM IR to {$path} -codegen_llvm_write_ir_with_llvm_err = failed to write LLVM IR to {$path}: {$llvm_err} - -codegen_llvm_prepare_thin_lto_context = failed to prepare thin LTO context -codegen_llvm_prepare_thin_lto_context_with_llvm_err = failed to prepare thin LTO context: {$llvm_err} - -codegen_llvm_load_bitcode = failed to load bitcode of module "{$name}" -codegen_llvm_load_bitcode_with_llvm_err = failed to load bitcode of module "{$name}": {$llvm_err} - -codegen_llvm_write_thinlto_key = error while writing ThinLTO key data: {$err} -codegen_llvm_write_thinlto_key_with_llvm_err = error while writing ThinLTO key data: {$err}: {$llvm_err} - -codegen_llvm_multiple_source_dicompileunit = multiple source DICompileUnits found -codegen_llvm_multiple_source_dicompileunit_with_llvm_err = multiple source DICompileUnits found: {$llvm_err} - -codegen_llvm_prepare_thin_lto_module = failed to prepare thin LTO module -codegen_llvm_prepare_thin_lto_module_with_llvm_err = failed to prepare thin LTO module: {$llvm_err} - -codegen_llvm_parse_bitcode = failed to parse bitcode for LTO module -codegen_llvm_parse_bitcode_with_llvm_err = failed to parse bitcode for LTO module: {$llvm_err} - -codegen_llvm_from_llvm_optimization_diag = {$filename}:{$line}:{$column} {$pass_name}: {$message} -codegen_llvm_from_llvm_diag = {$message} - -codegen_llvm_write_bytecode = failed to write bytecode to {$path}: {$err} - -codegen_llvm_copy_bitcode = failed to copy bitcode to object file: {$err} diff --git a/compiler/rustc_codegen_llvm/messages.ftl b/compiler/rustc_codegen_llvm/messages.ftl new file mode 100644 index 00000000000..e5df417370b --- /dev/null +++ b/compiler/rustc_codegen_llvm/messages.ftl @@ -0,0 +1,89 @@ +codegen_llvm_unknown_ctarget_feature = + unknown feature specified for `-Ctarget-feature`: `{$feature}` + .note = it is still passed through to the codegen backend + .possible_feature = you might have meant: `{$rust_feature}` + .consider_filing_feature_request = consider filing a feature request + +codegen_llvm_unknown_ctarget_feature_prefix = + unknown feature specified for `-Ctarget-feature`: `{$feature}` + .note = features must begin with a `+` to enable or `-` to disable it + +codegen_llvm_error_creating_import_library = + Error creating import library for {$lib_name}: {$error} + +codegen_llvm_symbol_already_defined = + symbol `{$symbol_name}` is already defined + +codegen_llvm_invalid_minimum_alignment = + invalid minimum global alignment: {$err} + +codegen_llvm_sanitizer_memtag_requires_mte = + `-Zsanitizer=memtag` requires `-Ctarget-feature=+mte` + +codegen_llvm_error_writing_def_file = + Error writing .DEF file: {$error} + +codegen_llvm_error_calling_dlltool = + Error calling dlltool: {$error} + +codegen_llvm_dlltool_fail_import_library = + Dlltool could not create import library: {$stdout}\n{$stderr} + +codegen_llvm_target_feature_disable_or_enable = + the target features {$features} must all be either enabled or disabled together + +codegen_llvm_missing_features = + add the missing features in a `target_feature` attribute + +codegen_llvm_dynamic_linking_with_lto = + cannot prefer dynamic linking when performing LTO + .note = only 'staticlib', 'bin', and 'cdylib' outputs are supported with LTO + +codegen_llvm_parse_target_machine_config = + failed to parse target machine config to target machine: {$error} + +codegen_llvm_lto_disallowed = lto can only be run for executables, cdylibs and static library outputs + +codegen_llvm_lto_dylib = lto cannot be used for `dylib` crate type without `-Zdylib-lto` + +codegen_llvm_lto_bitcode_from_rlib = failed to get bitcode from object file for LTO ({$llvm_err}) + +codegen_llvm_write_output = could not write output to {$path} +codegen_llvm_write_output_with_llvm_err = could not write output to {$path}: {$llvm_err} + +codegen_llvm_target_machine = could not create LLVM TargetMachine for triple: {$triple} +codegen_llvm_target_machine_with_llvm_err = could not create LLVM TargetMachine for triple: {$triple}: {$llvm_err} + +codegen_llvm_run_passes = failed to run LLVM passes +codegen_llvm_run_passes_with_llvm_err = failed to run LLVM passes: {$llvm_err} + +codegen_llvm_serialize_module = failed to serialize module {$name} +codegen_llvm_serialize_module_with_llvm_err = failed to serialize module {$name}: {$llvm_err} + +codegen_llvm_write_ir = failed to write LLVM IR to {$path} +codegen_llvm_write_ir_with_llvm_err = failed to write LLVM IR to {$path}: {$llvm_err} + +codegen_llvm_prepare_thin_lto_context = failed to prepare thin LTO context +codegen_llvm_prepare_thin_lto_context_with_llvm_err = failed to prepare thin LTO context: {$llvm_err} + +codegen_llvm_load_bitcode = failed to load bitcode of module "{$name}" +codegen_llvm_load_bitcode_with_llvm_err = failed to load bitcode of module "{$name}": {$llvm_err} + +codegen_llvm_write_thinlto_key = error while writing ThinLTO key data: {$err} +codegen_llvm_write_thinlto_key_with_llvm_err = error while writing ThinLTO key data: {$err}: {$llvm_err} + +codegen_llvm_multiple_source_dicompileunit = multiple source DICompileUnits found +codegen_llvm_multiple_source_dicompileunit_with_llvm_err = multiple source DICompileUnits found: {$llvm_err} + +codegen_llvm_prepare_thin_lto_module = failed to prepare thin LTO module +codegen_llvm_prepare_thin_lto_module_with_llvm_err = failed to prepare thin LTO module: {$llvm_err} + +codegen_llvm_parse_bitcode = failed to parse bitcode for LTO module +codegen_llvm_parse_bitcode_with_llvm_err = failed to parse bitcode for LTO module: {$llvm_err} + +codegen_llvm_from_llvm_optimization_diag = {$filename}:{$line}:{$column} {$pass_name}: {$message} +codegen_llvm_from_llvm_diag = {$message} + +codegen_llvm_write_bytecode = failed to write bytecode to {$path}: {$err} + +codegen_llvm_copy_bitcode = failed to copy bitcode to object file: {$err} diff --git a/compiler/rustc_codegen_llvm/src/lib.rs b/compiler/rustc_codegen_llvm/src/lib.rs index c41e74c51a0..8dafe1b750b 100644 --- a/compiler/rustc_codegen_llvm/src/lib.rs +++ b/compiler/rustc_codegen_llvm/src/lib.rs @@ -84,7 +84,7 @@ mod type_of; mod va_arg; mod value; -fluent_messages! { "../locales/en-US.ftl" } +fluent_messages! { "../messages.ftl" } #[derive(Clone)] pub struct LlvmCodegenBackend(()); diff --git a/compiler/rustc_codegen_ssa/locales/en-US.ftl b/compiler/rustc_codegen_ssa/locales/en-US.ftl deleted file mode 100644 index 8fe5f8d50ab..00000000000 --- a/compiler/rustc_codegen_ssa/locales/en-US.ftl +++ /dev/null @@ -1,293 +0,0 @@ -codegen_ssa_lib_def_write_failure = failed to write lib.def file: {$error} - -codegen_ssa_version_script_write_failure = failed to write version script: {$error} - -codegen_ssa_symbol_file_write_failure = failed to write symbols file: {$error} - -codegen_ssa_ld64_unimplemented_modifier = `as-needed` modifier not implemented yet for ld64 - -codegen_ssa_linker_unsupported_modifier = `as-needed` modifier not supported for current linker - -codegen_ssa_L4Bender_exporting_symbols_unimplemented = exporting symbols not implemented yet for L4Bender - -codegen_ssa_no_natvis_directory = error enumerating natvis directory: {$error} - -codegen_ssa_copy_path = could not copy {$from} to {$to}: {$error} - -codegen_ssa_copy_path_buf = unable to copy {$source_file} to {$output_path}: {$error} - -codegen_ssa_ignoring_emit_path = ignoring emit path because multiple .{$extension} files were produced - -codegen_ssa_ignoring_output = ignoring -o because multiple .{$extension} files were produced - -codegen_ssa_create_temp_dir = couldn't create a temp dir: {$error} - -codegen_ssa_incompatible_linking_modifiers = link modifiers combination `+bundle,+whole-archive` is unstable when generating rlibs - -codegen_ssa_add_native_library = failed to add native library {$library_path}: {$error} - -codegen_ssa_multiple_external_func_decl = multiple declarations of external function `{$function}` from library `{$library_name}` have different calling conventions - -codegen_ssa_rlib_missing_format = could not find formats for rlibs - -codegen_ssa_rlib_only_rmeta_found = could not find rlib for: `{$crate_name}`, found rmeta (metadata) file - -codegen_ssa_rlib_not_found = could not find rlib for: `{$crate_name}` - -codegen_ssa_rlib_incompatible_dependency_formats = `{$ty1}` and `{$ty2}` do not have equivalent dependency formats (`{$list1}` vs `{$list2}`) - -codegen_ssa_linking_failed = linking with `{$linker_path}` failed: {$exit_status} - -codegen_ssa_extern_funcs_not_found = some `extern` functions couldn't be found; some native libraries may need to be installed or have their path specified - -codegen_ssa_specify_libraries_to_link = use the `-l` flag to specify native libraries to link - -codegen_ssa_use_cargo_directive = use the `cargo:rustc-link-lib` directive to specify the native libraries to link with Cargo (see https://doc.rust-lang.org/cargo/reference/build-scripts.html#cargorustc-link-libkindname) - -codegen_ssa_thorin_read_input_failure = failed to read input file - -codegen_ssa_thorin_parse_input_file_kind = failed to parse input file kind - -codegen_ssa_thorin_parse_input_object_file = failed to parse input object file - -codegen_ssa_thorin_parse_input_archive_file = failed to parse input archive file - -codegen_ssa_thorin_parse_archive_member = failed to parse archive member - -codegen_ssa_thorin_invalid_input_kind = input is not an archive or elf object - -codegen_ssa_thorin_decompress_data = failed to decompress compressed section - -codegen_ssa_thorin_section_without_name = section without name at offset {$offset} - -codegen_ssa_thorin_relocation_with_invalid_symbol = relocation with invalid symbol for section `{$section}` at offset {$offset} - -codegen_ssa_thorin_multiple_relocations = multiple relocations for section `{$section}` at offset {$offset} - -codegen_ssa_thorin_unsupported_relocation = unsupported relocation for section {$section} at offset {$offset} - -codegen_ssa_thorin_missing_dwo_name = missing path attribute to DWARF object ({$id}) - -codegen_ssa_thorin_no_compilation_units = input object has no compilation units - -codegen_ssa_thorin_no_die = no top-level debugging information entry in compilation/type unit - -codegen_ssa_thorin_top_level_die_not_unit = top-level debugging information entry is not a compilation/type unit - -codegen_ssa_thorin_missing_required_section = input object missing required section `{$section}` - -codegen_ssa_thorin_parse_unit_abbreviations = failed to parse unit abbreviations - -codegen_ssa_thorin_parse_unit_attribute = failed to parse unit attribute - -codegen_ssa_thorin_parse_unit_header = failed to parse unit header - -codegen_ssa_thorin_parse_unit = failed to parse unit - -codegen_ssa_thorin_incompatible_index_version = incompatible `{$section}` index version: found version {$actual}, expected version {$format} - -codegen_ssa_thorin_offset_at_index = read offset at index {$index} of `.debug_str_offsets.dwo` section - -codegen_ssa_thorin_str_at_offset = read string at offset {$offset} of `.debug_str.dwo` section - -codegen_ssa_thorin_parse_index = failed to parse `{$section}` index section - -codegen_ssa_thorin_unit_not_in_index = unit {$unit} from input package is not in its index - -codegen_ssa_thorin_row_not_in_index = row {$row} found in index's hash table not present in index - -codegen_ssa_thorin_section_not_in_row = section not found in unit's row in index - -codegen_ssa_thorin_empty_unit = unit {$unit} in input DWARF object with no data - -codegen_ssa_thorin_multiple_debug_info_section = multiple `.debug_info.dwo` sections - -codegen_ssa_thorin_multiple_debug_types_section = multiple `.debug_types.dwo` sections in a package - -codegen_ssa_thorin_not_split_unit = regular compilation unit in object (missing dwo identifier) - -codegen_ssa_thorin_duplicate_unit = duplicate split compilation unit ({$unit}) - -codegen_ssa_thorin_missing_referenced_unit = unit {$unit} referenced by executable was not found - -codegen_ssa_thorin_not_output_object_created = no output object was created from inputs - -codegen_ssa_thorin_mixed_input_encodings = input objects haved mixed encodings - -codegen_ssa_thorin_io = {$error} -codegen_ssa_thorin_object_read = {$error} -codegen_ssa_thorin_object_write = {$error} -codegen_ssa_thorin_gimli_read = {$error} -codegen_ssa_thorin_gimli_write = {$error} - -codegen_ssa_link_exe_unexpected_error = `link.exe` returned an unexpected error - -codegen_ssa_repair_vs_build_tools = the Visual Studio build tools may need to be repaired using the Visual Studio installer - -codegen_ssa_missing_cpp_build_tool_component = or a necessary component may be missing from the "C++ build tools" workload - -codegen_ssa_select_cpp_build_tool_workload = in the Visual Studio installer, ensure the "C++ build tools" workload is selected - -codegen_ssa_visual_studio_not_installed = you may need to install Visual Studio build tools with the "C++ build tools" workload - -codegen_ssa_linker_not_found = linker `{$linker_path}` not found - .note = {$error} - -codegen_ssa_unable_to_exe_linker = could not exec the linker `{$linker_path}` - .note = {$error} - .command_note = {$command_formatted} - -codegen_ssa_msvc_missing_linker = the msvc targets depend on the msvc linker but `link.exe` was not found - -codegen_ssa_check_installed_visual_studio = please ensure that Visual Studio 2017 or later, or Build Tools for Visual Studio were installed with the Visual C++ option. - -codegen_ssa_unsufficient_vs_code_product = VS Code is a different product, and is not sufficient. - -codegen_ssa_processing_dymutil_failed = processing debug info with `dsymutil` failed: {$status} - .note = {$output} - -codegen_ssa_unable_to_run_dsymutil = unable to run `dsymutil`: {$error} - -codegen_ssa_stripping_debu_info_failed = stripping debug info with `{$util}` failed: {$status} - .note = {$output} - -codegen_ssa_unable_to_run = unable to run `{$util}`: {$error} - -codegen_ssa_linker_file_stem = couldn't extract file stem from specified linker - -codegen_ssa_static_library_native_artifacts = Link against the following native artifacts when linking against this static library. The order and any duplication can be significant on some platforms. - -codegen_ssa_link_script_unavailable = can only use link script when linking with GNU-like linker - -codegen_ssa_link_script_write_failure = failed to write link script to {$path}: {$error} - -codegen_ssa_failed_to_write = failed to write {$path}: {$error} - -codegen_ssa_unable_to_write_debugger_visualizer = Unable to write debugger visualizer file `{$path}`: {$error} - -codegen_ssa_rlib_archive_build_failure = failed to build archive from rlib: {$error} - -codegen_ssa_option_gcc_only = option `-Z gcc-ld` is used even though linker flavor is not gcc - -codegen_ssa_extract_bundled_libs_open_file = failed to open file '{$rlib}': {$error} -codegen_ssa_extract_bundled_libs_mmap_file = failed to mmap file '{$rlib}': {$error} -codegen_ssa_extract_bundled_libs_parse_archive = failed to parse archive '{$rlib}': {$error} -codegen_ssa_extract_bundled_libs_read_entry = failed to read entry '{$rlib}': {$error} -codegen_ssa_extract_bundled_libs_archive_member = failed to get data from archive member '{$rlib}': {$error} -codegen_ssa_extract_bundled_libs_convert_name = failed to convert name '{$rlib}': {$error} -codegen_ssa_extract_bundled_libs_write_file = failed to write file '{$rlib}': {$error} - -codegen_ssa_unsupported_arch = unsupported arch `{$arch}` for os `{$os}` - -codegen_ssa_apple_sdk_error_sdk_path = failed to get {$sdk_name} SDK path: {$error} - -codegen_ssa_read_file = failed to read file: {$message} - -codegen_ssa_unsupported_link_self_contained = option `-C link-self-contained` is not supported on this target - -codegen_ssa_archive_build_failure = - failed to build archive: {$error} - -codegen_ssa_unknown_archive_kind = - Don't know how to build archive of type: {$kind} - -codegen_ssa_expected_used_symbol = expected `used`, `used(compiler)` or `used(linker)` - -codegen_ssa_multiple_main_functions = entry symbol `main` declared multiple times - .help = did you use `#[no_mangle]` on `fn main`? Use `#[start]` instead - -codegen_ssa_metadata_object_file_write = error writing metadata object file: {$error} - -codegen_ssa_invalid_windows_subsystem = invalid windows subsystem `{$subsystem}`, only `windows` and `console` are allowed - -codegen_ssa_erroneous_constant = erroneous constant encountered - -codegen_ssa_shuffle_indices_evaluation = could not evaluate shuffle_indices at compile time - -codegen_ssa_missing_memory_ordering = Atomic intrinsic missing memory ordering - -codegen_ssa_unknown_atomic_ordering = unknown ordering in atomic intrinsic - -codegen_ssa_atomic_compare_exchange = Atomic compare-exchange intrinsic missing failure memory ordering - -codegen_ssa_unknown_atomic_operation = unknown atomic operation - -codegen_ssa_invalid_monomorphization_basic_integer_type = invalid monomorphization of `{$name}` intrinsic: expected basic integer type, found `{$ty}` - -codegen_ssa_invalid_monomorphization_basic_float_type = invalid monomorphization of `{$name}` intrinsic: expected basic float type, found `{$ty}` - -codegen_ssa_invalid_monomorphization_float_to_int_unchecked = invalid monomorphization of `float_to_int_unchecked` intrinsic: expected basic float type, found `{$ty}` - -codegen_ssa_invalid_monomorphization_floating_point_vector = invalid monomorphization of `{$name}` intrinsic: unsupported element type `{$f_ty}` of floating-point vector `{$in_ty}` - -codegen_ssa_invalid_monomorphization_floating_point_type = invalid monomorphization of `{$name}` intrinsic: `{$in_ty}` is not a floating-point type - -codegen_ssa_invalid_monomorphization_unrecognized_intrinsic = invalid monomorphization of `{$name}` intrinsic: unrecognized intrinsic `{$name}` - -codegen_ssa_invalid_monomorphization_simd_argument = invalid monomorphization of `{$name}` intrinsic: expected SIMD argument type, found non-SIMD `{$ty}` - -codegen_ssa_invalid_monomorphization_simd_input = invalid monomorphization of `{$name}` intrinsic: expected SIMD input type, found non-SIMD `{$ty}` - -codegen_ssa_invalid_monomorphization_simd_first = invalid monomorphization of `{$name}` intrinsic: expected SIMD first type, found non-SIMD `{$ty}` - -codegen_ssa_invalid_monomorphization_simd_second = invalid monomorphization of `{$name}` intrinsic: expected SIMD second type, found non-SIMD `{$ty}` - -codegen_ssa_invalid_monomorphization_simd_third = invalid monomorphization of `{$name}` intrinsic: expected SIMD third type, found non-SIMD `{$ty}` - -codegen_ssa_invalid_monomorphization_simd_return = invalid monomorphization of `{$name}` intrinsic: expected SIMD return type, found non-SIMD `{$ty}` - -codegen_ssa_invalid_monomorphization_invalid_bitmask = invalid monomorphization of `{$name}` intrinsic: invalid bitmask `{$mask_ty}`, expected `u{$expected_int_bits}` or `[u8; {$expected_bytes}]` - -codegen_ssa_polymorphic_constant_too_generic = codegen encountered polymorphic constant: TooGeneric - -codegen_ssa_invalid_monomorphization_return_length_input_type = invalid monomorphization of `{$name}` intrinsic: expected return type with length {$in_len} (same as input type `{$in_ty}`), found `{$ret_ty}` with length {$out_len} - -codegen_ssa_invalid_monomorphization_second_argument_length = invalid monomorphization of `{$name}` intrinsic: expected second argument with length {$in_len} (same as input type `{$in_ty}`), found `{$arg_ty}` with length {$out_len} - -codegen_ssa_invalid_monomorphization_third_argument_length = invalid monomorphization of `{$name}` intrinsic: expected third argument with length {$in_len} (same as input type `{$in_ty}`), found `{$arg_ty}` with length {$out_len} - -codegen_ssa_invalid_monomorphization_return_integer_type = invalid monomorphization of `{$name}` intrinsic: expected return type with integer elements, found `{$ret_ty}` with non-integer `{$out_ty}` - -codegen_ssa_invalid_monomorphization_simd_shuffle = invalid monomorphization of `{$name}` intrinsic: simd_shuffle index must be an array of `u32`, got `{$ty}` - -codegen_ssa_invalid_monomorphization_return_length = invalid monomorphization of `{$name}` intrinsic: expected return type of length {$in_len}, found `{$ret_ty}` with length {$out_len} - -codegen_ssa_invalid_monomorphization_return_element = invalid monomorphization of `{$name}` intrinsic: expected return element type `{$in_elem}` (element of input `{$in_ty}`), found `{$ret_ty}` with element type `{$out_ty}` - -codegen_ssa_invalid_monomorphization_shuffle_index_not_constant = invalid monomorphization of `{$name}` intrinsic: shuffle index #{$arg_idx} is not a constant - -codegen_ssa_invalid_monomorphization_shuffle_index_out_of_bounds = invalid monomorphization of `{$name}` intrinsic: shuffle index #{$arg_idx} is out of bounds (limit {$total_len}) - -codegen_ssa_invalid_monomorphization_inserted_type = invalid monomorphization of `{$name}` intrinsic: expected inserted type `{$in_elem}` (element of input `{$in_ty}`), found `{$out_ty}` - -codegen_ssa_invalid_monomorphization_return_type = invalid monomorphization of `{$name}` intrinsic: expected return type `{$in_elem}` (element of input `{$in_ty}`), found `{$ret_ty}` - -codegen_ssa_invalid_monomorphization_expected_return_type = invalid monomorphization of `{$name}` intrinsic: expected return type `{$in_ty}`, found `{$ret_ty}` - -codegen_ssa_invalid_monomorphization_mismatched_lengths = invalid monomorphization of `{$name}` intrinsic: mismatched lengths: mask length `{$m_len}` != other vector length `{$v_len}` - -codegen_ssa_invalid_monomorphization_mask_type = invalid monomorphization of `{$name}` intrinsic: mask element type is `{$ty}`, expected `i_` - -codegen_ssa_invalid_monomorphization_vector_argument = invalid monomorphization of `{$name}` intrinsic: vector argument `{$in_ty}`'s element type `{$in_elem}`, expected integer element type - -codegen_ssa_invalid_monomorphization_cannot_return = invalid monomorphization of `{$name}` intrinsic: cannot return `{$ret_ty}`, expected `u{$expected_int_bits}` or `[u8; {$expected_bytes}]` - -codegen_ssa_invalid_monomorphization_expected_element_type = invalid monomorphization of `{$name}` intrinsic: expected element type `{$expected_element}` of second argument `{$second_arg}` to be a pointer to the element type `{$in_elem}` of the first argument `{$in_ty}`, found `{$expected_element}` != `{$mutability} {$in_elem}` - -codegen_ssa_invalid_monomorphization_third_arg_element_type = invalid monomorphization of `{$name}` intrinsic: expected element type `{$expected_element}` of third argument `{$third_arg}` to be a signed integer type - -codegen_ssa_invalid_monomorphization_unsupported_symbol_of_size = invalid monomorphization of `{$name}` intrinsic: unsupported {$symbol} from `{$in_ty}` with element `{$in_elem}` of size `{$size}` to `{$ret_ty}` - -codegen_ssa_invalid_monomorphization_unsupported_symbol = invalid monomorphization of `{$name}` intrinsic: unsupported {$symbol} from `{$in_ty}` with element `{$in_elem}` to `{$ret_ty}` - -codegen_ssa_invalid_monomorphization_cast_fat_pointer = invalid monomorphization of `{$name}` intrinsic: cannot cast fat pointer `{$ty}` - -codegen_ssa_invalid_monomorphization_expected_pointer = invalid monomorphization of `{$name}` intrinsic: expected pointer, got `{$ty}` - -codegen_ssa_invalid_monomorphization_expected_usize = invalid monomorphization of `{$name}` intrinsic: expected `usize`, got `{$ty}` - -codegen_ssa_invalid_monomorphization_unsupported_cast = invalid monomorphization of `{$name}` intrinsic: unsupported cast from `{$in_ty}` with element `{$in_elem}` to `{$ret_ty}` with element `{$out_elem}` - -codegen_ssa_invalid_monomorphization_unsupported_operation = invalid monomorphization of `{$name}` intrinsic: unsupported operation on `{$in_ty}` with element `{$in_elem}` - -codegen_ssa_invalid_monomorphization_expected_vector_element_type = invalid monomorphization of `{$name}` intrinsic: expected element type `{$expected_element}` of vector type `{$vector_type}` to be a signed or unsigned integer type diff --git a/compiler/rustc_codegen_ssa/messages.ftl b/compiler/rustc_codegen_ssa/messages.ftl new file mode 100644 index 00000000000..8fe5f8d50ab --- /dev/null +++ b/compiler/rustc_codegen_ssa/messages.ftl @@ -0,0 +1,293 @@ +codegen_ssa_lib_def_write_failure = failed to write lib.def file: {$error} + +codegen_ssa_version_script_write_failure = failed to write version script: {$error} + +codegen_ssa_symbol_file_write_failure = failed to write symbols file: {$error} + +codegen_ssa_ld64_unimplemented_modifier = `as-needed` modifier not implemented yet for ld64 + +codegen_ssa_linker_unsupported_modifier = `as-needed` modifier not supported for current linker + +codegen_ssa_L4Bender_exporting_symbols_unimplemented = exporting symbols not implemented yet for L4Bender + +codegen_ssa_no_natvis_directory = error enumerating natvis directory: {$error} + +codegen_ssa_copy_path = could not copy {$from} to {$to}: {$error} + +codegen_ssa_copy_path_buf = unable to copy {$source_file} to {$output_path}: {$error} + +codegen_ssa_ignoring_emit_path = ignoring emit path because multiple .{$extension} files were produced + +codegen_ssa_ignoring_output = ignoring -o because multiple .{$extension} files were produced + +codegen_ssa_create_temp_dir = couldn't create a temp dir: {$error} + +codegen_ssa_incompatible_linking_modifiers = link modifiers combination `+bundle,+whole-archive` is unstable when generating rlibs + +codegen_ssa_add_native_library = failed to add native library {$library_path}: {$error} + +codegen_ssa_multiple_external_func_decl = multiple declarations of external function `{$function}` from library `{$library_name}` have different calling conventions + +codegen_ssa_rlib_missing_format = could not find formats for rlibs + +codegen_ssa_rlib_only_rmeta_found = could not find rlib for: `{$crate_name}`, found rmeta (metadata) file + +codegen_ssa_rlib_not_found = could not find rlib for: `{$crate_name}` + +codegen_ssa_rlib_incompatible_dependency_formats = `{$ty1}` and `{$ty2}` do not have equivalent dependency formats (`{$list1}` vs `{$list2}`) + +codegen_ssa_linking_failed = linking with `{$linker_path}` failed: {$exit_status} + +codegen_ssa_extern_funcs_not_found = some `extern` functions couldn't be found; some native libraries may need to be installed or have their path specified + +codegen_ssa_specify_libraries_to_link = use the `-l` flag to specify native libraries to link + +codegen_ssa_use_cargo_directive = use the `cargo:rustc-link-lib` directive to specify the native libraries to link with Cargo (see https://doc.rust-lang.org/cargo/reference/build-scripts.html#cargorustc-link-libkindname) + +codegen_ssa_thorin_read_input_failure = failed to read input file + +codegen_ssa_thorin_parse_input_file_kind = failed to parse input file kind + +codegen_ssa_thorin_parse_input_object_file = failed to parse input object file + +codegen_ssa_thorin_parse_input_archive_file = failed to parse input archive file + +codegen_ssa_thorin_parse_archive_member = failed to parse archive member + +codegen_ssa_thorin_invalid_input_kind = input is not an archive or elf object + +codegen_ssa_thorin_decompress_data = failed to decompress compressed section + +codegen_ssa_thorin_section_without_name = section without name at offset {$offset} + +codegen_ssa_thorin_relocation_with_invalid_symbol = relocation with invalid symbol for section `{$section}` at offset {$offset} + +codegen_ssa_thorin_multiple_relocations = multiple relocations for section `{$section}` at offset {$offset} + +codegen_ssa_thorin_unsupported_relocation = unsupported relocation for section {$section} at offset {$offset} + +codegen_ssa_thorin_missing_dwo_name = missing path attribute to DWARF object ({$id}) + +codegen_ssa_thorin_no_compilation_units = input object has no compilation units + +codegen_ssa_thorin_no_die = no top-level debugging information entry in compilation/type unit + +codegen_ssa_thorin_top_level_die_not_unit = top-level debugging information entry is not a compilation/type unit + +codegen_ssa_thorin_missing_required_section = input object missing required section `{$section}` + +codegen_ssa_thorin_parse_unit_abbreviations = failed to parse unit abbreviations + +codegen_ssa_thorin_parse_unit_attribute = failed to parse unit attribute + +codegen_ssa_thorin_parse_unit_header = failed to parse unit header + +codegen_ssa_thorin_parse_unit = failed to parse unit + +codegen_ssa_thorin_incompatible_index_version = incompatible `{$section}` index version: found version {$actual}, expected version {$format} + +codegen_ssa_thorin_offset_at_index = read offset at index {$index} of `.debug_str_offsets.dwo` section + +codegen_ssa_thorin_str_at_offset = read string at offset {$offset} of `.debug_str.dwo` section + +codegen_ssa_thorin_parse_index = failed to parse `{$section}` index section + +codegen_ssa_thorin_unit_not_in_index = unit {$unit} from input package is not in its index + +codegen_ssa_thorin_row_not_in_index = row {$row} found in index's hash table not present in index + +codegen_ssa_thorin_section_not_in_row = section not found in unit's row in index + +codegen_ssa_thorin_empty_unit = unit {$unit} in input DWARF object with no data + +codegen_ssa_thorin_multiple_debug_info_section = multiple `.debug_info.dwo` sections + +codegen_ssa_thorin_multiple_debug_types_section = multiple `.debug_types.dwo` sections in a package + +codegen_ssa_thorin_not_split_unit = regular compilation unit in object (missing dwo identifier) + +codegen_ssa_thorin_duplicate_unit = duplicate split compilation unit ({$unit}) + +codegen_ssa_thorin_missing_referenced_unit = unit {$unit} referenced by executable was not found + +codegen_ssa_thorin_not_output_object_created = no output object was created from inputs + +codegen_ssa_thorin_mixed_input_encodings = input objects haved mixed encodings + +codegen_ssa_thorin_io = {$error} +codegen_ssa_thorin_object_read = {$error} +codegen_ssa_thorin_object_write = {$error} +codegen_ssa_thorin_gimli_read = {$error} +codegen_ssa_thorin_gimli_write = {$error} + +codegen_ssa_link_exe_unexpected_error = `link.exe` returned an unexpected error + +codegen_ssa_repair_vs_build_tools = the Visual Studio build tools may need to be repaired using the Visual Studio installer + +codegen_ssa_missing_cpp_build_tool_component = or a necessary component may be missing from the "C++ build tools" workload + +codegen_ssa_select_cpp_build_tool_workload = in the Visual Studio installer, ensure the "C++ build tools" workload is selected + +codegen_ssa_visual_studio_not_installed = you may need to install Visual Studio build tools with the "C++ build tools" workload + +codegen_ssa_linker_not_found = linker `{$linker_path}` not found + .note = {$error} + +codegen_ssa_unable_to_exe_linker = could not exec the linker `{$linker_path}` + .note = {$error} + .command_note = {$command_formatted} + +codegen_ssa_msvc_missing_linker = the msvc targets depend on the msvc linker but `link.exe` was not found + +codegen_ssa_check_installed_visual_studio = please ensure that Visual Studio 2017 or later, or Build Tools for Visual Studio were installed with the Visual C++ option. + +codegen_ssa_unsufficient_vs_code_product = VS Code is a different product, and is not sufficient. + +codegen_ssa_processing_dymutil_failed = processing debug info with `dsymutil` failed: {$status} + .note = {$output} + +codegen_ssa_unable_to_run_dsymutil = unable to run `dsymutil`: {$error} + +codegen_ssa_stripping_debu_info_failed = stripping debug info with `{$util}` failed: {$status} + .note = {$output} + +codegen_ssa_unable_to_run = unable to run `{$util}`: {$error} + +codegen_ssa_linker_file_stem = couldn't extract file stem from specified linker + +codegen_ssa_static_library_native_artifacts = Link against the following native artifacts when linking against this static library. The order and any duplication can be significant on some platforms. + +codegen_ssa_link_script_unavailable = can only use link script when linking with GNU-like linker + +codegen_ssa_link_script_write_failure = failed to write link script to {$path}: {$error} + +codegen_ssa_failed_to_write = failed to write {$path}: {$error} + +codegen_ssa_unable_to_write_debugger_visualizer = Unable to write debugger visualizer file `{$path}`: {$error} + +codegen_ssa_rlib_archive_build_failure = failed to build archive from rlib: {$error} + +codegen_ssa_option_gcc_only = option `-Z gcc-ld` is used even though linker flavor is not gcc + +codegen_ssa_extract_bundled_libs_open_file = failed to open file '{$rlib}': {$error} +codegen_ssa_extract_bundled_libs_mmap_file = failed to mmap file '{$rlib}': {$error} +codegen_ssa_extract_bundled_libs_parse_archive = failed to parse archive '{$rlib}': {$error} +codegen_ssa_extract_bundled_libs_read_entry = failed to read entry '{$rlib}': {$error} +codegen_ssa_extract_bundled_libs_archive_member = failed to get data from archive member '{$rlib}': {$error} +codegen_ssa_extract_bundled_libs_convert_name = failed to convert name '{$rlib}': {$error} +codegen_ssa_extract_bundled_libs_write_file = failed to write file '{$rlib}': {$error} + +codegen_ssa_unsupported_arch = unsupported arch `{$arch}` for os `{$os}` + +codegen_ssa_apple_sdk_error_sdk_path = failed to get {$sdk_name} SDK path: {$error} + +codegen_ssa_read_file = failed to read file: {$message} + +codegen_ssa_unsupported_link_self_contained = option `-C link-self-contained` is not supported on this target + +codegen_ssa_archive_build_failure = + failed to build archive: {$error} + +codegen_ssa_unknown_archive_kind = + Don't know how to build archive of type: {$kind} + +codegen_ssa_expected_used_symbol = expected `used`, `used(compiler)` or `used(linker)` + +codegen_ssa_multiple_main_functions = entry symbol `main` declared multiple times + .help = did you use `#[no_mangle]` on `fn main`? Use `#[start]` instead + +codegen_ssa_metadata_object_file_write = error writing metadata object file: {$error} + +codegen_ssa_invalid_windows_subsystem = invalid windows subsystem `{$subsystem}`, only `windows` and `console` are allowed + +codegen_ssa_erroneous_constant = erroneous constant encountered + +codegen_ssa_shuffle_indices_evaluation = could not evaluate shuffle_indices at compile time + +codegen_ssa_missing_memory_ordering = Atomic intrinsic missing memory ordering + +codegen_ssa_unknown_atomic_ordering = unknown ordering in atomic intrinsic + +codegen_ssa_atomic_compare_exchange = Atomic compare-exchange intrinsic missing failure memory ordering + +codegen_ssa_unknown_atomic_operation = unknown atomic operation + +codegen_ssa_invalid_monomorphization_basic_integer_type = invalid monomorphization of `{$name}` intrinsic: expected basic integer type, found `{$ty}` + +codegen_ssa_invalid_monomorphization_basic_float_type = invalid monomorphization of `{$name}` intrinsic: expected basic float type, found `{$ty}` + +codegen_ssa_invalid_monomorphization_float_to_int_unchecked = invalid monomorphization of `float_to_int_unchecked` intrinsic: expected basic float type, found `{$ty}` + +codegen_ssa_invalid_monomorphization_floating_point_vector = invalid monomorphization of `{$name}` intrinsic: unsupported element type `{$f_ty}` of floating-point vector `{$in_ty}` + +codegen_ssa_invalid_monomorphization_floating_point_type = invalid monomorphization of `{$name}` intrinsic: `{$in_ty}` is not a floating-point type + +codegen_ssa_invalid_monomorphization_unrecognized_intrinsic = invalid monomorphization of `{$name}` intrinsic: unrecognized intrinsic `{$name}` + +codegen_ssa_invalid_monomorphization_simd_argument = invalid monomorphization of `{$name}` intrinsic: expected SIMD argument type, found non-SIMD `{$ty}` + +codegen_ssa_invalid_monomorphization_simd_input = invalid monomorphization of `{$name}` intrinsic: expected SIMD input type, found non-SIMD `{$ty}` + +codegen_ssa_invalid_monomorphization_simd_first = invalid monomorphization of `{$name}` intrinsic: expected SIMD first type, found non-SIMD `{$ty}` + +codegen_ssa_invalid_monomorphization_simd_second = invalid monomorphization of `{$name}` intrinsic: expected SIMD second type, found non-SIMD `{$ty}` + +codegen_ssa_invalid_monomorphization_simd_third = invalid monomorphization of `{$name}` intrinsic: expected SIMD third type, found non-SIMD `{$ty}` + +codegen_ssa_invalid_monomorphization_simd_return = invalid monomorphization of `{$name}` intrinsic: expected SIMD return type, found non-SIMD `{$ty}` + +codegen_ssa_invalid_monomorphization_invalid_bitmask = invalid monomorphization of `{$name}` intrinsic: invalid bitmask `{$mask_ty}`, expected `u{$expected_int_bits}` or `[u8; {$expected_bytes}]` + +codegen_ssa_polymorphic_constant_too_generic = codegen encountered polymorphic constant: TooGeneric + +codegen_ssa_invalid_monomorphization_return_length_input_type = invalid monomorphization of `{$name}` intrinsic: expected return type with length {$in_len} (same as input type `{$in_ty}`), found `{$ret_ty}` with length {$out_len} + +codegen_ssa_invalid_monomorphization_second_argument_length = invalid monomorphization of `{$name}` intrinsic: expected second argument with length {$in_len} (same as input type `{$in_ty}`), found `{$arg_ty}` with length {$out_len} + +codegen_ssa_invalid_monomorphization_third_argument_length = invalid monomorphization of `{$name}` intrinsic: expected third argument with length {$in_len} (same as input type `{$in_ty}`), found `{$arg_ty}` with length {$out_len} + +codegen_ssa_invalid_monomorphization_return_integer_type = invalid monomorphization of `{$name}` intrinsic: expected return type with integer elements, found `{$ret_ty}` with non-integer `{$out_ty}` + +codegen_ssa_invalid_monomorphization_simd_shuffle = invalid monomorphization of `{$name}` intrinsic: simd_shuffle index must be an array of `u32`, got `{$ty}` + +codegen_ssa_invalid_monomorphization_return_length = invalid monomorphization of `{$name}` intrinsic: expected return type of length {$in_len}, found `{$ret_ty}` with length {$out_len} + +codegen_ssa_invalid_monomorphization_return_element = invalid monomorphization of `{$name}` intrinsic: expected return element type `{$in_elem}` (element of input `{$in_ty}`), found `{$ret_ty}` with element type `{$out_ty}` + +codegen_ssa_invalid_monomorphization_shuffle_index_not_constant = invalid monomorphization of `{$name}` intrinsic: shuffle index #{$arg_idx} is not a constant + +codegen_ssa_invalid_monomorphization_shuffle_index_out_of_bounds = invalid monomorphization of `{$name}` intrinsic: shuffle index #{$arg_idx} is out of bounds (limit {$total_len}) + +codegen_ssa_invalid_monomorphization_inserted_type = invalid monomorphization of `{$name}` intrinsic: expected inserted type `{$in_elem}` (element of input `{$in_ty}`), found `{$out_ty}` + +codegen_ssa_invalid_monomorphization_return_type = invalid monomorphization of `{$name}` intrinsic: expected return type `{$in_elem}` (element of input `{$in_ty}`), found `{$ret_ty}` + +codegen_ssa_invalid_monomorphization_expected_return_type = invalid monomorphization of `{$name}` intrinsic: expected return type `{$in_ty}`, found `{$ret_ty}` + +codegen_ssa_invalid_monomorphization_mismatched_lengths = invalid monomorphization of `{$name}` intrinsic: mismatched lengths: mask length `{$m_len}` != other vector length `{$v_len}` + +codegen_ssa_invalid_monomorphization_mask_type = invalid monomorphization of `{$name}` intrinsic: mask element type is `{$ty}`, expected `i_` + +codegen_ssa_invalid_monomorphization_vector_argument = invalid monomorphization of `{$name}` intrinsic: vector argument `{$in_ty}`'s element type `{$in_elem}`, expected integer element type + +codegen_ssa_invalid_monomorphization_cannot_return = invalid monomorphization of `{$name}` intrinsic: cannot return `{$ret_ty}`, expected `u{$expected_int_bits}` or `[u8; {$expected_bytes}]` + +codegen_ssa_invalid_monomorphization_expected_element_type = invalid monomorphization of `{$name}` intrinsic: expected element type `{$expected_element}` of second argument `{$second_arg}` to be a pointer to the element type `{$in_elem}` of the first argument `{$in_ty}`, found `{$expected_element}` != `{$mutability} {$in_elem}` + +codegen_ssa_invalid_monomorphization_third_arg_element_type = invalid monomorphization of `{$name}` intrinsic: expected element type `{$expected_element}` of third argument `{$third_arg}` to be a signed integer type + +codegen_ssa_invalid_monomorphization_unsupported_symbol_of_size = invalid monomorphization of `{$name}` intrinsic: unsupported {$symbol} from `{$in_ty}` with element `{$in_elem}` of size `{$size}` to `{$ret_ty}` + +codegen_ssa_invalid_monomorphization_unsupported_symbol = invalid monomorphization of `{$name}` intrinsic: unsupported {$symbol} from `{$in_ty}` with element `{$in_elem}` to `{$ret_ty}` + +codegen_ssa_invalid_monomorphization_cast_fat_pointer = invalid monomorphization of `{$name}` intrinsic: cannot cast fat pointer `{$ty}` + +codegen_ssa_invalid_monomorphization_expected_pointer = invalid monomorphization of `{$name}` intrinsic: expected pointer, got `{$ty}` + +codegen_ssa_invalid_monomorphization_expected_usize = invalid monomorphization of `{$name}` intrinsic: expected `usize`, got `{$ty}` + +codegen_ssa_invalid_monomorphization_unsupported_cast = invalid monomorphization of `{$name}` intrinsic: unsupported cast from `{$in_ty}` with element `{$in_elem}` to `{$ret_ty}` with element `{$out_elem}` + +codegen_ssa_invalid_monomorphization_unsupported_operation = invalid monomorphization of `{$name}` intrinsic: unsupported operation on `{$in_ty}` with element `{$in_elem}` + +codegen_ssa_invalid_monomorphization_expected_vector_element_type = invalid monomorphization of `{$name}` intrinsic: expected element type `{$expected_element}` of vector type `{$vector_type}` to be a signed or unsigned integer type diff --git a/compiler/rustc_codegen_ssa/src/lib.rs b/compiler/rustc_codegen_ssa/src/lib.rs index ebe9e50ffe6..8e721a84eaf 100644 --- a/compiler/rustc_codegen_ssa/src/lib.rs +++ b/compiler/rustc_codegen_ssa/src/lib.rs @@ -56,7 +56,7 @@ pub mod mono_item; pub mod target_features; pub mod traits; -fluent_messages! { "../locales/en-US.ftl" } +fluent_messages! { "../messages.ftl" } pub struct ModuleCodegen { /// The name of the module. When the crate may be saved between diff --git a/compiler/rustc_const_eval/locales/en-US.ftl b/compiler/rustc_const_eval/locales/en-US.ftl deleted file mode 100644 index 33bb116d6fa..00000000000 --- a/compiler/rustc_const_eval/locales/en-US.ftl +++ /dev/null @@ -1,83 +0,0 @@ -const_eval_unstable_in_stable = - const-stable function cannot use `#[feature({$gate})]` - .unstable_sugg = if it is not part of the public API, make this function unstably const - .bypass_sugg = otherwise `#[rustc_allow_const_fn_unstable]` can be used to bypass stability checks - -const_eval_thread_local_access = - thread-local statics cannot be accessed at compile-time - -const_eval_static_access = - {$kind}s cannot refer to statics - .help = consider extracting the value of the `static` to a `const`, and referring to that - .teach_note = `static` and `const` variables can refer to other `const` variables. A `const` variable, however, cannot refer to a `static` variable. - .teach_help = To fix this, the value can be extracted to a `const` and then used. - -const_eval_raw_ptr_to_int = - pointers cannot be cast to integers during const eval - .note = at compile-time, pointers do not have an integer value - .note2 = avoiding this restriction via `transmute`, `union`, or raw pointers leads to compile-time undefined behavior - -const_eval_raw_ptr_comparison = - pointers cannot be reliably compared during const eval - .note = see issue #53020 for more information - -const_eval_panic_non_str = argument to `panic!()` in a const context must have type `&str` - -const_eval_mut_deref = - mutation through a reference is not allowed in {$kind}s - -const_eval_transient_mut_borrow = mutable references are not allowed in {$kind}s - -const_eval_transient_mut_borrow_raw = raw mutable references are not allowed in {$kind}s - -const_eval_max_num_nodes_in_const = maximum number of nodes exceeded in constant {$global_const_id} - -const_eval_unallowed_fn_pointer_call = function pointer calls are not allowed in {$kind}s - -const_eval_unstable_const_fn = `{$def_path}` is not yet stable as a const fn - -const_eval_unallowed_mutable_refs = - mutable references are not allowed in the final value of {$kind}s - .teach_note = - References in statics and constants may only refer to immutable values.\n\n - Statics are shared everywhere, and if they refer to mutable data one might violate memory - safety since holding multiple mutable references to shared data is not allowed.\n\n - If you really want global mutable state, try using static mut or a global UnsafeCell. - -const_eval_unallowed_mutable_refs_raw = - raw mutable references are not allowed in the final value of {$kind}s - .teach_note = - References in statics and constants may only refer to immutable values.\n\n - Statics are shared everywhere, and if they refer to mutable data one might violate memory - safety since holding multiple mutable references to shared data is not allowed.\n\n - If you really want global mutable state, try using static mut or a global UnsafeCell. - -const_eval_non_const_fmt_macro_call = - cannot call non-const formatting macro in {$kind}s - -const_eval_non_const_fn_call = - cannot call non-const fn `{$def_path_str}` in {$kind}s - -const_eval_unallowed_op_in_const_context = - {$msg} - -const_eval_unallowed_heap_allocations = - allocations are not allowed in {$kind}s - .label = allocation not allowed in {$kind}s - .teach_note = - The value of statics and constants must be known at compile time, and they live for the entire lifetime of a program. Creating a boxed value allocates memory on the heap at runtime, and therefore cannot be done at compile time. - -const_eval_unallowed_inline_asm = - inline assembly is not allowed in {$kind}s - -const_eval_interior_mutable_data_refer = - {$kind}s cannot refer to interior mutable data - .label = this borrow of an interior mutable value may end up in the final value - .help = to fix this, the value can be extracted to a separate `static` item and then referenced - .teach_note = - A constant containing interior mutable data behind a reference can allow you to modify that data. - This would make multiple uses of a constant to be able to see different values and allow circumventing - the `Send` and `Sync` requirements for shared mutable data, which is unsound. - -const_eval_interior_mutability_borrow = - cannot borrow here, since the borrowed element may contain interior mutability diff --git a/compiler/rustc_const_eval/messages.ftl b/compiler/rustc_const_eval/messages.ftl new file mode 100644 index 00000000000..33bb116d6fa --- /dev/null +++ b/compiler/rustc_const_eval/messages.ftl @@ -0,0 +1,83 @@ +const_eval_unstable_in_stable = + const-stable function cannot use `#[feature({$gate})]` + .unstable_sugg = if it is not part of the public API, make this function unstably const + .bypass_sugg = otherwise `#[rustc_allow_const_fn_unstable]` can be used to bypass stability checks + +const_eval_thread_local_access = + thread-local statics cannot be accessed at compile-time + +const_eval_static_access = + {$kind}s cannot refer to statics + .help = consider extracting the value of the `static` to a `const`, and referring to that + .teach_note = `static` and `const` variables can refer to other `const` variables. A `const` variable, however, cannot refer to a `static` variable. + .teach_help = To fix this, the value can be extracted to a `const` and then used. + +const_eval_raw_ptr_to_int = + pointers cannot be cast to integers during const eval + .note = at compile-time, pointers do not have an integer value + .note2 = avoiding this restriction via `transmute`, `union`, or raw pointers leads to compile-time undefined behavior + +const_eval_raw_ptr_comparison = + pointers cannot be reliably compared during const eval + .note = see issue #53020 for more information + +const_eval_panic_non_str = argument to `panic!()` in a const context must have type `&str` + +const_eval_mut_deref = + mutation through a reference is not allowed in {$kind}s + +const_eval_transient_mut_borrow = mutable references are not allowed in {$kind}s + +const_eval_transient_mut_borrow_raw = raw mutable references are not allowed in {$kind}s + +const_eval_max_num_nodes_in_const = maximum number of nodes exceeded in constant {$global_const_id} + +const_eval_unallowed_fn_pointer_call = function pointer calls are not allowed in {$kind}s + +const_eval_unstable_const_fn = `{$def_path}` is not yet stable as a const fn + +const_eval_unallowed_mutable_refs = + mutable references are not allowed in the final value of {$kind}s + .teach_note = + References in statics and constants may only refer to immutable values.\n\n + Statics are shared everywhere, and if they refer to mutable data one might violate memory + safety since holding multiple mutable references to shared data is not allowed.\n\n + If you really want global mutable state, try using static mut or a global UnsafeCell. + +const_eval_unallowed_mutable_refs_raw = + raw mutable references are not allowed in the final value of {$kind}s + .teach_note = + References in statics and constants may only refer to immutable values.\n\n + Statics are shared everywhere, and if they refer to mutable data one might violate memory + safety since holding multiple mutable references to shared data is not allowed.\n\n + If you really want global mutable state, try using static mut or a global UnsafeCell. + +const_eval_non_const_fmt_macro_call = + cannot call non-const formatting macro in {$kind}s + +const_eval_non_const_fn_call = + cannot call non-const fn `{$def_path_str}` in {$kind}s + +const_eval_unallowed_op_in_const_context = + {$msg} + +const_eval_unallowed_heap_allocations = + allocations are not allowed in {$kind}s + .label = allocation not allowed in {$kind}s + .teach_note = + The value of statics and constants must be known at compile time, and they live for the entire lifetime of a program. Creating a boxed value allocates memory on the heap at runtime, and therefore cannot be done at compile time. + +const_eval_unallowed_inline_asm = + inline assembly is not allowed in {$kind}s + +const_eval_interior_mutable_data_refer = + {$kind}s cannot refer to interior mutable data + .label = this borrow of an interior mutable value may end up in the final value + .help = to fix this, the value can be extracted to a separate `static` item and then referenced + .teach_note = + A constant containing interior mutable data behind a reference can allow you to modify that data. + This would make multiple uses of a constant to be able to see different values and allow circumventing + the `Send` and `Sync` requirements for shared mutable data, which is unsound. + +const_eval_interior_mutability_borrow = + cannot borrow here, since the borrowed element may contain interior mutability diff --git a/compiler/rustc_const_eval/src/lib.rs b/compiler/rustc_const_eval/src/lib.rs index ed9efe568fb..16b83af91ac 100644 --- a/compiler/rustc_const_eval/src/lib.rs +++ b/compiler/rustc_const_eval/src/lib.rs @@ -39,7 +39,7 @@ use rustc_macros::fluent_messages; use rustc_middle::ty; use rustc_middle::ty::query::Providers; -fluent_messages! { "../locales/en-US.ftl" } +fluent_messages! { "../messages.ftl" } pub fn provide(providers: &mut Providers) { const_eval::provide(providers); diff --git a/compiler/rustc_driver_impl/locales/en-US.ftl b/compiler/rustc_driver_impl/locales/en-US.ftl deleted file mode 100644 index f19b1ff6426..00000000000 --- a/compiler/rustc_driver_impl/locales/en-US.ftl +++ /dev/null @@ -1,19 +0,0 @@ -driver_impl_rlink_unable_to_read = failed to read rlink file: `{$err}` - -driver_impl_rlink_wrong_file_type = The input does not look like a .rlink file - -driver_impl_rlink_empty_version_number = The input does not contain version number - -driver_impl_rlink_encoding_version_mismatch = .rlink file was produced with encoding version `{$version_array}`, but the current version is `{$rlink_version}` - -driver_impl_rlink_rustc_version_mismatch = .rlink file was produced by rustc version `{$rustc_version}`, but the current version is `{$current_version}` - -driver_impl_rlink_no_a_file = rlink must be a file - -driver_impl_unpretty_dump_fail = pretty-print failed to write `{$path}` due to error `{$err}` - -driver_impl_ice = the compiler unexpectedly panicked. this is a bug. -driver_impl_ice_bug_report = we would appreciate a bug report: {$bug_report_url} -driver_impl_ice_version = rustc {$version} running on {$triple} -driver_impl_ice_flags = compiler flags: {$flags} -driver_impl_ice_exclude_cargo_defaults = some of the compiler flags provided by cargo are hidden diff --git a/compiler/rustc_driver_impl/messages.ftl b/compiler/rustc_driver_impl/messages.ftl new file mode 100644 index 00000000000..f19b1ff6426 --- /dev/null +++ b/compiler/rustc_driver_impl/messages.ftl @@ -0,0 +1,19 @@ +driver_impl_rlink_unable_to_read = failed to read rlink file: `{$err}` + +driver_impl_rlink_wrong_file_type = The input does not look like a .rlink file + +driver_impl_rlink_empty_version_number = The input does not contain version number + +driver_impl_rlink_encoding_version_mismatch = .rlink file was produced with encoding version `{$version_array}`, but the current version is `{$rlink_version}` + +driver_impl_rlink_rustc_version_mismatch = .rlink file was produced by rustc version `{$rustc_version}`, but the current version is `{$current_version}` + +driver_impl_rlink_no_a_file = rlink must be a file + +driver_impl_unpretty_dump_fail = pretty-print failed to write `{$path}` due to error `{$err}` + +driver_impl_ice = the compiler unexpectedly panicked. this is a bug. +driver_impl_ice_bug_report = we would appreciate a bug report: {$bug_report_url} +driver_impl_ice_version = rustc {$version} running on {$triple} +driver_impl_ice_flags = compiler flags: {$flags} +driver_impl_ice_exclude_cargo_defaults = some of the compiler flags provided by cargo are hidden diff --git a/compiler/rustc_driver_impl/src/lib.rs b/compiler/rustc_driver_impl/src/lib.rs index e321a9847ba..555917c8b5e 100644 --- a/compiler/rustc_driver_impl/src/lib.rs +++ b/compiler/rustc_driver_impl/src/lib.rs @@ -64,7 +64,7 @@ use crate::session_diagnostics::{ RLinkWrongFileType, RlinkNotAFile, RlinkUnableToRead, }; -fluent_messages! { "../locales/en-US.ftl" } +fluent_messages! { "../messages.ftl" } pub static DEFAULT_LOCALE_RESOURCES: &[&str] = &[ // tidy-alphabetical-start diff --git a/compiler/rustc_error_messages/locales/en-US.ftl b/compiler/rustc_error_messages/locales/en-US.ftl deleted file mode 100644 index e6292374448..00000000000 --- a/compiler/rustc_error_messages/locales/en-US.ftl +++ /dev/null @@ -1 +0,0 @@ -# satisfy tidy lint by having a line in this file diff --git a/compiler/rustc_error_messages/messages.ftl b/compiler/rustc_error_messages/messages.ftl new file mode 100644 index 00000000000..e6292374448 --- /dev/null +++ b/compiler/rustc_error_messages/messages.ftl @@ -0,0 +1 @@ +# satisfy tidy lint by having a line in this file diff --git a/compiler/rustc_error_messages/src/lib.rs b/compiler/rustc_error_messages/src/lib.rs index 010e5f060bf..301dacc2824 100644 --- a/compiler/rustc_error_messages/src/lib.rs +++ b/compiler/rustc_error_messages/src/lib.rs @@ -34,7 +34,7 @@ use intl_memoizer::IntlLangMemoizer; pub use fluent_bundle::{self, types::FluentType, FluentArgs, FluentError, FluentValue}; pub use unic_langid::{langid, LanguageIdentifier}; -fluent_messages! { "../locales/en-US.ftl" } +fluent_messages! { "../messages.ftl" } pub type FluentBundle = fluent_bundle::bundle::FluentBundle; diff --git a/compiler/rustc_errors/locales/en-US.ftl b/compiler/rustc_errors/locales/en-US.ftl deleted file mode 100644 index dde1d6c0a81..00000000000 --- a/compiler/rustc_errors/locales/en-US.ftl +++ /dev/null @@ -1,19 +0,0 @@ -errors_target_invalid_address_space = - invalid address space `{$addr_space}` for `{$cause}` in "data-layout": {$err} - -errors_target_invalid_bits = - invalid {$kind} `{$bit}` for `{$cause}` in "data-layout": {$err} - -errors_target_missing_alignment = - missing alignment for `{$cause}` in "data-layout" - -errors_target_invalid_alignment = - invalid alignment for `{$cause}` in "data-layout": {$err} - -errors_target_inconsistent_architecture = - inconsistent target specification: "data-layout" claims architecture is {$dl}-endian, while "target-endian" is `{$target}` - -errors_target_inconsistent_pointer_width = - inconsistent target specification: "data-layout" claims pointers are {$pointer_size}-bit, while "target-pointer-width" is `{$target}` - -errors_target_invalid_bits_size = {$err} diff --git a/compiler/rustc_errors/messages.ftl b/compiler/rustc_errors/messages.ftl new file mode 100644 index 00000000000..dde1d6c0a81 --- /dev/null +++ b/compiler/rustc_errors/messages.ftl @@ -0,0 +1,19 @@ +errors_target_invalid_address_space = + invalid address space `{$addr_space}` for `{$cause}` in "data-layout": {$err} + +errors_target_invalid_bits = + invalid {$kind} `{$bit}` for `{$cause}` in "data-layout": {$err} + +errors_target_missing_alignment = + missing alignment for `{$cause}` in "data-layout" + +errors_target_invalid_alignment = + invalid alignment for `{$cause}` in "data-layout": {$err} + +errors_target_inconsistent_architecture = + inconsistent target specification: "data-layout" claims architecture is {$dl}-endian, while "target-endian" is `{$target}` + +errors_target_inconsistent_pointer_width = + inconsistent target specification: "data-layout" claims pointers are {$pointer_size}-bit, while "target-pointer-width" is `{$target}` + +errors_target_invalid_bits_size = {$err} diff --git a/compiler/rustc_errors/src/lib.rs b/compiler/rustc_errors/src/lib.rs index 99af872f07f..bab4f31e777 100644 --- a/compiler/rustc_errors/src/lib.rs +++ b/compiler/rustc_errors/src/lib.rs @@ -76,7 +76,7 @@ pub use snippet::Style; pub type PErr<'a> = DiagnosticBuilder<'a, ErrorGuaranteed>; pub type PResult<'a, T> = Result>; -fluent_messages! { "../locales/en-US.ftl" } +fluent_messages! { "../messages.ftl" } // `PResult` is used a lot. Make sure it doesn't unintentionally get bigger. // (See also the comment on `DiagnosticBuilderInner`'s `diagnostic` field.) diff --git a/compiler/rustc_expand/locales/en-US.ftl b/compiler/rustc_expand/locales/en-US.ftl deleted file mode 100644 index cfae781bdee..00000000000 --- a/compiler/rustc_expand/locales/en-US.ftl +++ /dev/null @@ -1,138 +0,0 @@ -expand_explain_doc_comment_outer = - outer doc comments expand to `#[doc = "..."]`, which is what this macro attempted to match - -expand_explain_doc_comment_inner = - inner doc comments expand to `#![doc = "..."]`, which is what this macro attempted to match - -expand_expr_repeat_no_syntax_vars = - attempted to repeat an expression containing no syntax variables matched as repeating at this depth - -expand_must_repeat_once = - this must repeat at least once - -expand_count_repetition_misplaced = - `count` can not be placed inside the inner-most repetition - -expand_meta_var_expr_unrecognized_var = - variable `{$key}` is not recognized in meta-variable expression - -expand_var_still_repeating = - variable '{$ident}' is still repeating at this depth - -expand_meta_var_dif_seq_matchers = {$msg} - -expand_macro_const_stability = - macros cannot have const stability attributes - .label = invalid const stability attribute - .label2 = const stability attribute affects this macro - -expand_macro_body_stability = - macros cannot have body stability attributes - .label = invalid body stability attribute - .label2 = body stability attribute affects this macro - -expand_resolve_relative_path = - cannot resolve relative path in non-file source `{$path}` - -expand_attr_no_arguments = - attribute must have either one or two arguments - -expand_not_a_meta_item = - not a meta item - -expand_only_one_word = - must only be one word - -expand_cannot_be_name_of_macro = - `{$trait_ident}` cannot be a name of {$macro_type} macro - -expand_arg_not_attributes = - second argument must be `attributes` - -expand_attributes_wrong_form = - attribute must be of form: `attributes(foo, bar)` - -expand_attribute_meta_item = - attribute must be a meta item, not a literal - -expand_attribute_single_word = - attribute must only be a single word - -expand_helper_attribute_name_invalid = - `{$name}` cannot be a name of derive helper attribute - -expand_expected_comma_in_list = - expected token: `,` - -expand_only_one_argument = - {$name} takes 1 argument - -expand_takes_no_arguments = - {$name} takes no arguments - -expand_feature_included_in_edition = - the feature `{$feature}` is included in the Rust {$edition} edition - -expand_feature_removed = - feature has been removed - .label = feature has been removed - .reason = {$reason} - -expand_feature_not_allowed = - the feature `{$name}` is not in the list of allowed features - -expand_recursion_limit_reached = - recursion limit reached while expanding `{$descr}` - .help = consider increasing the recursion limit by adding a `#![recursion_limit = "{$suggested_limit}"]` attribute to your crate (`{$crate_name}`) - -expand_malformed_feature_attribute = - malformed `feature` attribute input - .expected = expected just one word - -expand_remove_expr_not_supported = - removing an expression is not supported in this position - -expand_invalid_cfg_no_parens = `cfg` is not followed by parentheses -expand_invalid_cfg_no_predicate = `cfg` predicate is not specified -expand_invalid_cfg_multiple_predicates = multiple `cfg` predicates are specified -expand_invalid_cfg_predicate_literal = `cfg` predicate key cannot be a literal -expand_invalid_cfg_expected_syntax = expected syntax is - -expand_wrong_fragment_kind = - non-{$kind} macro in {$kind} position: {$name} - -expand_unsupported_key_value = - key-value macro attributes are not supported - -expand_incomplete_parse = - macro expansion ignores token `{$token}` and any following - .label = caused by the macro expansion here - .note = the usage of `{$macro_path}!` is likely invalid in {$kind_name} context - .suggestion_add_semi = you might be missing a semicolon here - -expand_remove_node_not_supported = - removing {$descr} is not supported in this position - -expand_module_circular = - circular modules: {$modules} - -expand_module_in_block = - cannot declare a non-inline module inside a block unless it has a path attribute - .note = maybe `use` the module `{$name}` instead of redeclaring it - -expand_module_file_not_found = - file not found for module `{$name}` - .help = to create the module `{$name}`, create file "{$default_path}" or "{$secondary_path}" - -expand_module_multiple_candidates = - file for module `{$name}` found at both "{$default_path}" and "{$secondary_path}" - .help = delete or rename one of them to remove the ambiguity - -expand_trace_macro = trace_macro - -expand_proc_macro_panicked = - proc macro panicked - .help = message: {$message} - -expand_proc_macro_derive_tokens = - proc-macro derive produced unparseable tokens diff --git a/compiler/rustc_expand/messages.ftl b/compiler/rustc_expand/messages.ftl new file mode 100644 index 00000000000..cfae781bdee --- /dev/null +++ b/compiler/rustc_expand/messages.ftl @@ -0,0 +1,138 @@ +expand_explain_doc_comment_outer = + outer doc comments expand to `#[doc = "..."]`, which is what this macro attempted to match + +expand_explain_doc_comment_inner = + inner doc comments expand to `#![doc = "..."]`, which is what this macro attempted to match + +expand_expr_repeat_no_syntax_vars = + attempted to repeat an expression containing no syntax variables matched as repeating at this depth + +expand_must_repeat_once = + this must repeat at least once + +expand_count_repetition_misplaced = + `count` can not be placed inside the inner-most repetition + +expand_meta_var_expr_unrecognized_var = + variable `{$key}` is not recognized in meta-variable expression + +expand_var_still_repeating = + variable '{$ident}' is still repeating at this depth + +expand_meta_var_dif_seq_matchers = {$msg} + +expand_macro_const_stability = + macros cannot have const stability attributes + .label = invalid const stability attribute + .label2 = const stability attribute affects this macro + +expand_macro_body_stability = + macros cannot have body stability attributes + .label = invalid body stability attribute + .label2 = body stability attribute affects this macro + +expand_resolve_relative_path = + cannot resolve relative path in non-file source `{$path}` + +expand_attr_no_arguments = + attribute must have either one or two arguments + +expand_not_a_meta_item = + not a meta item + +expand_only_one_word = + must only be one word + +expand_cannot_be_name_of_macro = + `{$trait_ident}` cannot be a name of {$macro_type} macro + +expand_arg_not_attributes = + second argument must be `attributes` + +expand_attributes_wrong_form = + attribute must be of form: `attributes(foo, bar)` + +expand_attribute_meta_item = + attribute must be a meta item, not a literal + +expand_attribute_single_word = + attribute must only be a single word + +expand_helper_attribute_name_invalid = + `{$name}` cannot be a name of derive helper attribute + +expand_expected_comma_in_list = + expected token: `,` + +expand_only_one_argument = + {$name} takes 1 argument + +expand_takes_no_arguments = + {$name} takes no arguments + +expand_feature_included_in_edition = + the feature `{$feature}` is included in the Rust {$edition} edition + +expand_feature_removed = + feature has been removed + .label = feature has been removed + .reason = {$reason} + +expand_feature_not_allowed = + the feature `{$name}` is not in the list of allowed features + +expand_recursion_limit_reached = + recursion limit reached while expanding `{$descr}` + .help = consider increasing the recursion limit by adding a `#![recursion_limit = "{$suggested_limit}"]` attribute to your crate (`{$crate_name}`) + +expand_malformed_feature_attribute = + malformed `feature` attribute input + .expected = expected just one word + +expand_remove_expr_not_supported = + removing an expression is not supported in this position + +expand_invalid_cfg_no_parens = `cfg` is not followed by parentheses +expand_invalid_cfg_no_predicate = `cfg` predicate is not specified +expand_invalid_cfg_multiple_predicates = multiple `cfg` predicates are specified +expand_invalid_cfg_predicate_literal = `cfg` predicate key cannot be a literal +expand_invalid_cfg_expected_syntax = expected syntax is + +expand_wrong_fragment_kind = + non-{$kind} macro in {$kind} position: {$name} + +expand_unsupported_key_value = + key-value macro attributes are not supported + +expand_incomplete_parse = + macro expansion ignores token `{$token}` and any following + .label = caused by the macro expansion here + .note = the usage of `{$macro_path}!` is likely invalid in {$kind_name} context + .suggestion_add_semi = you might be missing a semicolon here + +expand_remove_node_not_supported = + removing {$descr} is not supported in this position + +expand_module_circular = + circular modules: {$modules} + +expand_module_in_block = + cannot declare a non-inline module inside a block unless it has a path attribute + .note = maybe `use` the module `{$name}` instead of redeclaring it + +expand_module_file_not_found = + file not found for module `{$name}` + .help = to create the module `{$name}`, create file "{$default_path}" or "{$secondary_path}" + +expand_module_multiple_candidates = + file for module `{$name}` found at both "{$default_path}" and "{$secondary_path}" + .help = delete or rename one of them to remove the ambiguity + +expand_trace_macro = trace_macro + +expand_proc_macro_panicked = + proc macro panicked + .help = message: {$message} + +expand_proc_macro_derive_tokens = + proc-macro derive produced unparseable tokens diff --git a/compiler/rustc_expand/src/lib.rs b/compiler/rustc_expand/src/lib.rs index 634e206e58a..ced7531c3fe 100644 --- a/compiler/rustc_expand/src/lib.rs +++ b/compiler/rustc_expand/src/lib.rs @@ -64,4 +64,4 @@ mod mut_visit { mod tests; } -fluent_messages! { "../locales/en-US.ftl" } +fluent_messages! { "../messages.ftl" } diff --git a/compiler/rustc_hir_analysis/locales/en-US.ftl b/compiler/rustc_hir_analysis/locales/en-US.ftl deleted file mode 100644 index dbe15ed5e9b..00000000000 --- a/compiler/rustc_hir_analysis/locales/en-US.ftl +++ /dev/null @@ -1,175 +0,0 @@ -hir_analysis_unrecognized_atomic_operation = - unrecognized atomic operation function: `{$op}` - .label = unrecognized atomic operation - -hir_analysis_wrong_number_of_generic_arguments_to_intrinsic = - intrinsic has wrong number of {$descr} parameters: found {$found}, expected {$expected} - .label = expected {$expected} {$descr} {$expected -> - [one] parameter - *[other] parameters - } - -hir_analysis_unrecognized_intrinsic_function = - unrecognized intrinsic function: `{$name}` - .label = unrecognized intrinsic - -hir_analysis_lifetimes_or_bounds_mismatch_on_trait = - lifetime parameters or bounds on {$item_kind} `{$ident}` do not match the trait declaration - .label = lifetimes do not match {$item_kind} in trait - .generics_label = lifetimes in impl do not match this {$item_kind} in trait - .where_label = this `where` clause might not match the one in the trait - .bounds_label = this bound might be missing in the impl - -hir_analysis_async_trait_impl_should_be_async = - method `{$method_name}` should be async because the method from the trait is async - .trait_item_label = required because the trait method is async - -hir_analysis_drop_impl_on_wrong_item = - the `Drop` trait may only be implemented for local structs, enums, and unions - .label = must be a struct, enum, or union in the current crate - -hir_analysis_field_already_declared = - field `{$field_name}` is already declared - .label = field already declared - .previous_decl_label = `{$field_name}` first declared here - -hir_analysis_expected_used_symbol = expected `used`, `used(compiler)` or `used(linker)` - -hir_analysis_ambiguous_lifetime_bound = - ambiguous lifetime bound, explicit lifetime bound required - -hir_analysis_assoc_type_binding_not_allowed = - associated type bindings are not allowed here - .label = associated type not allowed here - -hir_analysis_parenthesized_fn_trait_expansion = - parenthesized trait syntax expands to `{$expanded_type}` - -hir_analysis_typeof_reserved_keyword_used = - `typeof` is a reserved keyword but unimplemented - .suggestion = consider replacing `typeof(...)` with an actual type - .label = reserved keyword - -hir_analysis_value_of_associated_struct_already_specified = - the value of the associated type `{$item_name}` (from trait `{$def_path}`) is already specified - .label = re-bound here - .previous_bound_label = `{$item_name}` bound here first - -hir_analysis_unconstrained_opaque_type = unconstrained opaque type - .note = `{$name}` must be used in combination with a concrete type within the same {$what} - -hir_analysis_manual_implementation = - manual implementations of `{$trait_name}` are experimental - .label = manual implementations of `{$trait_name}` are experimental - .help = add `#![feature(unboxed_closures)]` to the crate attributes to enable - -hir_analysis_substs_on_overridden_impl = could not resolve substs on overridden impl - -hir_analysis_trait_object_declared_with_no_traits = - at least one trait is required for an object type - .alias_span = this alias does not contain a trait - -hir_analysis_missing_type_params = - the type {$parameterCount -> - [one] parameter - *[other] parameters - } {$parameters} must be explicitly specified - .label = type {$parameterCount -> - [one] parameter - *[other] parameters - } {$parameters} must be specified for this - .suggestion = set the type {$parameterCount -> - [one] parameter - *[other] parameters - } to the desired {$parameterCount -> - [one] type - *[other] types - } - .no_suggestion_label = missing {$parameterCount -> - [one] reference - *[other] references - } to {$parameters} - .note = because of the default `Self` reference, type parameters must be specified on object types - -hir_analysis_copy_impl_on_type_with_dtor = - the trait `Copy` cannot be implemented for this type; the type has a destructor - .label = `Copy` not allowed on types with destructors - -hir_analysis_multiple_relaxed_default_bounds = - type parameter has more than one relaxed default bound, only one is supported - -hir_analysis_copy_impl_on_non_adt = - the trait `Copy` cannot be implemented for this type - .label = type is not a structure or enumeration - -hir_analysis_const_impl_for_non_const_trait = - const `impl` for trait `{$trait_name}` which is not marked with `#[const_trait]` - .suggestion = mark `{$trait_name}` as const - .note = marking a trait with `#[const_trait]` ensures all default method bodies are `const` - .adding = adding a non-const method body in the future would be a breaking change - -hir_analysis_const_bound_for_non_const_trait = - ~const can only be applied to `#[const_trait]` traits - -hir_analysis_self_in_impl_self = - `Self` is not valid in the self type of an impl block - .note = replace `Self` with a different type - -hir_analysis_linkage_type = - invalid type for variable with `#[linkage]` attribute - -hir_analysis_auto_deref_reached_recursion_limit = reached the recursion limit while auto-dereferencing `{$ty}` - .label = deref recursion limit reached - .help = consider increasing the recursion limit by adding a `#![recursion_limit = "{$suggested_limit}"]` attribute to your crate (`{$crate_name}`) - -hir_analysis_where_clause_on_main = `main` function is not allowed to have a `where` clause - .label = `main` cannot have a `where` clause - -hir_analysis_track_caller_on_main = `main` function is not allowed to be `#[track_caller]` - .suggestion = remove this annotation - -hir_analysis_start_not_track_caller = `start` is not allowed to be `#[track_caller]` - .label = `start` is not allowed to be `#[track_caller]` - -hir_analysis_start_not_async = `start` is not allowed to be `async` - .label = `start` is not allowed to be `async` - -hir_analysis_start_function_where = start function is not allowed to have a `where` clause - .label = start function cannot have a `where` clause - -hir_analysis_start_function_parameters = start function is not allowed to have type parameters - .label = start function cannot have type parameters - -hir_analysis_main_function_return_type_generic = `main` function return type is not allowed to have generic parameters - -hir_analysis_main_function_async = `main` function is not allowed to be `async` - .label = `main` function is not allowed to be `async` - -hir_analysis_main_function_generic_parameters = `main` function is not allowed to have generic parameters - .label = `main` cannot have generic parameters - -hir_analysis_variadic_function_compatible_convention = C-variadic function must have a compatible calling convention, like {$conventions} - .label = C-variadic function must have a compatible calling convention - -hir_analysis_cannot_capture_late_bound_ty_in_anon_const = - cannot capture late-bound type parameter in a constant - .label = parameter defined here - -hir_analysis_cannot_capture_late_bound_const_in_anon_const = - cannot capture late-bound const parameter in a constant - .label = parameter defined here - -hir_analysis_variances_of = {$variances_of} - -hir_analysis_pass_to_variadic_function = can't pass `{$ty}` to variadic function - .suggestion = cast the value to `{$cast_ty}` - .help = cast the value to `{$cast_ty}` - -hir_analysis_cast_thin_pointer_to_fat_pointer = cannot cast thin pointer `{$expr_ty}` to fat pointer `{$cast_ty}` - -hir_analysis_invalid_union_field = - field must implement `Copy` or be wrapped in `ManuallyDrop<...>` to be used in a union - .note = union fields must not have drop side-effects, which is currently enforced via either `Copy` or `ManuallyDrop<...>` - -hir_analysis_invalid_union_field_sugg = - wrap the field type in `ManuallyDrop<...>` diff --git a/compiler/rustc_hir_analysis/messages.ftl b/compiler/rustc_hir_analysis/messages.ftl new file mode 100644 index 00000000000..dbe15ed5e9b --- /dev/null +++ b/compiler/rustc_hir_analysis/messages.ftl @@ -0,0 +1,175 @@ +hir_analysis_unrecognized_atomic_operation = + unrecognized atomic operation function: `{$op}` + .label = unrecognized atomic operation + +hir_analysis_wrong_number_of_generic_arguments_to_intrinsic = + intrinsic has wrong number of {$descr} parameters: found {$found}, expected {$expected} + .label = expected {$expected} {$descr} {$expected -> + [one] parameter + *[other] parameters + } + +hir_analysis_unrecognized_intrinsic_function = + unrecognized intrinsic function: `{$name}` + .label = unrecognized intrinsic + +hir_analysis_lifetimes_or_bounds_mismatch_on_trait = + lifetime parameters or bounds on {$item_kind} `{$ident}` do not match the trait declaration + .label = lifetimes do not match {$item_kind} in trait + .generics_label = lifetimes in impl do not match this {$item_kind} in trait + .where_label = this `where` clause might not match the one in the trait + .bounds_label = this bound might be missing in the impl + +hir_analysis_async_trait_impl_should_be_async = + method `{$method_name}` should be async because the method from the trait is async + .trait_item_label = required because the trait method is async + +hir_analysis_drop_impl_on_wrong_item = + the `Drop` trait may only be implemented for local structs, enums, and unions + .label = must be a struct, enum, or union in the current crate + +hir_analysis_field_already_declared = + field `{$field_name}` is already declared + .label = field already declared + .previous_decl_label = `{$field_name}` first declared here + +hir_analysis_expected_used_symbol = expected `used`, `used(compiler)` or `used(linker)` + +hir_analysis_ambiguous_lifetime_bound = + ambiguous lifetime bound, explicit lifetime bound required + +hir_analysis_assoc_type_binding_not_allowed = + associated type bindings are not allowed here + .label = associated type not allowed here + +hir_analysis_parenthesized_fn_trait_expansion = + parenthesized trait syntax expands to `{$expanded_type}` + +hir_analysis_typeof_reserved_keyword_used = + `typeof` is a reserved keyword but unimplemented + .suggestion = consider replacing `typeof(...)` with an actual type + .label = reserved keyword + +hir_analysis_value_of_associated_struct_already_specified = + the value of the associated type `{$item_name}` (from trait `{$def_path}`) is already specified + .label = re-bound here + .previous_bound_label = `{$item_name}` bound here first + +hir_analysis_unconstrained_opaque_type = unconstrained opaque type + .note = `{$name}` must be used in combination with a concrete type within the same {$what} + +hir_analysis_manual_implementation = + manual implementations of `{$trait_name}` are experimental + .label = manual implementations of `{$trait_name}` are experimental + .help = add `#![feature(unboxed_closures)]` to the crate attributes to enable + +hir_analysis_substs_on_overridden_impl = could not resolve substs on overridden impl + +hir_analysis_trait_object_declared_with_no_traits = + at least one trait is required for an object type + .alias_span = this alias does not contain a trait + +hir_analysis_missing_type_params = + the type {$parameterCount -> + [one] parameter + *[other] parameters + } {$parameters} must be explicitly specified + .label = type {$parameterCount -> + [one] parameter + *[other] parameters + } {$parameters} must be specified for this + .suggestion = set the type {$parameterCount -> + [one] parameter + *[other] parameters + } to the desired {$parameterCount -> + [one] type + *[other] types + } + .no_suggestion_label = missing {$parameterCount -> + [one] reference + *[other] references + } to {$parameters} + .note = because of the default `Self` reference, type parameters must be specified on object types + +hir_analysis_copy_impl_on_type_with_dtor = + the trait `Copy` cannot be implemented for this type; the type has a destructor + .label = `Copy` not allowed on types with destructors + +hir_analysis_multiple_relaxed_default_bounds = + type parameter has more than one relaxed default bound, only one is supported + +hir_analysis_copy_impl_on_non_adt = + the trait `Copy` cannot be implemented for this type + .label = type is not a structure or enumeration + +hir_analysis_const_impl_for_non_const_trait = + const `impl` for trait `{$trait_name}` which is not marked with `#[const_trait]` + .suggestion = mark `{$trait_name}` as const + .note = marking a trait with `#[const_trait]` ensures all default method bodies are `const` + .adding = adding a non-const method body in the future would be a breaking change + +hir_analysis_const_bound_for_non_const_trait = + ~const can only be applied to `#[const_trait]` traits + +hir_analysis_self_in_impl_self = + `Self` is not valid in the self type of an impl block + .note = replace `Self` with a different type + +hir_analysis_linkage_type = + invalid type for variable with `#[linkage]` attribute + +hir_analysis_auto_deref_reached_recursion_limit = reached the recursion limit while auto-dereferencing `{$ty}` + .label = deref recursion limit reached + .help = consider increasing the recursion limit by adding a `#![recursion_limit = "{$suggested_limit}"]` attribute to your crate (`{$crate_name}`) + +hir_analysis_where_clause_on_main = `main` function is not allowed to have a `where` clause + .label = `main` cannot have a `where` clause + +hir_analysis_track_caller_on_main = `main` function is not allowed to be `#[track_caller]` + .suggestion = remove this annotation + +hir_analysis_start_not_track_caller = `start` is not allowed to be `#[track_caller]` + .label = `start` is not allowed to be `#[track_caller]` + +hir_analysis_start_not_async = `start` is not allowed to be `async` + .label = `start` is not allowed to be `async` + +hir_analysis_start_function_where = start function is not allowed to have a `where` clause + .label = start function cannot have a `where` clause + +hir_analysis_start_function_parameters = start function is not allowed to have type parameters + .label = start function cannot have type parameters + +hir_analysis_main_function_return_type_generic = `main` function return type is not allowed to have generic parameters + +hir_analysis_main_function_async = `main` function is not allowed to be `async` + .label = `main` function is not allowed to be `async` + +hir_analysis_main_function_generic_parameters = `main` function is not allowed to have generic parameters + .label = `main` cannot have generic parameters + +hir_analysis_variadic_function_compatible_convention = C-variadic function must have a compatible calling convention, like {$conventions} + .label = C-variadic function must have a compatible calling convention + +hir_analysis_cannot_capture_late_bound_ty_in_anon_const = + cannot capture late-bound type parameter in a constant + .label = parameter defined here + +hir_analysis_cannot_capture_late_bound_const_in_anon_const = + cannot capture late-bound const parameter in a constant + .label = parameter defined here + +hir_analysis_variances_of = {$variances_of} + +hir_analysis_pass_to_variadic_function = can't pass `{$ty}` to variadic function + .suggestion = cast the value to `{$cast_ty}` + .help = cast the value to `{$cast_ty}` + +hir_analysis_cast_thin_pointer_to_fat_pointer = cannot cast thin pointer `{$expr_ty}` to fat pointer `{$cast_ty}` + +hir_analysis_invalid_union_field = + field must implement `Copy` or be wrapped in `ManuallyDrop<...>` to be used in a union + .note = union fields must not have drop side-effects, which is currently enforced via either `Copy` or `ManuallyDrop<...>` + +hir_analysis_invalid_union_field_sugg = + wrap the field type in `ManuallyDrop<...>` diff --git a/compiler/rustc_hir_analysis/src/lib.rs b/compiler/rustc_hir_analysis/src/lib.rs index 7abdde2c892..6a4f5382878 100644 --- a/compiler/rustc_hir_analysis/src/lib.rs +++ b/compiler/rustc_hir_analysis/src/lib.rs @@ -120,7 +120,7 @@ use std::ops::Not; use astconv::AstConv; use bounds::Bounds; -fluent_messages! { "../locales/en-US.ftl" } +fluent_messages! { "../messages.ftl" } fn require_c_abi_if_c_variadic(tcx: TyCtxt<'_>, decl: &hir::FnDecl<'_>, abi: Abi, span: Span) { const CONVENTIONS_UNSTABLE: &str = "`C`, `cdecl`, `win64`, `sysv64` or `efiapi`"; diff --git a/compiler/rustc_hir_typeck/locales/en-US.ftl b/compiler/rustc_hir_typeck/locales/en-US.ftl deleted file mode 100644 index 2c537bf4064..00000000000 --- a/compiler/rustc_hir_typeck/locales/en-US.ftl +++ /dev/null @@ -1,79 +0,0 @@ -hir_typeck_field_multiply_specified_in_initializer = - field `{$ident}` specified more than once - .label = used more than once - .previous_use_label = first use of `{$ident}` - -hir_typeck_copy_impl_on_type_with_dtor = - the trait `Copy` cannot be implemented for this type; the type has a destructor - .label = `Copy` not allowed on types with destructors - -hir_typeck_multiple_relaxed_default_bounds = - type parameter has more than one relaxed default bound, only one is supported - -hir_typeck_copy_impl_on_non_adt = - the trait `Copy` cannot be implemented for this type - .label = type is not a structure or enumeration - -hir_typeck_trait_object_declared_with_no_traits = - at least one trait is required for an object type - .alias_span = this alias does not contain a trait - -hir_typeck_functional_record_update_on_non_struct = - functional record update syntax requires a struct - -hir_typeck_return_stmt_outside_of_fn_body = - return statement outside of function body - .encl_body_label = the return is part of this body... - .encl_fn_label = ...not the enclosing function body - -hir_typeck_yield_expr_outside_of_generator = - yield expression outside of generator literal - -hir_typeck_struct_expr_non_exhaustive = - cannot create non-exhaustive {$what} using struct expression - -hir_typeck_method_call_on_unknown_type = - the type of this value must be known to call a method on a raw pointer on it - -hir_typeck_address_of_temporary_taken = cannot take address of a temporary - .label = temporary value - -hir_typeck_add_return_type_add = try adding a return type - -hir_typeck_add_return_type_missing_here = a return type might be missing here - -hir_typeck_expected_default_return_type = expected `()` because of default return type - -hir_typeck_expected_return_type = expected `{$expected}` because of return type - -hir_typeck_missing_parentheses_in_range = can't call method `{$method_name}` on type `{$ty_str}` - -hir_typeck_add_missing_parentheses_in_range = you must surround the range in parentheses to call its `{$func_name}` function - -hir_typeck_lang_start_incorrect_number_params = incorrect number of parameters for the `start` lang item -hir_typeck_lang_start_incorrect_number_params_note_expected_count = the `start` lang item should have four parameters, but found {$found_param_count} - -hir_typeck_lang_start_expected_sig_note = the `start` lang item should have the signature `fn(fn() -> T, isize, *const *const u8, u8) -> isize` - -hir_typeck_lang_start_incorrect_param = parameter {$param_num} of the `start` lang item is incorrect - .suggestion = change the type from `{$found_ty}` to `{$expected_ty}` - -hir_typeck_lang_start_incorrect_ret_ty = the return type of the `start` lang item is incorrect - .suggestion = change the type from `{$found_ty}` to `{$expected_ty}` - -hir_typeck_help_set_edition_cargo = set `edition = "{$edition}"` in `Cargo.toml` -hir_typeck_help_set_edition_standalone = pass `--edition {$edition}` to `rustc` -hir_typeck_note_edition_guide = for more on editions, read https://doc.rust-lang.org/edition-guide - -hir_typeck_convert_to_str = try converting the passed type into a `&str` - -hir_typeck_op_trait_generic_params = `{$method_name}` must not have any generic parameters - -hir_typeck_fru_note = this expression may have been misinterpreted as a `..` range expression -hir_typeck_fru_expr = this expression does not end in a comma... -hir_typeck_fru_expr2 = ... so this is interpreted as a `..` range expression, instead of functional record update syntax -hir_typeck_fru_suggestion = - to set the remaining fields{$expr -> - [NONE]{""} - *[other] {" "}from `{$expr}` - }, separate the last named field with a comma diff --git a/compiler/rustc_hir_typeck/messages.ftl b/compiler/rustc_hir_typeck/messages.ftl new file mode 100644 index 00000000000..2c537bf4064 --- /dev/null +++ b/compiler/rustc_hir_typeck/messages.ftl @@ -0,0 +1,79 @@ +hir_typeck_field_multiply_specified_in_initializer = + field `{$ident}` specified more than once + .label = used more than once + .previous_use_label = first use of `{$ident}` + +hir_typeck_copy_impl_on_type_with_dtor = + the trait `Copy` cannot be implemented for this type; the type has a destructor + .label = `Copy` not allowed on types with destructors + +hir_typeck_multiple_relaxed_default_bounds = + type parameter has more than one relaxed default bound, only one is supported + +hir_typeck_copy_impl_on_non_adt = + the trait `Copy` cannot be implemented for this type + .label = type is not a structure or enumeration + +hir_typeck_trait_object_declared_with_no_traits = + at least one trait is required for an object type + .alias_span = this alias does not contain a trait + +hir_typeck_functional_record_update_on_non_struct = + functional record update syntax requires a struct + +hir_typeck_return_stmt_outside_of_fn_body = + return statement outside of function body + .encl_body_label = the return is part of this body... + .encl_fn_label = ...not the enclosing function body + +hir_typeck_yield_expr_outside_of_generator = + yield expression outside of generator literal + +hir_typeck_struct_expr_non_exhaustive = + cannot create non-exhaustive {$what} using struct expression + +hir_typeck_method_call_on_unknown_type = + the type of this value must be known to call a method on a raw pointer on it + +hir_typeck_address_of_temporary_taken = cannot take address of a temporary + .label = temporary value + +hir_typeck_add_return_type_add = try adding a return type + +hir_typeck_add_return_type_missing_here = a return type might be missing here + +hir_typeck_expected_default_return_type = expected `()` because of default return type + +hir_typeck_expected_return_type = expected `{$expected}` because of return type + +hir_typeck_missing_parentheses_in_range = can't call method `{$method_name}` on type `{$ty_str}` + +hir_typeck_add_missing_parentheses_in_range = you must surround the range in parentheses to call its `{$func_name}` function + +hir_typeck_lang_start_incorrect_number_params = incorrect number of parameters for the `start` lang item +hir_typeck_lang_start_incorrect_number_params_note_expected_count = the `start` lang item should have four parameters, but found {$found_param_count} + +hir_typeck_lang_start_expected_sig_note = the `start` lang item should have the signature `fn(fn() -> T, isize, *const *const u8, u8) -> isize` + +hir_typeck_lang_start_incorrect_param = parameter {$param_num} of the `start` lang item is incorrect + .suggestion = change the type from `{$found_ty}` to `{$expected_ty}` + +hir_typeck_lang_start_incorrect_ret_ty = the return type of the `start` lang item is incorrect + .suggestion = change the type from `{$found_ty}` to `{$expected_ty}` + +hir_typeck_help_set_edition_cargo = set `edition = "{$edition}"` in `Cargo.toml` +hir_typeck_help_set_edition_standalone = pass `--edition {$edition}` to `rustc` +hir_typeck_note_edition_guide = for more on editions, read https://doc.rust-lang.org/edition-guide + +hir_typeck_convert_to_str = try converting the passed type into a `&str` + +hir_typeck_op_trait_generic_params = `{$method_name}` must not have any generic parameters + +hir_typeck_fru_note = this expression may have been misinterpreted as a `..` range expression +hir_typeck_fru_expr = this expression does not end in a comma... +hir_typeck_fru_expr2 = ... so this is interpreted as a `..` range expression, instead of functional record update syntax +hir_typeck_fru_suggestion = + to set the remaining fields{$expr -> + [NONE]{""} + *[other] {" "}from `{$expr}` + }, separate the last named field with a comma diff --git a/compiler/rustc_hir_typeck/src/lib.rs b/compiler/rustc_hir_typeck/src/lib.rs index 70124a77364..d9c56134b66 100644 --- a/compiler/rustc_hir_typeck/src/lib.rs +++ b/compiler/rustc_hir_typeck/src/lib.rs @@ -75,7 +75,7 @@ use rustc_session::Session; use rustc_span::def_id::{DefId, LocalDefId}; use rustc_span::{sym, Span}; -fluent_messages! { "../locales/en-US.ftl" } +fluent_messages! { "../messages.ftl" } #[macro_export] macro_rules! type_error_struct { diff --git a/compiler/rustc_incremental/locales/en-US.ftl b/compiler/rustc_incremental/locales/en-US.ftl deleted file mode 100644 index 4852ee0d959..00000000000 --- a/compiler/rustc_incremental/locales/en-US.ftl +++ /dev/null @@ -1,118 +0,0 @@ -incremental_unrecognized_depnode = unrecognized `DepNode` variant: {$name} - -incremental_missing_depnode = missing `DepNode` variant - -incremental_missing_if_this_changed = no `#[rustc_if_this_changed]` annotation detected - -incremental_no_path = no path from `{$source}` to `{$target}` - -incremental_ok = OK - -incremental_unknown_reuse_kind = unknown cgu-reuse-kind `{$kind}` specified - -incremental_missing_query_depgraph = - found CGU-reuse attribute but `-Zquery-dep-graph` was not specified - -incremental_malformed_cgu_name = - found malformed codegen unit name `{$user_path}`. codegen units names must always start with the name of the crate (`{$crate_name}` in this case). - -incremental_no_module_named = - no module named `{$user_path}` (mangled: {$cgu_name}). available modules: {$cgu_names} - -incremental_field_associated_value_expected = associated value expected for `{$name}` - -incremental_no_field = no field `{$name}` - -incremental_assertion_auto = - `except` specified DepNodes that can not be affected for \"{$name}\": \"{$e}\" - -incremental_undefined_clean_dirty_assertions_item = - clean/dirty auto-assertions not yet defined for Node::Item.node={$kind} - -incremental_undefined_clean_dirty_assertions = - clean/dirty auto-assertions not yet defined for {$kind} - -incremental_repeated_depnode_label = dep-node label `{$label}` is repeated - -incremental_unrecognized_depnode_label = dep-node label `{$label}` not recognized - -incremental_not_dirty = `{$dep_node_str}` should be dirty but is not - -incremental_not_clean = `{$dep_node_str}` should be clean but is not - -incremental_not_loaded = `{$dep_node_str}` should have been loaded from disk but it was not - -incremental_unknown_item = unknown item `{$name}` - -incremental_no_cfg = no cfg attribute - -incremental_associated_value_expected_for = associated value expected for `{$ident}` - -incremental_associated_value_expected = expected an associated value - -incremental_unchecked_clean = found unchecked `#[rustc_clean]` attribute - -incremental_delete_old = unable to delete old {$name} at `{$path}`: {$err} - -incremental_create_new = failed to create {$name} at `{$path}`: {$err} - -incremental_write_new = failed to write {$name} to `{$path}`: {$err} - -incremental_canonicalize_path = incremental compilation: error canonicalizing path `{$path}`: {$err} - -incremental_create_incr_comp_dir = - could not create incremental compilation {$tag} directory `{$path}`: {$err} - -incremental_create_lock = - incremental compilation: could not create session directory lock file: {$lock_err} -incremental_lock_unsupported = - the filesystem for the incremental path at {$session_dir} does not appear to support locking, consider changing the incremental path to a filesystem that supports locking or disable incremental compilation -incremental_cargo_help_1 = - incremental compilation can be disabled by setting the environment variable CARGO_INCREMENTAL=0 (see https://doc.rust-lang.org/cargo/reference/profiles.html#incremental) -incremental_cargo_help_2 = - the entire build directory can be changed to a different filesystem by setting the environment variable CARGO_TARGET_DIR to a different path (see https://doc.rust-lang.org/cargo/reference/config.html#buildtarget-dir) - -incremental_delete_lock = - error deleting lock file for incremental compilation session directory `{$path}`: {$err} - -incremental_hard_link_failed = - hard linking files in the incremental compilation cache failed. copying files instead. consider moving the cache directory to a file system which supports hard linking in session dir `{$path}` - -incremental_delete_partial = failed to delete partly initialized session dir `{$path}`: {$err} - -incremental_delete_full = error deleting incremental compilation session directory `{$path}`: {$err} - -incremental_finalize = error finalizing incremental compilation session directory `{$path}`: {$err} - -incremental_invalid_gc_failed = - failed to garbage collect invalid incremental compilation session directory `{$path}`: {$err} - -incremental_finalized_gc_failed = - failed to garbage collect finalized incremental compilation session directory `{$path}`: {$err} - -incremental_session_gc_failed = - failed to garbage collect incremental compilation session directory `{$path}`: {$err} - -incremental_assert_not_loaded = - we asserted that the incremental cache should not be loaded, but it was loaded - -incremental_assert_loaded = - we asserted that an existing incremental cache directory should be successfully loaded, but it was not - -incremental_delete_incompatible = - failed to delete invalidated or incompatible incremental compilation session directory contents `{$path}`: {$err} - -incremental_load_dep_graph = could not load dep-graph from `{$path}`: {$err} - -incremental_decode_incr_cache = could not decode incremental cache: {$err} - -incremental_write_dep_graph = failed to write dependency graph to `{$path}`: {$err} - -incremental_move_dep_graph = failed to move dependency graph from `{$from}` to `{$to}`: {$err} - -incremental_create_dep_graph = failed to create dependency graph at `{$path}`: {$err} - -incremental_copy_workproduct_to_cache = - error copying object file `{$from}` to incremental directory as `{$to}`: {$err} - -incremental_delete_workproduct = file-system error deleting outdated file `{$path}`: {$err} diff --git a/compiler/rustc_incremental/messages.ftl b/compiler/rustc_incremental/messages.ftl new file mode 100644 index 00000000000..4852ee0d959 --- /dev/null +++ b/compiler/rustc_incremental/messages.ftl @@ -0,0 +1,118 @@ +incremental_unrecognized_depnode = unrecognized `DepNode` variant: {$name} + +incremental_missing_depnode = missing `DepNode` variant + +incremental_missing_if_this_changed = no `#[rustc_if_this_changed]` annotation detected + +incremental_no_path = no path from `{$source}` to `{$target}` + +incremental_ok = OK + +incremental_unknown_reuse_kind = unknown cgu-reuse-kind `{$kind}` specified + +incremental_missing_query_depgraph = + found CGU-reuse attribute but `-Zquery-dep-graph` was not specified + +incremental_malformed_cgu_name = + found malformed codegen unit name `{$user_path}`. codegen units names must always start with the name of the crate (`{$crate_name}` in this case). + +incremental_no_module_named = + no module named `{$user_path}` (mangled: {$cgu_name}). available modules: {$cgu_names} + +incremental_field_associated_value_expected = associated value expected for `{$name}` + +incremental_no_field = no field `{$name}` + +incremental_assertion_auto = + `except` specified DepNodes that can not be affected for \"{$name}\": \"{$e}\" + +incremental_undefined_clean_dirty_assertions_item = + clean/dirty auto-assertions not yet defined for Node::Item.node={$kind} + +incremental_undefined_clean_dirty_assertions = + clean/dirty auto-assertions not yet defined for {$kind} + +incremental_repeated_depnode_label = dep-node label `{$label}` is repeated + +incremental_unrecognized_depnode_label = dep-node label `{$label}` not recognized + +incremental_not_dirty = `{$dep_node_str}` should be dirty but is not + +incremental_not_clean = `{$dep_node_str}` should be clean but is not + +incremental_not_loaded = `{$dep_node_str}` should have been loaded from disk but it was not + +incremental_unknown_item = unknown item `{$name}` + +incremental_no_cfg = no cfg attribute + +incremental_associated_value_expected_for = associated value expected for `{$ident}` + +incremental_associated_value_expected = expected an associated value + +incremental_unchecked_clean = found unchecked `#[rustc_clean]` attribute + +incremental_delete_old = unable to delete old {$name} at `{$path}`: {$err} + +incremental_create_new = failed to create {$name} at `{$path}`: {$err} + +incremental_write_new = failed to write {$name} to `{$path}`: {$err} + +incremental_canonicalize_path = incremental compilation: error canonicalizing path `{$path}`: {$err} + +incremental_create_incr_comp_dir = + could not create incremental compilation {$tag} directory `{$path}`: {$err} + +incremental_create_lock = + incremental compilation: could not create session directory lock file: {$lock_err} +incremental_lock_unsupported = + the filesystem for the incremental path at {$session_dir} does not appear to support locking, consider changing the incremental path to a filesystem that supports locking or disable incremental compilation +incremental_cargo_help_1 = + incremental compilation can be disabled by setting the environment variable CARGO_INCREMENTAL=0 (see https://doc.rust-lang.org/cargo/reference/profiles.html#incremental) +incremental_cargo_help_2 = + the entire build directory can be changed to a different filesystem by setting the environment variable CARGO_TARGET_DIR to a different path (see https://doc.rust-lang.org/cargo/reference/config.html#buildtarget-dir) + +incremental_delete_lock = + error deleting lock file for incremental compilation session directory `{$path}`: {$err} + +incremental_hard_link_failed = + hard linking files in the incremental compilation cache failed. copying files instead. consider moving the cache directory to a file system which supports hard linking in session dir `{$path}` + +incremental_delete_partial = failed to delete partly initialized session dir `{$path}`: {$err} + +incremental_delete_full = error deleting incremental compilation session directory `{$path}`: {$err} + +incremental_finalize = error finalizing incremental compilation session directory `{$path}`: {$err} + +incremental_invalid_gc_failed = + failed to garbage collect invalid incremental compilation session directory `{$path}`: {$err} + +incremental_finalized_gc_failed = + failed to garbage collect finalized incremental compilation session directory `{$path}`: {$err} + +incremental_session_gc_failed = + failed to garbage collect incremental compilation session directory `{$path}`: {$err} + +incremental_assert_not_loaded = + we asserted that the incremental cache should not be loaded, but it was loaded + +incremental_assert_loaded = + we asserted that an existing incremental cache directory should be successfully loaded, but it was not + +incremental_delete_incompatible = + failed to delete invalidated or incompatible incremental compilation session directory contents `{$path}`: {$err} + +incremental_load_dep_graph = could not load dep-graph from `{$path}`: {$err} + +incremental_decode_incr_cache = could not decode incremental cache: {$err} + +incremental_write_dep_graph = failed to write dependency graph to `{$path}`: {$err} + +incremental_move_dep_graph = failed to move dependency graph from `{$from}` to `{$to}`: {$err} + +incremental_create_dep_graph = failed to create dependency graph at `{$path}`: {$err} + +incremental_copy_workproduct_to_cache = + error copying object file `{$from}` to incremental directory as `{$to}`: {$err} + +incremental_delete_workproduct = file-system error deleting outdated file `{$path}`: {$err} diff --git a/compiler/rustc_incremental/src/lib.rs b/compiler/rustc_incremental/src/lib.rs index 511e466c2ae..df958e4a61f 100644 --- a/compiler/rustc_incremental/src/lib.rs +++ b/compiler/rustc_incremental/src/lib.rs @@ -35,4 +35,4 @@ pub use persist::{build_dep_graph, load_dep_graph, DepGraphFuture}; use rustc_errors::{DiagnosticMessage, SubdiagnosticMessage}; use rustc_macros::fluent_messages; -fluent_messages! { "../locales/en-US.ftl" } +fluent_messages! { "../messages.ftl" } diff --git a/compiler/rustc_infer/locales/en-US.ftl b/compiler/rustc_infer/locales/en-US.ftl deleted file mode 100644 index 15780898dc6..00000000000 --- a/compiler/rustc_infer/locales/en-US.ftl +++ /dev/null @@ -1,350 +0,0 @@ -infer_opaque_hidden_type = - opaque type's hidden type cannot be another opaque type from the same scope - .label = one of the two opaque types used here has to be outside its defining scope - .opaque_type = opaque type whose hidden type is being assigned - .hidden_type = opaque type being used as hidden type - -infer_type_annotations_needed = {$source_kind -> - [closure] type annotations needed for the closure `{$source_name}` - [normal] type annotations needed for `{$source_name}` - *[other] type annotations needed -} - .label = type must be known at this point - -infer_label_bad = {$bad_kind -> - *[other] cannot infer type - [more_info] cannot infer {$prefix_kind -> - *[type] type for {$prefix} - [const_with_param] the value of const parameter - [const] the value of the constant - } `{$name}`{$has_parent -> - [true] {" "}declared on the {$parent_prefix} `{$parent_name}` - *[false] {""} - } -} - -infer_source_kind_subdiag_let = {$kind -> - [with_pattern] consider giving `{$name}` an explicit type - [closure] consider giving this closure parameter an explicit type - *[other] consider giving this pattern a type -}{$x_kind -> - [has_name] , where the {$prefix_kind -> - *[type] type for {$prefix} - [const_with_param] the value of const parameter - [const] the value of the constant - } `{$arg_name}` is specified - [underscore] , where the placeholders `_` are specified - *[empty] {""} -} - -infer_source_kind_subdiag_generic_label = - cannot infer {$is_type -> - [true] type - *[false] the value - } of the {$is_type -> - [true] type - *[false] const - } {$parent_exists -> - [true] parameter `{$param_name}` declared on the {$parent_prefix} `{$parent_name}` - *[false] parameter {$param_name} - } - -infer_source_kind_subdiag_generic_suggestion = - consider specifying the generic {$arg_count -> - [one] argument - *[other] arguments - } - -infer_source_kind_fully_qualified = - try using a fully qualified path to specify the expected types - -infer_source_kind_closure_return = - try giving this closure an explicit return type - -# generator_kind may need to be translated -infer_need_type_info_in_generator = - type inside {$generator_kind -> - [async_block] `async` block - [async_closure] `async` closure - [async_fn] `async fn` body - *[generator] generator - } must be known in this context - - -infer_subtype = ...so that the {$requirement -> - [method_compat] method type is compatible with trait - [type_compat] associated type is compatible with trait - [const_compat] const is compatible with trait - [expr_assignable] expression is assignable - [if_else_different] `if` and `else` have incompatible types - [no_else] `if` missing an `else` returns `()` - [fn_main_correct_type] `main` function has the correct type - [fn_start_correct_type] `#[start]` function has the correct type - [intristic_correct_type] intrinsic has the correct type - [method_correct_type] method receiver has the correct type - *[other] types are compatible -} -infer_subtype_2 = ...so that {$requirement -> - [method_compat] method type is compatible with trait - [type_compat] associated type is compatible with trait - [const_compat] const is compatible with trait - [expr_assignable] expression is assignable - [if_else_different] `if` and `else` have incompatible types - [no_else] `if` missing an `else` returns `()` - [fn_main_correct_type] `main` function has the correct type - [fn_start_correct_type] `#[start]` function has the correct type - [intristic_correct_type] intrinsic has the correct type - [method_correct_type] method receiver has the correct type - *[other] types are compatible -} - -infer_reborrow = ...so that reference does not outlive borrowed content -infer_reborrow_upvar = ...so that closure can access `{$name}` -infer_relate_object_bound = ...so that it can be closed over into an object -infer_reference_outlives_referent = ...so that the reference type `{$name}` does not outlive the data it points at -infer_relate_param_bound = ...so that the type `{$name}` will meet its required lifetime bounds{$continues -> - [true] ... - *[false] {""} -} -infer_relate_param_bound_2 = ...that is required by this bound -infer_relate_region_param_bound = ...so that the declared lifetime parameter bounds are satisfied -infer_compare_impl_item_obligation = ...so that the definition in impl matches the definition from the trait -infer_ascribe_user_type_prove_predicate = ...so that the where clause holds - -infer_nothing = {""} - -infer_lifetime_mismatch = lifetime mismatch - -infer_declared_different = this parameter and the return type are declared with different lifetimes... -infer_data_returned = ...but data{$label_var1_exists -> - [true] {" "}from `{$label_var1}` - *[false] {""} -} is returned here - -infer_data_lifetime_flow = ...but data with one lifetime flows into the other here -infer_declared_multiple = this type is declared with multiple lifetimes... -infer_types_declared_different = these two types are declared with different lifetimes... -infer_data_flows = ...but data{$label_var1_exists -> - [true] {" "}from `{$label_var1}` - *[false] -> {""} -} flows{$label_var2_exists -> - [true] {" "}into `{$label_var2}` - *[false] -> {""} -} here - -infer_lifetime_param_suggestion = consider introducing a named lifetime parameter{$is_impl -> - [true] {" "}and update trait if needed - *[false] {""} -} -infer_lifetime_param_suggestion_elided = each elided lifetime in input position becomes a distinct lifetime - -infer_region_explanation = {$pref_kind -> - *[should_not_happen] [{$pref_kind}] - [ref_valid_for] ...the reference is valid for - [content_valid_for] ...but the borrowed content is only valid for - [type_obj_valid_for] object type is valid for - [source_pointer_valid_for] source pointer is only valid for - [type_satisfy] type must satisfy - [type_outlive] type must outlive - [lf_param_instantiated_with] lifetime parameter instantiated with - [lf_param_must_outlive] but lifetime parameter must outlive - [lf_instantiated_with] lifetime instantiated with - [lf_must_outlive] but lifetime must outlive - [pointer_valid_for] the pointer is valid for - [data_valid_for] but the referenced data is only valid for - [empty] {""} -}{$pref_kind -> - [empty] {""} - *[other] {" "} -}{$desc_kind -> - *[should_not_happen] [{$desc_kind}] - [restatic] the static lifetime - [revar] lifetime {$desc_arg} - [as_defined] the lifetime `{$desc_arg}` as defined here - [as_defined_anon] the anonymous lifetime as defined here - [defined_here] the anonymous lifetime defined here - [anon_num_here] the anonymous lifetime #{$desc_num_arg} defined here - [defined_here_reg] the lifetime `{$desc_arg}` as defined here -}{$suff_kind -> - *[should_not_happen] [{$suff_kind}] - [empty]{""} - [continues] ... - [req_by_binding] {" "}as required by this binding -} - -infer_outlives_content = lifetime of reference outlives lifetime of borrowed content... -infer_outlives_bound = lifetime of the source pointer does not outlive lifetime bound of the object type -infer_fullfill_req_lifetime = the type `{$ty}` does not fulfill the required lifetime -infer_lf_bound_not_satisfied = lifetime bound not satisfied -infer_borrowed_too_long = a value of type `{$ty}` is borrowed for too long -infer_ref_longer_than_data = in type `{$ty}`, reference has a longer lifetime than the data it references - -infer_mismatched_static_lifetime = incompatible lifetime on type -infer_does_not_outlive_static_from_impl = ...does not necessarily outlive the static lifetime introduced by the compatible `impl` -infer_implicit_static_lifetime_note = this has an implicit `'static` lifetime requirement -infer_implicit_static_lifetime_suggestion = consider relaxing the implicit `'static` requirement -infer_msl_introduces_static = introduces a `'static` lifetime requirement -infer_msl_unmet_req = because this has an unmet lifetime requirement -infer_msl_trait_note = this has an implicit `'static` lifetime requirement -infer_msl_trait_sugg = consider relaxing the implicit `'static` requirement -infer_suggest_add_let_for_letchains = consider adding `let` - -infer_explicit_lifetime_required_with_ident = explicit lifetime required in the type of `{$simple_ident}` - .label = lifetime `{$named}` required - -infer_explicit_lifetime_required_with_param_type = explicit lifetime required in parameter type - .label = lifetime `{$named}` required - -infer_explicit_lifetime_required_sugg_with_ident = add explicit lifetime `{$named}` to the type of `{$simple_ident}` - -infer_explicit_lifetime_required_sugg_with_param_type = add explicit lifetime `{$named}` to type - -infer_actual_impl_expl_expected_signature_two = {$leading_ellipsis -> - [true] ... - *[false] {""} -}closure with signature `{$ty_or_sig}` must implement `{$trait_path}`, for any two lifetimes `'{$lifetime_1}` and `'{$lifetime_2}`... -infer_actual_impl_expl_expected_signature_any = {$leading_ellipsis -> - [true] ... - *[false] {""} -}closure with signature `{$ty_or_sig}` must implement `{$trait_path}`, for any lifetime `'{$lifetime_1}`... -infer_actual_impl_expl_expected_signature_some = {$leading_ellipsis -> - [true] ... - *[false] {""} -}closure with signature `{$ty_or_sig}` must implement `{$trait_path}`, for some specific lifetime `'{$lifetime_1}`... -infer_actual_impl_expl_expected_signature_nothing = {$leading_ellipsis -> - [true] ... - *[false] {""} -}closure with signature `{$ty_or_sig}` must implement `{$trait_path}` -infer_actual_impl_expl_expected_passive_two = {$leading_ellipsis -> - [true] ... - *[false] {""} -}`{$trait_path}` would have to be implemented for the type `{$ty_or_sig}`, for any two lifetimes `'{$lifetime_1}` and `'{$lifetime_2}`... -infer_actual_impl_expl_expected_passive_any = {$leading_ellipsis -> - [true] ... - *[false] {""} -}`{$trait_path}` would have to be implemented for the type `{$ty_or_sig}`, for any lifetime `'{$lifetime_1}`... -infer_actual_impl_expl_expected_passive_some = {$leading_ellipsis -> - [true] ... - *[false] {""} -}`{$trait_path}` would have to be implemented for the type `{$ty_or_sig}`, for some specific lifetime `'{$lifetime_1}`... -infer_actual_impl_expl_expected_passive_nothing = {$leading_ellipsis -> - [true] ... - *[false] {""} -}`{$trait_path}` would have to be implemented for the type `{$ty_or_sig}` -infer_actual_impl_expl_expected_other_two = {$leading_ellipsis -> - [true] ... - *[false] {""} -}`{$ty_or_sig}` must implement `{$trait_path}`, for any two lifetimes `'{$lifetime_1}` and `'{$lifetime_2}`... -infer_actual_impl_expl_expected_other_any = {$leading_ellipsis -> - [true] ... - *[false] {""} -}`{$ty_or_sig}` must implement `{$trait_path}`, for any lifetime `'{$lifetime_1}`... -infer_actual_impl_expl_expected_other_some = {$leading_ellipsis -> - [true] ... - *[false] {""} -}`{$ty_or_sig}` must implement `{$trait_path}`, for some specific lifetime `'{$lifetime_1}`... -infer_actual_impl_expl_expected_other_nothing = {$leading_ellipsis -> - [true] ... - *[false] {""} -}`{$ty_or_sig}` must implement `{$trait_path}` - -infer_actual_impl_expl_but_actually_implements_trait = ...but it actually implements `{$trait_path}`{$has_lifetime -> - [true] , for some specific lifetime `'{$lifetime}` - *[false] {""} -} -infer_actual_impl_expl_but_actually_implemented_for_ty = ...but `{$trait_path}` is actually implemented for the type `{$ty}`{$has_lifetime -> - [true] , for some specific lifetime `'{$lifetime}` - *[false] {""} -} -infer_actual_impl_expl_but_actually_ty_implements = ...but `{$ty}` actually implements `{$trait_path}`{$has_lifetime -> - [true] , for some specific lifetime `'{$lifetime}` - *[false] {""} -} - -infer_trait_placeholder_mismatch = implementation of `{$trait_def_id}` is not general enough - .label_satisfy = doesn't satisfy where-clause - .label_where = due to a where-clause on `{$def_id}`... - .label_dup = implementation of `{$trait_def_id}` is not general enough - -infer_trait_impl_diff = `impl` item signature doesn't match `trait` item signature - .found = found `{$found}` - .expected = expected `{$expected}` - .expected_found = expected signature `{$expected}` - {" "}found signature `{$found}` - -infer_tid_rel_help = verify the lifetime relationships in the `trait` and `impl` between the `self` argument, the other inputs and its output -infer_tid_consider_borrowing = consider borrowing this type parameter in the trait -infer_tid_param_help = the lifetime requirements from the `impl` do not correspond to the requirements in the `trait` - -infer_dtcs_has_lifetime_req_label = this has an implicit `'static` lifetime requirement -infer_dtcs_introduces_requirement = calling this method introduces the `impl`'s `'static` requirement -infer_dtcs_has_req_note = the used `impl` has a `'static` requirement -infer_dtcs_suggestion = consider relaxing the implicit `'static` requirement - -infer_but_calling_introduces = {$has_param_name -> - [true] `{$param_name}` - *[false] `fn` parameter -} has {$lifetime_kind -> - [true] lifetime `{$lifetime}` - *[false] an anonymous lifetime `'_` -} but calling `{$assoc_item}` introduces an implicit `'static` lifetime requirement - .label1 = {$has_lifetime -> - [true] lifetime `{$lifetime}` - *[false] an anonymous lifetime `'_` - } - .label2 = ...is used and required to live as long as `'static` here because of an implicit lifetime bound on the {$has_impl_path -> - [true] `impl` of `{$impl_path}` - *[false] inherent `impl` - } - -infer_but_needs_to_satisfy = {$has_param_name -> - [true] `{$param_name}` - *[false] `fn` parameter -} has {$has_lifetime -> - [true] lifetime `{$lifetime}` - *[false] an anonymous lifetime `'_` -} but it needs to satisfy a `'static` lifetime requirement - .influencer = this data with {$has_lifetime -> - [true] lifetime `{$lifetime}` - *[false] an anonymous lifetime `'_` - }... - .require = {$spans_empty -> - *[true] ...is used and required to live as long as `'static` here - [false] ...and is required to live as long as `'static` here - } - .used_here = ...is used here... - .introduced_by_bound = `'static` lifetime requirement introduced by this bound - -infer_more_targeted = {$has_param_name -> - [true] `{$param_name}` - *[false] `fn` parameter -} has {$has_lifetime -> - [true] lifetime `{$lifetime}` - *[false] an anonymous lifetime `'_` -} but calling `{$ident}` introduces an implicit `'static` lifetime requirement - -infer_ril_introduced_here = `'static` requirement introduced here -infer_ril_introduced_by = requirement introduced by this return type -infer_ril_because_of = because of this returned expression -infer_ril_static_introduced_by = "`'static` lifetime requirement introduced by the return type - -infer_where_remove = remove the `where` clause -infer_where_copy_predicates = copy the `where` clause predicates from the trait - -infer_srs_remove_and_box = consider removing this semicolon and boxing the expressions -infer_srs_remove = consider removing this semicolon -infer_srs_add = consider returning the local binding `{$ident}` -infer_srs_add_one = consider returning one of these bindings - -infer_await_both_futures = consider `await`ing on both `Future`s -infer_await_future = consider `await`ing on the `Future` -infer_await_note = calling an async function returns a future - -infer_prlf_defined_with_sub = the lifetime `{$sub_symbol}` defined here... -infer_prlf_defined_without_sub = the lifetime defined here... -infer_prlf_must_oultive_with_sup = ...must outlive the lifetime `{$sup_symbol}` defined here -infer_prlf_must_oultive_without_sup = ...must outlive the lifetime defined here -infer_prlf_known_limitation = this is a known limitation that will be removed in the future (see issue #100013 for more information) - -infer_opaque_captures_lifetime = hidden type for `{$opaque_ty}` captures lifetime that does not appear in bounds - .label = opaque type defined here diff --git a/compiler/rustc_infer/messages.ftl b/compiler/rustc_infer/messages.ftl new file mode 100644 index 00000000000..15780898dc6 --- /dev/null +++ b/compiler/rustc_infer/messages.ftl @@ -0,0 +1,350 @@ +infer_opaque_hidden_type = + opaque type's hidden type cannot be another opaque type from the same scope + .label = one of the two opaque types used here has to be outside its defining scope + .opaque_type = opaque type whose hidden type is being assigned + .hidden_type = opaque type being used as hidden type + +infer_type_annotations_needed = {$source_kind -> + [closure] type annotations needed for the closure `{$source_name}` + [normal] type annotations needed for `{$source_name}` + *[other] type annotations needed +} + .label = type must be known at this point + +infer_label_bad = {$bad_kind -> + *[other] cannot infer type + [more_info] cannot infer {$prefix_kind -> + *[type] type for {$prefix} + [const_with_param] the value of const parameter + [const] the value of the constant + } `{$name}`{$has_parent -> + [true] {" "}declared on the {$parent_prefix} `{$parent_name}` + *[false] {""} + } +} + +infer_source_kind_subdiag_let = {$kind -> + [with_pattern] consider giving `{$name}` an explicit type + [closure] consider giving this closure parameter an explicit type + *[other] consider giving this pattern a type +}{$x_kind -> + [has_name] , where the {$prefix_kind -> + *[type] type for {$prefix} + [const_with_param] the value of const parameter + [const] the value of the constant + } `{$arg_name}` is specified + [underscore] , where the placeholders `_` are specified + *[empty] {""} +} + +infer_source_kind_subdiag_generic_label = + cannot infer {$is_type -> + [true] type + *[false] the value + } of the {$is_type -> + [true] type + *[false] const + } {$parent_exists -> + [true] parameter `{$param_name}` declared on the {$parent_prefix} `{$parent_name}` + *[false] parameter {$param_name} + } + +infer_source_kind_subdiag_generic_suggestion = + consider specifying the generic {$arg_count -> + [one] argument + *[other] arguments + } + +infer_source_kind_fully_qualified = + try using a fully qualified path to specify the expected types + +infer_source_kind_closure_return = + try giving this closure an explicit return type + +# generator_kind may need to be translated +infer_need_type_info_in_generator = + type inside {$generator_kind -> + [async_block] `async` block + [async_closure] `async` closure + [async_fn] `async fn` body + *[generator] generator + } must be known in this context + + +infer_subtype = ...so that the {$requirement -> + [method_compat] method type is compatible with trait + [type_compat] associated type is compatible with trait + [const_compat] const is compatible with trait + [expr_assignable] expression is assignable + [if_else_different] `if` and `else` have incompatible types + [no_else] `if` missing an `else` returns `()` + [fn_main_correct_type] `main` function has the correct type + [fn_start_correct_type] `#[start]` function has the correct type + [intristic_correct_type] intrinsic has the correct type + [method_correct_type] method receiver has the correct type + *[other] types are compatible +} +infer_subtype_2 = ...so that {$requirement -> + [method_compat] method type is compatible with trait + [type_compat] associated type is compatible with trait + [const_compat] const is compatible with trait + [expr_assignable] expression is assignable + [if_else_different] `if` and `else` have incompatible types + [no_else] `if` missing an `else` returns `()` + [fn_main_correct_type] `main` function has the correct type + [fn_start_correct_type] `#[start]` function has the correct type + [intristic_correct_type] intrinsic has the correct type + [method_correct_type] method receiver has the correct type + *[other] types are compatible +} + +infer_reborrow = ...so that reference does not outlive borrowed content +infer_reborrow_upvar = ...so that closure can access `{$name}` +infer_relate_object_bound = ...so that it can be closed over into an object +infer_reference_outlives_referent = ...so that the reference type `{$name}` does not outlive the data it points at +infer_relate_param_bound = ...so that the type `{$name}` will meet its required lifetime bounds{$continues -> + [true] ... + *[false] {""} +} +infer_relate_param_bound_2 = ...that is required by this bound +infer_relate_region_param_bound = ...so that the declared lifetime parameter bounds are satisfied +infer_compare_impl_item_obligation = ...so that the definition in impl matches the definition from the trait +infer_ascribe_user_type_prove_predicate = ...so that the where clause holds + +infer_nothing = {""} + +infer_lifetime_mismatch = lifetime mismatch + +infer_declared_different = this parameter and the return type are declared with different lifetimes... +infer_data_returned = ...but data{$label_var1_exists -> + [true] {" "}from `{$label_var1}` + *[false] {""} +} is returned here + +infer_data_lifetime_flow = ...but data with one lifetime flows into the other here +infer_declared_multiple = this type is declared with multiple lifetimes... +infer_types_declared_different = these two types are declared with different lifetimes... +infer_data_flows = ...but data{$label_var1_exists -> + [true] {" "}from `{$label_var1}` + *[false] -> {""} +} flows{$label_var2_exists -> + [true] {" "}into `{$label_var2}` + *[false] -> {""} +} here + +infer_lifetime_param_suggestion = consider introducing a named lifetime parameter{$is_impl -> + [true] {" "}and update trait if needed + *[false] {""} +} +infer_lifetime_param_suggestion_elided = each elided lifetime in input position becomes a distinct lifetime + +infer_region_explanation = {$pref_kind -> + *[should_not_happen] [{$pref_kind}] + [ref_valid_for] ...the reference is valid for + [content_valid_for] ...but the borrowed content is only valid for + [type_obj_valid_for] object type is valid for + [source_pointer_valid_for] source pointer is only valid for + [type_satisfy] type must satisfy + [type_outlive] type must outlive + [lf_param_instantiated_with] lifetime parameter instantiated with + [lf_param_must_outlive] but lifetime parameter must outlive + [lf_instantiated_with] lifetime instantiated with + [lf_must_outlive] but lifetime must outlive + [pointer_valid_for] the pointer is valid for + [data_valid_for] but the referenced data is only valid for + [empty] {""} +}{$pref_kind -> + [empty] {""} + *[other] {" "} +}{$desc_kind -> + *[should_not_happen] [{$desc_kind}] + [restatic] the static lifetime + [revar] lifetime {$desc_arg} + [as_defined] the lifetime `{$desc_arg}` as defined here + [as_defined_anon] the anonymous lifetime as defined here + [defined_here] the anonymous lifetime defined here + [anon_num_here] the anonymous lifetime #{$desc_num_arg} defined here + [defined_here_reg] the lifetime `{$desc_arg}` as defined here +}{$suff_kind -> + *[should_not_happen] [{$suff_kind}] + [empty]{""} + [continues] ... + [req_by_binding] {" "}as required by this binding +} + +infer_outlives_content = lifetime of reference outlives lifetime of borrowed content... +infer_outlives_bound = lifetime of the source pointer does not outlive lifetime bound of the object type +infer_fullfill_req_lifetime = the type `{$ty}` does not fulfill the required lifetime +infer_lf_bound_not_satisfied = lifetime bound not satisfied +infer_borrowed_too_long = a value of type `{$ty}` is borrowed for too long +infer_ref_longer_than_data = in type `{$ty}`, reference has a longer lifetime than the data it references + +infer_mismatched_static_lifetime = incompatible lifetime on type +infer_does_not_outlive_static_from_impl = ...does not necessarily outlive the static lifetime introduced by the compatible `impl` +infer_implicit_static_lifetime_note = this has an implicit `'static` lifetime requirement +infer_implicit_static_lifetime_suggestion = consider relaxing the implicit `'static` requirement +infer_msl_introduces_static = introduces a `'static` lifetime requirement +infer_msl_unmet_req = because this has an unmet lifetime requirement +infer_msl_trait_note = this has an implicit `'static` lifetime requirement +infer_msl_trait_sugg = consider relaxing the implicit `'static` requirement +infer_suggest_add_let_for_letchains = consider adding `let` + +infer_explicit_lifetime_required_with_ident = explicit lifetime required in the type of `{$simple_ident}` + .label = lifetime `{$named}` required + +infer_explicit_lifetime_required_with_param_type = explicit lifetime required in parameter type + .label = lifetime `{$named}` required + +infer_explicit_lifetime_required_sugg_with_ident = add explicit lifetime `{$named}` to the type of `{$simple_ident}` + +infer_explicit_lifetime_required_sugg_with_param_type = add explicit lifetime `{$named}` to type + +infer_actual_impl_expl_expected_signature_two = {$leading_ellipsis -> + [true] ... + *[false] {""} +}closure with signature `{$ty_or_sig}` must implement `{$trait_path}`, for any two lifetimes `'{$lifetime_1}` and `'{$lifetime_2}`... +infer_actual_impl_expl_expected_signature_any = {$leading_ellipsis -> + [true] ... + *[false] {""} +}closure with signature `{$ty_or_sig}` must implement `{$trait_path}`, for any lifetime `'{$lifetime_1}`... +infer_actual_impl_expl_expected_signature_some = {$leading_ellipsis -> + [true] ... + *[false] {""} +}closure with signature `{$ty_or_sig}` must implement `{$trait_path}`, for some specific lifetime `'{$lifetime_1}`... +infer_actual_impl_expl_expected_signature_nothing = {$leading_ellipsis -> + [true] ... + *[false] {""} +}closure with signature `{$ty_or_sig}` must implement `{$trait_path}` +infer_actual_impl_expl_expected_passive_two = {$leading_ellipsis -> + [true] ... + *[false] {""} +}`{$trait_path}` would have to be implemented for the type `{$ty_or_sig}`, for any two lifetimes `'{$lifetime_1}` and `'{$lifetime_2}`... +infer_actual_impl_expl_expected_passive_any = {$leading_ellipsis -> + [true] ... + *[false] {""} +}`{$trait_path}` would have to be implemented for the type `{$ty_or_sig}`, for any lifetime `'{$lifetime_1}`... +infer_actual_impl_expl_expected_passive_some = {$leading_ellipsis -> + [true] ... + *[false] {""} +}`{$trait_path}` would have to be implemented for the type `{$ty_or_sig}`, for some specific lifetime `'{$lifetime_1}`... +infer_actual_impl_expl_expected_passive_nothing = {$leading_ellipsis -> + [true] ... + *[false] {""} +}`{$trait_path}` would have to be implemented for the type `{$ty_or_sig}` +infer_actual_impl_expl_expected_other_two = {$leading_ellipsis -> + [true] ... + *[false] {""} +}`{$ty_or_sig}` must implement `{$trait_path}`, for any two lifetimes `'{$lifetime_1}` and `'{$lifetime_2}`... +infer_actual_impl_expl_expected_other_any = {$leading_ellipsis -> + [true] ... + *[false] {""} +}`{$ty_or_sig}` must implement `{$trait_path}`, for any lifetime `'{$lifetime_1}`... +infer_actual_impl_expl_expected_other_some = {$leading_ellipsis -> + [true] ... + *[false] {""} +}`{$ty_or_sig}` must implement `{$trait_path}`, for some specific lifetime `'{$lifetime_1}`... +infer_actual_impl_expl_expected_other_nothing = {$leading_ellipsis -> + [true] ... + *[false] {""} +}`{$ty_or_sig}` must implement `{$trait_path}` + +infer_actual_impl_expl_but_actually_implements_trait = ...but it actually implements `{$trait_path}`{$has_lifetime -> + [true] , for some specific lifetime `'{$lifetime}` + *[false] {""} +} +infer_actual_impl_expl_but_actually_implemented_for_ty = ...but `{$trait_path}` is actually implemented for the type `{$ty}`{$has_lifetime -> + [true] , for some specific lifetime `'{$lifetime}` + *[false] {""} +} +infer_actual_impl_expl_but_actually_ty_implements = ...but `{$ty}` actually implements `{$trait_path}`{$has_lifetime -> + [true] , for some specific lifetime `'{$lifetime}` + *[false] {""} +} + +infer_trait_placeholder_mismatch = implementation of `{$trait_def_id}` is not general enough + .label_satisfy = doesn't satisfy where-clause + .label_where = due to a where-clause on `{$def_id}`... + .label_dup = implementation of `{$trait_def_id}` is not general enough + +infer_trait_impl_diff = `impl` item signature doesn't match `trait` item signature + .found = found `{$found}` + .expected = expected `{$expected}` + .expected_found = expected signature `{$expected}` + {" "}found signature `{$found}` + +infer_tid_rel_help = verify the lifetime relationships in the `trait` and `impl` between the `self` argument, the other inputs and its output +infer_tid_consider_borrowing = consider borrowing this type parameter in the trait +infer_tid_param_help = the lifetime requirements from the `impl` do not correspond to the requirements in the `trait` + +infer_dtcs_has_lifetime_req_label = this has an implicit `'static` lifetime requirement +infer_dtcs_introduces_requirement = calling this method introduces the `impl`'s `'static` requirement +infer_dtcs_has_req_note = the used `impl` has a `'static` requirement +infer_dtcs_suggestion = consider relaxing the implicit `'static` requirement + +infer_but_calling_introduces = {$has_param_name -> + [true] `{$param_name}` + *[false] `fn` parameter +} has {$lifetime_kind -> + [true] lifetime `{$lifetime}` + *[false] an anonymous lifetime `'_` +} but calling `{$assoc_item}` introduces an implicit `'static` lifetime requirement + .label1 = {$has_lifetime -> + [true] lifetime `{$lifetime}` + *[false] an anonymous lifetime `'_` + } + .label2 = ...is used and required to live as long as `'static` here because of an implicit lifetime bound on the {$has_impl_path -> + [true] `impl` of `{$impl_path}` + *[false] inherent `impl` + } + +infer_but_needs_to_satisfy = {$has_param_name -> + [true] `{$param_name}` + *[false] `fn` parameter +} has {$has_lifetime -> + [true] lifetime `{$lifetime}` + *[false] an anonymous lifetime `'_` +} but it needs to satisfy a `'static` lifetime requirement + .influencer = this data with {$has_lifetime -> + [true] lifetime `{$lifetime}` + *[false] an anonymous lifetime `'_` + }... + .require = {$spans_empty -> + *[true] ...is used and required to live as long as `'static` here + [false] ...and is required to live as long as `'static` here + } + .used_here = ...is used here... + .introduced_by_bound = `'static` lifetime requirement introduced by this bound + +infer_more_targeted = {$has_param_name -> + [true] `{$param_name}` + *[false] `fn` parameter +} has {$has_lifetime -> + [true] lifetime `{$lifetime}` + *[false] an anonymous lifetime `'_` +} but calling `{$ident}` introduces an implicit `'static` lifetime requirement + +infer_ril_introduced_here = `'static` requirement introduced here +infer_ril_introduced_by = requirement introduced by this return type +infer_ril_because_of = because of this returned expression +infer_ril_static_introduced_by = "`'static` lifetime requirement introduced by the return type + +infer_where_remove = remove the `where` clause +infer_where_copy_predicates = copy the `where` clause predicates from the trait + +infer_srs_remove_and_box = consider removing this semicolon and boxing the expressions +infer_srs_remove = consider removing this semicolon +infer_srs_add = consider returning the local binding `{$ident}` +infer_srs_add_one = consider returning one of these bindings + +infer_await_both_futures = consider `await`ing on both `Future`s +infer_await_future = consider `await`ing on the `Future` +infer_await_note = calling an async function returns a future + +infer_prlf_defined_with_sub = the lifetime `{$sub_symbol}` defined here... +infer_prlf_defined_without_sub = the lifetime defined here... +infer_prlf_must_oultive_with_sup = ...must outlive the lifetime `{$sup_symbol}` defined here +infer_prlf_must_oultive_without_sup = ...must outlive the lifetime defined here +infer_prlf_known_limitation = this is a known limitation that will be removed in the future (see issue #100013 for more information) + +infer_opaque_captures_lifetime = hidden type for `{$opaque_ty}` captures lifetime that does not appear in bounds + .label = opaque type defined here diff --git a/compiler/rustc_infer/src/lib.rs b/compiler/rustc_infer/src/lib.rs index bdc313c2141..738a1237651 100644 --- a/compiler/rustc_infer/src/lib.rs +++ b/compiler/rustc_infer/src/lib.rs @@ -41,4 +41,4 @@ mod errors; pub mod infer; pub mod traits; -fluent_messages! { "../locales/en-US.ftl" } +fluent_messages! { "../messages.ftl" } diff --git a/compiler/rustc_interface/locales/en-US.ftl b/compiler/rustc_interface/locales/en-US.ftl deleted file mode 100644 index 37994899a20..00000000000 --- a/compiler/rustc_interface/locales/en-US.ftl +++ /dev/null @@ -1,52 +0,0 @@ -interface_ferris_identifier = - Ferris cannot be used as an identifier - .suggestion = try using their name instead - -interface_emoji_identifier = - identifiers cannot contain emoji: `{$ident}` - -interface_mixed_bin_crate = - cannot mix `bin` crate type with others - -interface_mixed_proc_macro_crate = - cannot mix `proc-macro` crate type with others - -interface_error_writing_dependencies = - error writing dependencies to `{$path}`: {$error} - -interface_input_file_would_be_overwritten = - the input file "{$path}" would be overwritten by the generated executable - -interface_generated_file_conflicts_with_directory = - the generated executable for the input file "{$input_path}" conflicts with the existing directory "{$dir_path}" - -interface_temps_dir_error = - failed to find or create the directory specified by `--temps-dir` - -interface_out_dir_error = - failed to find or create the directory specified by `--out-dir` - -interface_cant_emit_mir = - could not emit MIR: {$error} - -interface_rustc_error_fatal = - fatal error triggered by #[rustc_error] - -interface_rustc_error_unexpected_annotation = - unexpected annotation used with `#[rustc_error(...)]`! - -interface_failed_writing_file = - failed to write file {$path}: {$error}" - -interface_proc_macro_crate_panic_abort = - building proc macro crate with `panic=abort` may crash the compiler should the proc-macro panic - -interface_unsupported_crate_type_for_target = - dropping unsupported crate type `{$crate_type}` for target `{$target_triple}` - -interface_multiple_output_types_adaption = - due to multiple output types requested, the explicitly specified output file name will be adapted for each output type - -interface_ignoring_extra_filename = ignoring -C extra-filename flag due to -o flag - -interface_ignoring_out_dir = ignoring --out-dir flag due to -o flag diff --git a/compiler/rustc_interface/messages.ftl b/compiler/rustc_interface/messages.ftl new file mode 100644 index 00000000000..37994899a20 --- /dev/null +++ b/compiler/rustc_interface/messages.ftl @@ -0,0 +1,52 @@ +interface_ferris_identifier = + Ferris cannot be used as an identifier + .suggestion = try using their name instead + +interface_emoji_identifier = + identifiers cannot contain emoji: `{$ident}` + +interface_mixed_bin_crate = + cannot mix `bin` crate type with others + +interface_mixed_proc_macro_crate = + cannot mix `proc-macro` crate type with others + +interface_error_writing_dependencies = + error writing dependencies to `{$path}`: {$error} + +interface_input_file_would_be_overwritten = + the input file "{$path}" would be overwritten by the generated executable + +interface_generated_file_conflicts_with_directory = + the generated executable for the input file "{$input_path}" conflicts with the existing directory "{$dir_path}" + +interface_temps_dir_error = + failed to find or create the directory specified by `--temps-dir` + +interface_out_dir_error = + failed to find or create the directory specified by `--out-dir` + +interface_cant_emit_mir = + could not emit MIR: {$error} + +interface_rustc_error_fatal = + fatal error triggered by #[rustc_error] + +interface_rustc_error_unexpected_annotation = + unexpected annotation used with `#[rustc_error(...)]`! + +interface_failed_writing_file = + failed to write file {$path}: {$error}" + +interface_proc_macro_crate_panic_abort = + building proc macro crate with `panic=abort` may crash the compiler should the proc-macro panic + +interface_unsupported_crate_type_for_target = + dropping unsupported crate type `{$crate_type}` for target `{$target_triple}` + +interface_multiple_output_types_adaption = + due to multiple output types requested, the explicitly specified output file name will be adapted for each output type + +interface_ignoring_extra_filename = ignoring -C extra-filename flag due to -o flag + +interface_ignoring_out_dir = ignoring --out-dir flag due to -o flag diff --git a/compiler/rustc_interface/src/lib.rs b/compiler/rustc_interface/src/lib.rs index 1abbe8d4fab..15e02671075 100644 --- a/compiler/rustc_interface/src/lib.rs +++ b/compiler/rustc_interface/src/lib.rs @@ -31,4 +31,4 @@ pub use queries::Queries; #[cfg(test)] mod tests; -fluent_messages! { "../locales/en-US.ftl" } +fluent_messages! { "../messages.ftl" } diff --git a/compiler/rustc_lint/locales/en-US.ftl b/compiler/rustc_lint/locales/en-US.ftl deleted file mode 100644 index 68e62c9789a..00000000000 --- a/compiler/rustc_lint/locales/en-US.ftl +++ /dev/null @@ -1,510 +0,0 @@ -lint_array_into_iter = - this method call resolves to `<&{$target} as IntoIterator>::into_iter` (due to backwards compatibility), but will resolve to <{$target} as IntoIterator>::into_iter in Rust 2021 - .use_iter_suggestion = use `.iter()` instead of `.into_iter()` to avoid ambiguity - .remove_into_iter_suggestion = or remove `.into_iter()` to iterate by value - .use_explicit_into_iter_suggestion = - or use `IntoIterator::into_iter(..)` instead of `.into_iter()` to explicitly iterate by value - -lint_enum_intrinsics_mem_discriminant = - the return value of `mem::discriminant` is unspecified when called with a non-enum type - .note = the argument to `discriminant` should be a reference to an enum, but it was passed a reference to a `{$ty_param}`, which is not an enum. - -lint_enum_intrinsics_mem_variant = - the return value of `mem::variant_count` is unspecified when called with a non-enum type - .note = the type parameter of `variant_count` should be an enum, but it was instantiated with the type `{$ty_param}`, which is not an enum. - -lint_expectation = this lint expectation is unfulfilled - .note = the `unfulfilled_lint_expectations` lint can't be expected and will always produce this message - .rationale = {$rationale} - -lint_for_loops_over_fallibles = - for loop over {$article} `{$ty}`. This is more readably written as an `if let` statement - .suggestion = consider using `if let` to clear intent - .remove_next = to iterate over `{$recv_snip}` remove the call to `next` - .use_while_let = to check pattern in a loop use `while let` - .use_question_mark = consider unwrapping the `Result` with `?` to iterate over its contents - -lint_map_unit_fn = `Iterator::map` call that discard the iterator's values - .note = `Iterator::map`, like many of the methods on `Iterator`, gets executed lazily, meaning that its effects won't be visible until it is iterated - .function_label = this function returns `()`, which is likely not what you wanted - .argument_label = called `Iterator::map` with callable that returns `()` - .map_label = after this call to map, the resulting iterator is `impl Iterator`, which means the only information carried by the iterator is the number of items - .suggestion = you might have meant to use `Iterator::for_each` - -lint_non_binding_let_on_sync_lock = - non-binding let on a synchronization lock - -lint_non_binding_let_on_drop_type = - non-binding let on a type that implements `Drop` - -lint_non_binding_let_suggestion = - consider binding to an unused variable to avoid immediately dropping the value - -lint_non_binding_let_multi_suggestion = - consider immediately dropping the value - -lint_deprecated_lint_name = - lint name `{$name}` is deprecated and may not have an effect in the future. - .suggestion = change it to - -lint_renamed_or_removed_lint = {$msg} - .suggestion = use the new name - -lint_unknown_lint = - unknown lint: `{$name}` - .suggestion = did you mean - -lint_ignored_unless_crate_specified = {$level}({$name}) is ignored unless specified at crate level - -lint_unknown_gated_lint = - unknown lint: `{$name}` - .note = the `{$name}` lint is unstable - -lint_hidden_unicode_codepoints = unicode codepoint changing visible direction of text present in {$label} - .label = this {$label} contains {$count -> - [one] an invisible - *[other] invisible - } unicode text flow control {$count -> - [one] codepoint - *[other] codepoints - } - .note = these kind of unicode codepoints change the way text flows on applications that support them, but can cause confusion because they change the order of characters on the screen - .suggestion_remove = if their presence wasn't intentional, you can remove them - .suggestion_escape = if you want to keep them but make them visible in your source code, you can escape them - .no_suggestion_note_escape = if you want to keep them but make them visible in your source code, you can escape them: {$escaped} - -lint_default_hash_types = prefer `{$preferred}` over `{$used}`, it has better performance - .note = a `use rustc_data_structures::fx::{$preferred}` may be necessary - -lint_query_instability = using `{$query}` can result in unstable query results - .note = if you believe this case to be fine, allow this lint and add a comment explaining your rationale - -lint_tykind_kind = usage of `ty::TyKind::` - .suggestion = try using `ty::` directly - -lint_tykind = usage of `ty::TyKind` - .help = try using `Ty` instead - -lint_ty_qualified = usage of qualified `ty::{$ty}` - .suggestion = try importing it and using it unqualified - -lint_lintpass_by_hand = implementing `LintPass` by hand - .help = try using `declare_lint_pass!` or `impl_lint_pass!` instead - -lint_non_existant_doc_keyword = found non-existing keyword `{$keyword}` used in `#[doc(keyword = \"...\")]` - .help = only existing keywords are allowed in core/std - -lint_diag_out_of_impl = - diagnostics should only be created in `IntoDiagnostic`/`AddToDiagnostic` impls - -lint_untranslatable_diag = diagnostics should be created using translatable messages - -lint_bad_opt_access = {$msg} - -lint_cstring_ptr = getting the inner pointer of a temporary `CString` - .as_ptr_label = this pointer will be invalid - .unwrap_label = this `CString` is deallocated at the end of the statement, bind it to a variable to extend its lifetime - .note = pointers do not have a lifetime; when calling `as_ptr` the `CString` will be deallocated at the end of the statement because nothing is referencing it as far as the type system is concerned - .help = for more information, see https://doc.rust-lang.org/reference/destructors.html - -lint_multple_supertrait_upcastable = `{$ident}` is object-safe and has multiple supertraits - -lint_identifier_non_ascii_char = identifier contains non-ASCII characters - -lint_identifier_uncommon_codepoints = identifier contains uncommon Unicode codepoints - -lint_confusable_identifier_pair = identifier pair considered confusable between `{$existing_sym}` and `{$sym}` - .label = this is where the previous identifier occurred - -lint_mixed_script_confusables = - the usage of Script Group `{$set}` in this crate consists solely of mixed script confusables - .includes_note = the usage includes {$includes} - .note = please recheck to make sure their usages are indeed what you want - -lint_non_fmt_panic = panic message is not a string literal - .note = this usage of `{$name}!()` is deprecated; it will be a hard error in Rust 2021 - .more_info_note = for more information, see - .supports_fmt_note = the `{$name}!()` macro supports formatting, so there's no need for the `format!()` macro here - .supports_fmt_suggestion = remove the `format!(..)` macro call - .display_suggestion = add a "{"{"}{"}"}" format string to `Display` the message - .debug_suggestion = - add a "{"{"}:?{"}"}" format string to use the `Debug` implementation of `{$ty}` - .panic_suggestion = {$already_suggested -> - [true] or use - *[false] use - } std::panic::panic_any instead - -lint_non_fmt_panic_unused = - panic message contains {$count -> - [one] an unused - *[other] unused - } formatting {$count -> - [one] placeholder - *[other] placeholders - } - .note = this message is not used as a format string when given without arguments, but will be in Rust 2021 - .add_args_suggestion = add the missing {$count -> - [one] argument - *[other] arguments - } - .add_fmt_suggestion = or add a "{"{"}{"}"}" format string to use the message literally - -lint_non_fmt_panic_braces = - panic message contains {$count -> - [one] a brace - *[other] braces - } - .note = this message is not used as a format string, but will be in Rust 2021 - .suggestion = add a "{"{"}{"}"}" format string to use the message literally - -lint_non_camel_case_type = {$sort} `{$name}` should have an upper camel case name - .suggestion = convert the identifier to upper camel case - .label = should have an UpperCamelCase name - -lint_non_snake_case = {$sort} `{$name}` should have a snake case name - .rename_or_convert_suggestion = rename the identifier or convert it to a snake case raw identifier - .cannot_convert_note = `{$sc}` cannot be used as a raw identifier - .rename_suggestion = rename the identifier - .convert_suggestion = convert the identifier to snake case - .help = convert the identifier to snake case: `{$sc}` - .label = should have a snake_case name - -lint_non_upper_case_global = {$sort} `{$name}` should have an upper case name - .suggestion = convert the identifier to upper case - .label = should have an UPPER_CASE name - -lint_noop_method_call = call to `.{$method}()` on a reference in this situation does nothing - .label = unnecessary method call - .note = the type `{$receiver_ty}` which `{$method}` is being called on is the same as the type returned from `{$method}`, so the method call does not do anything and can be removed - -lint_pass_by_value = passing `{$ty}` by reference - .suggestion = try passing by value - -lint_redundant_semicolons = - unnecessary trailing {$multiple -> - [true] semicolons - *[false] semicolon - } - .suggestion = remove {$multiple -> - [true] these semicolons - *[false] this semicolon - } - -lint_drop_trait_constraints = - bounds on `{$predicate}` are most likely incorrect, consider instead using `{$needs_drop}` to detect whether a type can be trivially dropped - -lint_drop_glue = - types that do not implement `Drop` can still have drop glue, consider instead using `{$needs_drop}` to detect whether a type is trivially dropped - -lint_range_endpoint_out_of_range = range endpoint is out of range for `{$ty}` - .suggestion = use an inclusive range instead - -lint_overflowing_bin_hex = literal out of range for `{$ty}` - .negative_note = the literal `{$lit}` (decimal `{$dec}`) does not fit into the type `{$ty}` - .negative_becomes_note = and the value `-{$lit}` will become `{$actually}{$ty}` - .positive_note = the literal `{$lit}` (decimal `{$dec}`) does not fit into the type `{$ty}` and will become `{$actually}{$ty}` - .suggestion = consider using the type `{$suggestion_ty}` instead - .help = consider using the type `{$suggestion_ty}` instead - -lint_overflowing_int = literal out of range for `{$ty}` - .note = the literal `{$lit}` does not fit into the type `{$ty}` whose range is `{$min}..={$max}` - .help = consider using the type `{$suggestion_ty}` instead - -lint_only_cast_u8_to_char = only `u8` can be cast into `char` - .suggestion = use a `char` literal instead - -lint_overflowing_uint = literal out of range for `{$ty}` - .note = the literal `{$lit}` does not fit into the type `{$ty}` whose range is `{$min}..={$max}` - -lint_overflowing_literal = literal out of range for `{$ty}` - .note = the literal `{$lit}` does not fit into the type `{$ty}` and will be converted to `{$ty}::INFINITY` - -lint_unused_comparisons = comparison is useless due to type limits - -lint_improper_ctypes = `extern` {$desc} uses type `{$ty}`, which is not FFI-safe - .label = not FFI-safe - .note = the type is defined here - -lint_improper_ctypes_opaque = opaque types have no C equivalent - -lint_improper_ctypes_fnptr_reason = this function pointer has Rust-specific calling convention -lint_improper_ctypes_fnptr_help = consider using an `extern fn(...) -> ...` function pointer instead - -lint_improper_ctypes_tuple_reason = tuples have unspecified layout -lint_improper_ctypes_tuple_help = consider using a struct instead - -lint_improper_ctypes_str_reason = string slices have no C equivalent -lint_improper_ctypes_str_help = consider using `*const u8` and a length instead - -lint_improper_ctypes_dyn = trait objects have no C equivalent - -lint_improper_ctypes_slice_reason = slices have no C equivalent -lint_improper_ctypes_slice_help = consider using a raw pointer instead - -lint_improper_ctypes_128bit = 128-bit integers don't currently have a known stable ABI - -lint_improper_ctypes_char_reason = the `char` type has no C equivalent -lint_improper_ctypes_char_help = consider using `u32` or `libc::wchar_t` instead - -lint_improper_ctypes_non_exhaustive = this enum is non-exhaustive -lint_improper_ctypes_non_exhaustive_variant = this enum has non-exhaustive variants - -lint_improper_ctypes_enum_repr_reason = enum has no representation hint -lint_improper_ctypes_enum_repr_help = - consider adding a `#[repr(C)]`, `#[repr(transparent)]`, or integer `#[repr(...)]` attribute to this enum - -lint_improper_ctypes_struct_fieldless_reason = this struct has no fields -lint_improper_ctypes_struct_fieldless_help = consider adding a member to this struct - -lint_improper_ctypes_union_fieldless_reason = this union has no fields -lint_improper_ctypes_union_fieldless_help = consider adding a member to this union - -lint_improper_ctypes_struct_non_exhaustive = this struct is non-exhaustive -lint_improper_ctypes_union_non_exhaustive = this union is non-exhaustive - -lint_improper_ctypes_struct_layout_reason = this struct has unspecified layout -lint_improper_ctypes_struct_layout_help = consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct - -lint_improper_ctypes_union_layout_reason = this union has unspecified layout -lint_improper_ctypes_union_layout_help = consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this union - -lint_improper_ctypes_box = box cannot be represented as a single pointer - -lint_improper_ctypes_enum_phantomdata = this enum contains a PhantomData field - -lint_improper_ctypes_struct_zst = this struct contains only zero-sized fields - -lint_improper_ctypes_array_reason = passing raw arrays by value is not FFI-safe -lint_improper_ctypes_array_help = consider passing a pointer to the array - -lint_improper_ctypes_only_phantomdata = composed only of `PhantomData` - -lint_variant_size_differences = - enum variant is more than three times larger ({$largest} bytes) than the next largest - -lint_atomic_ordering_load = atomic loads cannot have `Release` or `AcqRel` ordering - .help = consider using ordering modes `Acquire`, `SeqCst` or `Relaxed` - -lint_atomic_ordering_store = atomic stores cannot have `Acquire` or `AcqRel` ordering - .help = consider using ordering modes `Release`, `SeqCst` or `Relaxed` - -lint_atomic_ordering_fence = memory fences cannot have `Relaxed` ordering - .help = consider using ordering modes `Acquire`, `Release`, `AcqRel` or `SeqCst` - -lint_atomic_ordering_invalid = `{$method}`'s failure ordering may not be `Release` or `AcqRel`, since a failed `{$method}` does not result in a write - .label = invalid failure ordering - .help = consider using `Acquire` or `Relaxed` failure ordering instead - -lint_unused_op = unused {$op} that must be used - .label = the {$op} produces a value - .suggestion = use `let _ = ...` to ignore the resulting value - -lint_unused_result = unused result of type `{$ty}` - -lint_unused_closure = - unused {$pre}{$count -> - [one] closure - *[other] closures - }{$post} that must be used - .note = closures are lazy and do nothing unless called - -lint_unused_generator = - unused {$pre}{$count -> - [one] generator - *[other] generator - }{$post} that must be used - .note = generators are lazy and do nothing unless resumed - -lint_unused_def = unused {$pre}`{$def}`{$post} that must be used - .suggestion = use `let _ = ...` to ignore the resulting value - -lint_path_statement_drop = path statement drops value - .suggestion = use `drop` to clarify the intent - -lint_path_statement_no_effect = path statement with no effect - -lint_unused_delim = unnecessary {$delim} around {$item} - .suggestion = remove these {$delim} - -lint_unused_import_braces = braces around {$node} is unnecessary - -lint_unused_allocation = unnecessary allocation, use `&` instead -lint_unused_allocation_mut = unnecessary allocation, use `&mut` instead - -lint_builtin_while_true = denote infinite loops with `loop {"{"} ... {"}"}` - .suggestion = use `loop` - -lint_builtin_box_pointers = type uses owned (Box type) pointers: {$ty} - -lint_builtin_non_shorthand_field_patterns = the `{$ident}:` in this pattern is redundant - .suggestion = use shorthand field pattern - -lint_builtin_overridden_symbol_name = - the linker's behavior with multiple libraries exporting duplicate symbol names is undefined and Rust cannot provide guarantees when you manually override them - -lint_builtin_overridden_symbol_section = - the program's behavior with overridden link sections on items is unpredictable and Rust cannot provide guarantees when you manually override them - -lint_builtin_allow_internal_unsafe = - `allow_internal_unsafe` allows defining macros using unsafe without triggering the `unsafe_code` lint at their call site - -lint_builtin_unsafe_block = usage of an `unsafe` block - -lint_builtin_unsafe_trait = declaration of an `unsafe` trait - -lint_builtin_unsafe_impl = implementation of an `unsafe` trait - -lint_builtin_no_mangle_fn = declaration of a `no_mangle` function -lint_builtin_export_name_fn = declaration of a function with `export_name` -lint_builtin_link_section_fn = declaration of a function with `link_section` - -lint_builtin_no_mangle_static = declaration of a `no_mangle` static -lint_builtin_export_name_static = declaration of a static with `export_name` -lint_builtin_link_section_static = declaration of a static with `link_section` - -lint_builtin_no_mangle_method = declaration of a `no_mangle` method -lint_builtin_export_name_method = declaration of a method with `export_name` - -lint_builtin_decl_unsafe_fn = declaration of an `unsafe` function -lint_builtin_decl_unsafe_method = declaration of an `unsafe` method -lint_builtin_impl_unsafe_method = implementation of an `unsafe` method - -lint_builtin_missing_doc = missing documentation for {$article} {$desc} - -lint_builtin_missing_copy_impl = type could implement `Copy`; consider adding `impl Copy` - -lint_builtin_missing_debug_impl = - type does not implement `{$debug}`; consider adding `#[derive(Debug)]` or a manual implementation - -lint_builtin_anonymous_params = anonymous parameters are deprecated and will be removed in the next edition - .suggestion = try naming the parameter or explicitly ignoring it - -lint_builtin_deprecated_attr_link = use of deprecated attribute `{$name}`: {$reason}. See {$link} - .msg_suggestion = {$msg} - .default_suggestion = remove this attribute -lint_builtin_deprecated_attr_used = use of deprecated attribute `{$name}`: no longer used. -lint_builtin_deprecated_attr_default_suggestion = remove this attribute - -lint_builtin_unused_doc_comment = unused doc comment - .label = rustdoc does not generate documentation for {$kind} - .plain_help = use `//` for a plain comment - .block_help = use `/* */` for a plain comment - -lint_builtin_no_mangle_generic = functions generic over types or consts must be mangled - .suggestion = remove this attribute - -lint_builtin_const_no_mangle = const items should never be `#[no_mangle]` - .suggestion = try a static value - -lint_builtin_mutable_transmutes = - transmuting &T to &mut T is undefined behavior, even if the reference is unused, consider instead using an UnsafeCell - -lint_builtin_unstable_features = unstable feature - -lint_ungated_async_fn_track_caller = `#[track_caller]` on async functions is a no-op - .label = this function will not propagate the caller location - -lint_builtin_unreachable_pub = unreachable `pub` {$what} - .suggestion = consider restricting its visibility - .help = or consider exporting it for use by other crates - -lint_builtin_unexpected_cli_config_name = unexpected `{$name}` as condition name - .help = was set with `--cfg` but isn't in the `--check-cfg` expected names - -lint_builtin_unexpected_cli_config_value = unexpected condition value `{$value}` for condition name `{$name}` - .help = was set with `--cfg` but isn't in the `--check-cfg` expected values - -lint_builtin_type_alias_bounds_help = use fully disambiguated paths (i.e., `::Assoc`) to refer to associated types in type aliases - -lint_builtin_type_alias_where_clause = where clauses are not enforced in type aliases - .suggestion = the clause will not be checked when the type alias is used, and should be removed - -lint_builtin_type_alias_generic_bounds = bounds on generic parameters are not enforced in type aliases - .suggestion = the bound will not be checked when the type alias is used, and should be removed - -lint_builtin_trivial_bounds = {$predicate_kind_name} bound {$predicate} does not depend on any type or lifetime parameters - -lint_builtin_ellipsis_inclusive_range_patterns = `...` range patterns are deprecated - .suggestion = use `..=` for an inclusive range - -lint_builtin_unnameable_test_items = cannot test inner items - -lint_builtin_keyword_idents = `{$kw}` is a keyword in the {$next} edition - .suggestion = you can use a raw identifier to stay compatible - -lint_builtin_explicit_outlives = outlives requirements can be inferred - .suggestion = remove {$count -> - [one] this bound - *[other] these bounds - } - -lint_builtin_incomplete_features = the feature `{$name}` is incomplete and may not be safe to use and/or cause compiler crashes - .note = see issue #{$n} for more information - .help = consider using `min_{$name}` instead, which is more stable and complete - -lint_builtin_unpermitted_type_init_zeroed = the type `{$ty}` does not permit zero-initialization -lint_builtin_unpermitted_type_init_unint = the type `{$ty}` does not permit being left uninitialized - -lint_builtin_unpermitted_type_init_label = this code causes undefined behavior when executed -lint_builtin_unpermitted_type_init_label_suggestion = help: use `MaybeUninit` instead, and only call `assume_init` after initialization is done - -lint_builtin_clashing_extern_same_name = `{$this}` redeclared with a different signature - .previous_decl_label = `{$orig}` previously declared here - .mismatch_label = this signature doesn't match the previous declaration -lint_builtin_clashing_extern_diff_name = `{$this}` redeclares `{$orig}` with a different signature - .previous_decl_label = `{$orig}` previously declared here - .mismatch_label = this signature doesn't match the previous declaration - -lint_builtin_deref_nullptr = dereferencing a null pointer - .label = this code causes undefined behavior when executed - -lint_builtin_asm_labels = avoid using named labels in inline assembly - -lint_builtin_special_module_name_used_lib = found module declaration for lib.rs - .note = lib.rs is the root of this crate's library target - .help = to refer to it from other targets, use the library's name as the path - -lint_builtin_special_module_name_used_main = found module declaration for main.rs - .note = a binary crate cannot be used as library - -lint_supertrait_as_deref_target = `{$t}` implements `Deref` with supertrait `{$target_principal}` as target - .label = target type is set here - -lint_overruled_attribute = {$lint_level}({$lint_source}) incompatible with previous forbid - .label = overruled by previous forbid - -lint_default_source = `forbid` lint level is the default for {$id} - -lint_node_source = `forbid` level set here - .note = {$reason} - -lint_command_line_source = `forbid` lint level was set on command line - -lint_malformed_attribute = malformed lint attribute input - -lint_bad_attribute_argument = bad attribute argument - -lint_reason_must_be_string_literal = reason must be a string literal - -lint_reason_must_come_last = reason in lint attribute must come last - -lint_unknown_tool_in_scoped_lint = unknown tool name `{$tool_name}` found in scoped lint: `{$tool_name}::{$lint_name}` - .help = add `#![register_tool({$tool_name})]` to the crate root - -lint_unsupported_group = `{$lint_group}` lint group is not supported with ´--force-warn´ - -lint_requested_level = requested on the command line with `{$level} {$lint_name}` - -lint_check_name_unknown = unknown lint: `{$lint_name}` - .help = did you mean: `{$suggestion}` - -lint_check_name_unknown_tool = unknown lint tool: `{$tool_name}` - -lint_check_name_warning = {$msg} - -lint_check_name_deprecated = lint name `{$lint_name}` is deprecated and does not have an effect anymore. Use: {$new_name} - -lint_opaque_hidden_inferred_bound = opaque type `{$ty}` does not satisfy its associated type bounds - .specifically = this associated type bound is unsatisfied for `{$proj_ty}` - -lint_opaque_hidden_inferred_bound_sugg = add this bound diff --git a/compiler/rustc_lint/messages.ftl b/compiler/rustc_lint/messages.ftl new file mode 100644 index 00000000000..68e62c9789a --- /dev/null +++ b/compiler/rustc_lint/messages.ftl @@ -0,0 +1,510 @@ +lint_array_into_iter = + this method call resolves to `<&{$target} as IntoIterator>::into_iter` (due to backwards compatibility), but will resolve to <{$target} as IntoIterator>::into_iter in Rust 2021 + .use_iter_suggestion = use `.iter()` instead of `.into_iter()` to avoid ambiguity + .remove_into_iter_suggestion = or remove `.into_iter()` to iterate by value + .use_explicit_into_iter_suggestion = + or use `IntoIterator::into_iter(..)` instead of `.into_iter()` to explicitly iterate by value + +lint_enum_intrinsics_mem_discriminant = + the return value of `mem::discriminant` is unspecified when called with a non-enum type + .note = the argument to `discriminant` should be a reference to an enum, but it was passed a reference to a `{$ty_param}`, which is not an enum. + +lint_enum_intrinsics_mem_variant = + the return value of `mem::variant_count` is unspecified when called with a non-enum type + .note = the type parameter of `variant_count` should be an enum, but it was instantiated with the type `{$ty_param}`, which is not an enum. + +lint_expectation = this lint expectation is unfulfilled + .note = the `unfulfilled_lint_expectations` lint can't be expected and will always produce this message + .rationale = {$rationale} + +lint_for_loops_over_fallibles = + for loop over {$article} `{$ty}`. This is more readably written as an `if let` statement + .suggestion = consider using `if let` to clear intent + .remove_next = to iterate over `{$recv_snip}` remove the call to `next` + .use_while_let = to check pattern in a loop use `while let` + .use_question_mark = consider unwrapping the `Result` with `?` to iterate over its contents + +lint_map_unit_fn = `Iterator::map` call that discard the iterator's values + .note = `Iterator::map`, like many of the methods on `Iterator`, gets executed lazily, meaning that its effects won't be visible until it is iterated + .function_label = this function returns `()`, which is likely not what you wanted + .argument_label = called `Iterator::map` with callable that returns `()` + .map_label = after this call to map, the resulting iterator is `impl Iterator`, which means the only information carried by the iterator is the number of items + .suggestion = you might have meant to use `Iterator::for_each` + +lint_non_binding_let_on_sync_lock = + non-binding let on a synchronization lock + +lint_non_binding_let_on_drop_type = + non-binding let on a type that implements `Drop` + +lint_non_binding_let_suggestion = + consider binding to an unused variable to avoid immediately dropping the value + +lint_non_binding_let_multi_suggestion = + consider immediately dropping the value + +lint_deprecated_lint_name = + lint name `{$name}` is deprecated and may not have an effect in the future. + .suggestion = change it to + +lint_renamed_or_removed_lint = {$msg} + .suggestion = use the new name + +lint_unknown_lint = + unknown lint: `{$name}` + .suggestion = did you mean + +lint_ignored_unless_crate_specified = {$level}({$name}) is ignored unless specified at crate level + +lint_unknown_gated_lint = + unknown lint: `{$name}` + .note = the `{$name}` lint is unstable + +lint_hidden_unicode_codepoints = unicode codepoint changing visible direction of text present in {$label} + .label = this {$label} contains {$count -> + [one] an invisible + *[other] invisible + } unicode text flow control {$count -> + [one] codepoint + *[other] codepoints + } + .note = these kind of unicode codepoints change the way text flows on applications that support them, but can cause confusion because they change the order of characters on the screen + .suggestion_remove = if their presence wasn't intentional, you can remove them + .suggestion_escape = if you want to keep them but make them visible in your source code, you can escape them + .no_suggestion_note_escape = if you want to keep them but make them visible in your source code, you can escape them: {$escaped} + +lint_default_hash_types = prefer `{$preferred}` over `{$used}`, it has better performance + .note = a `use rustc_data_structures::fx::{$preferred}` may be necessary + +lint_query_instability = using `{$query}` can result in unstable query results + .note = if you believe this case to be fine, allow this lint and add a comment explaining your rationale + +lint_tykind_kind = usage of `ty::TyKind::` + .suggestion = try using `ty::` directly + +lint_tykind = usage of `ty::TyKind` + .help = try using `Ty` instead + +lint_ty_qualified = usage of qualified `ty::{$ty}` + .suggestion = try importing it and using it unqualified + +lint_lintpass_by_hand = implementing `LintPass` by hand + .help = try using `declare_lint_pass!` or `impl_lint_pass!` instead + +lint_non_existant_doc_keyword = found non-existing keyword `{$keyword}` used in `#[doc(keyword = \"...\")]` + .help = only existing keywords are allowed in core/std + +lint_diag_out_of_impl = + diagnostics should only be created in `IntoDiagnostic`/`AddToDiagnostic` impls + +lint_untranslatable_diag = diagnostics should be created using translatable messages + +lint_bad_opt_access = {$msg} + +lint_cstring_ptr = getting the inner pointer of a temporary `CString` + .as_ptr_label = this pointer will be invalid + .unwrap_label = this `CString` is deallocated at the end of the statement, bind it to a variable to extend its lifetime + .note = pointers do not have a lifetime; when calling `as_ptr` the `CString` will be deallocated at the end of the statement because nothing is referencing it as far as the type system is concerned + .help = for more information, see https://doc.rust-lang.org/reference/destructors.html + +lint_multple_supertrait_upcastable = `{$ident}` is object-safe and has multiple supertraits + +lint_identifier_non_ascii_char = identifier contains non-ASCII characters + +lint_identifier_uncommon_codepoints = identifier contains uncommon Unicode codepoints + +lint_confusable_identifier_pair = identifier pair considered confusable between `{$existing_sym}` and `{$sym}` + .label = this is where the previous identifier occurred + +lint_mixed_script_confusables = + the usage of Script Group `{$set}` in this crate consists solely of mixed script confusables + .includes_note = the usage includes {$includes} + .note = please recheck to make sure their usages are indeed what you want + +lint_non_fmt_panic = panic message is not a string literal + .note = this usage of `{$name}!()` is deprecated; it will be a hard error in Rust 2021 + .more_info_note = for more information, see + .supports_fmt_note = the `{$name}!()` macro supports formatting, so there's no need for the `format!()` macro here + .supports_fmt_suggestion = remove the `format!(..)` macro call + .display_suggestion = add a "{"{"}{"}"}" format string to `Display` the message + .debug_suggestion = + add a "{"{"}:?{"}"}" format string to use the `Debug` implementation of `{$ty}` + .panic_suggestion = {$already_suggested -> + [true] or use + *[false] use + } std::panic::panic_any instead + +lint_non_fmt_panic_unused = + panic message contains {$count -> + [one] an unused + *[other] unused + } formatting {$count -> + [one] placeholder + *[other] placeholders + } + .note = this message is not used as a format string when given without arguments, but will be in Rust 2021 + .add_args_suggestion = add the missing {$count -> + [one] argument + *[other] arguments + } + .add_fmt_suggestion = or add a "{"{"}{"}"}" format string to use the message literally + +lint_non_fmt_panic_braces = + panic message contains {$count -> + [one] a brace + *[other] braces + } + .note = this message is not used as a format string, but will be in Rust 2021 + .suggestion = add a "{"{"}{"}"}" format string to use the message literally + +lint_non_camel_case_type = {$sort} `{$name}` should have an upper camel case name + .suggestion = convert the identifier to upper camel case + .label = should have an UpperCamelCase name + +lint_non_snake_case = {$sort} `{$name}` should have a snake case name + .rename_or_convert_suggestion = rename the identifier or convert it to a snake case raw identifier + .cannot_convert_note = `{$sc}` cannot be used as a raw identifier + .rename_suggestion = rename the identifier + .convert_suggestion = convert the identifier to snake case + .help = convert the identifier to snake case: `{$sc}` + .label = should have a snake_case name + +lint_non_upper_case_global = {$sort} `{$name}` should have an upper case name + .suggestion = convert the identifier to upper case + .label = should have an UPPER_CASE name + +lint_noop_method_call = call to `.{$method}()` on a reference in this situation does nothing + .label = unnecessary method call + .note = the type `{$receiver_ty}` which `{$method}` is being called on is the same as the type returned from `{$method}`, so the method call does not do anything and can be removed + +lint_pass_by_value = passing `{$ty}` by reference + .suggestion = try passing by value + +lint_redundant_semicolons = + unnecessary trailing {$multiple -> + [true] semicolons + *[false] semicolon + } + .suggestion = remove {$multiple -> + [true] these semicolons + *[false] this semicolon + } + +lint_drop_trait_constraints = + bounds on `{$predicate}` are most likely incorrect, consider instead using `{$needs_drop}` to detect whether a type can be trivially dropped + +lint_drop_glue = + types that do not implement `Drop` can still have drop glue, consider instead using `{$needs_drop}` to detect whether a type is trivially dropped + +lint_range_endpoint_out_of_range = range endpoint is out of range for `{$ty}` + .suggestion = use an inclusive range instead + +lint_overflowing_bin_hex = literal out of range for `{$ty}` + .negative_note = the literal `{$lit}` (decimal `{$dec}`) does not fit into the type `{$ty}` + .negative_becomes_note = and the value `-{$lit}` will become `{$actually}{$ty}` + .positive_note = the literal `{$lit}` (decimal `{$dec}`) does not fit into the type `{$ty}` and will become `{$actually}{$ty}` + .suggestion = consider using the type `{$suggestion_ty}` instead + .help = consider using the type `{$suggestion_ty}` instead + +lint_overflowing_int = literal out of range for `{$ty}` + .note = the literal `{$lit}` does not fit into the type `{$ty}` whose range is `{$min}..={$max}` + .help = consider using the type `{$suggestion_ty}` instead + +lint_only_cast_u8_to_char = only `u8` can be cast into `char` + .suggestion = use a `char` literal instead + +lint_overflowing_uint = literal out of range for `{$ty}` + .note = the literal `{$lit}` does not fit into the type `{$ty}` whose range is `{$min}..={$max}` + +lint_overflowing_literal = literal out of range for `{$ty}` + .note = the literal `{$lit}` does not fit into the type `{$ty}` and will be converted to `{$ty}::INFINITY` + +lint_unused_comparisons = comparison is useless due to type limits + +lint_improper_ctypes = `extern` {$desc} uses type `{$ty}`, which is not FFI-safe + .label = not FFI-safe + .note = the type is defined here + +lint_improper_ctypes_opaque = opaque types have no C equivalent + +lint_improper_ctypes_fnptr_reason = this function pointer has Rust-specific calling convention +lint_improper_ctypes_fnptr_help = consider using an `extern fn(...) -> ...` function pointer instead + +lint_improper_ctypes_tuple_reason = tuples have unspecified layout +lint_improper_ctypes_tuple_help = consider using a struct instead + +lint_improper_ctypes_str_reason = string slices have no C equivalent +lint_improper_ctypes_str_help = consider using `*const u8` and a length instead + +lint_improper_ctypes_dyn = trait objects have no C equivalent + +lint_improper_ctypes_slice_reason = slices have no C equivalent +lint_improper_ctypes_slice_help = consider using a raw pointer instead + +lint_improper_ctypes_128bit = 128-bit integers don't currently have a known stable ABI + +lint_improper_ctypes_char_reason = the `char` type has no C equivalent +lint_improper_ctypes_char_help = consider using `u32` or `libc::wchar_t` instead + +lint_improper_ctypes_non_exhaustive = this enum is non-exhaustive +lint_improper_ctypes_non_exhaustive_variant = this enum has non-exhaustive variants + +lint_improper_ctypes_enum_repr_reason = enum has no representation hint +lint_improper_ctypes_enum_repr_help = + consider adding a `#[repr(C)]`, `#[repr(transparent)]`, or integer `#[repr(...)]` attribute to this enum + +lint_improper_ctypes_struct_fieldless_reason = this struct has no fields +lint_improper_ctypes_struct_fieldless_help = consider adding a member to this struct + +lint_improper_ctypes_union_fieldless_reason = this union has no fields +lint_improper_ctypes_union_fieldless_help = consider adding a member to this union + +lint_improper_ctypes_struct_non_exhaustive = this struct is non-exhaustive +lint_improper_ctypes_union_non_exhaustive = this union is non-exhaustive + +lint_improper_ctypes_struct_layout_reason = this struct has unspecified layout +lint_improper_ctypes_struct_layout_help = consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct + +lint_improper_ctypes_union_layout_reason = this union has unspecified layout +lint_improper_ctypes_union_layout_help = consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this union + +lint_improper_ctypes_box = box cannot be represented as a single pointer + +lint_improper_ctypes_enum_phantomdata = this enum contains a PhantomData field + +lint_improper_ctypes_struct_zst = this struct contains only zero-sized fields + +lint_improper_ctypes_array_reason = passing raw arrays by value is not FFI-safe +lint_improper_ctypes_array_help = consider passing a pointer to the array + +lint_improper_ctypes_only_phantomdata = composed only of `PhantomData` + +lint_variant_size_differences = + enum variant is more than three times larger ({$largest} bytes) than the next largest + +lint_atomic_ordering_load = atomic loads cannot have `Release` or `AcqRel` ordering + .help = consider using ordering modes `Acquire`, `SeqCst` or `Relaxed` + +lint_atomic_ordering_store = atomic stores cannot have `Acquire` or `AcqRel` ordering + .help = consider using ordering modes `Release`, `SeqCst` or `Relaxed` + +lint_atomic_ordering_fence = memory fences cannot have `Relaxed` ordering + .help = consider using ordering modes `Acquire`, `Release`, `AcqRel` or `SeqCst` + +lint_atomic_ordering_invalid = `{$method}`'s failure ordering may not be `Release` or `AcqRel`, since a failed `{$method}` does not result in a write + .label = invalid failure ordering + .help = consider using `Acquire` or `Relaxed` failure ordering instead + +lint_unused_op = unused {$op} that must be used + .label = the {$op} produces a value + .suggestion = use `let _ = ...` to ignore the resulting value + +lint_unused_result = unused result of type `{$ty}` + +lint_unused_closure = + unused {$pre}{$count -> + [one] closure + *[other] closures + }{$post} that must be used + .note = closures are lazy and do nothing unless called + +lint_unused_generator = + unused {$pre}{$count -> + [one] generator + *[other] generator + }{$post} that must be used + .note = generators are lazy and do nothing unless resumed + +lint_unused_def = unused {$pre}`{$def}`{$post} that must be used + .suggestion = use `let _ = ...` to ignore the resulting value + +lint_path_statement_drop = path statement drops value + .suggestion = use `drop` to clarify the intent + +lint_path_statement_no_effect = path statement with no effect + +lint_unused_delim = unnecessary {$delim} around {$item} + .suggestion = remove these {$delim} + +lint_unused_import_braces = braces around {$node} is unnecessary + +lint_unused_allocation = unnecessary allocation, use `&` instead +lint_unused_allocation_mut = unnecessary allocation, use `&mut` instead + +lint_builtin_while_true = denote infinite loops with `loop {"{"} ... {"}"}` + .suggestion = use `loop` + +lint_builtin_box_pointers = type uses owned (Box type) pointers: {$ty} + +lint_builtin_non_shorthand_field_patterns = the `{$ident}:` in this pattern is redundant + .suggestion = use shorthand field pattern + +lint_builtin_overridden_symbol_name = + the linker's behavior with multiple libraries exporting duplicate symbol names is undefined and Rust cannot provide guarantees when you manually override them + +lint_builtin_overridden_symbol_section = + the program's behavior with overridden link sections on items is unpredictable and Rust cannot provide guarantees when you manually override them + +lint_builtin_allow_internal_unsafe = + `allow_internal_unsafe` allows defining macros using unsafe without triggering the `unsafe_code` lint at their call site + +lint_builtin_unsafe_block = usage of an `unsafe` block + +lint_builtin_unsafe_trait = declaration of an `unsafe` trait + +lint_builtin_unsafe_impl = implementation of an `unsafe` trait + +lint_builtin_no_mangle_fn = declaration of a `no_mangle` function +lint_builtin_export_name_fn = declaration of a function with `export_name` +lint_builtin_link_section_fn = declaration of a function with `link_section` + +lint_builtin_no_mangle_static = declaration of a `no_mangle` static +lint_builtin_export_name_static = declaration of a static with `export_name` +lint_builtin_link_section_static = declaration of a static with `link_section` + +lint_builtin_no_mangle_method = declaration of a `no_mangle` method +lint_builtin_export_name_method = declaration of a method with `export_name` + +lint_builtin_decl_unsafe_fn = declaration of an `unsafe` function +lint_builtin_decl_unsafe_method = declaration of an `unsafe` method +lint_builtin_impl_unsafe_method = implementation of an `unsafe` method + +lint_builtin_missing_doc = missing documentation for {$article} {$desc} + +lint_builtin_missing_copy_impl = type could implement `Copy`; consider adding `impl Copy` + +lint_builtin_missing_debug_impl = + type does not implement `{$debug}`; consider adding `#[derive(Debug)]` or a manual implementation + +lint_builtin_anonymous_params = anonymous parameters are deprecated and will be removed in the next edition + .suggestion = try naming the parameter or explicitly ignoring it + +lint_builtin_deprecated_attr_link = use of deprecated attribute `{$name}`: {$reason}. See {$link} + .msg_suggestion = {$msg} + .default_suggestion = remove this attribute +lint_builtin_deprecated_attr_used = use of deprecated attribute `{$name}`: no longer used. +lint_builtin_deprecated_attr_default_suggestion = remove this attribute + +lint_builtin_unused_doc_comment = unused doc comment + .label = rustdoc does not generate documentation for {$kind} + .plain_help = use `//` for a plain comment + .block_help = use `/* */` for a plain comment + +lint_builtin_no_mangle_generic = functions generic over types or consts must be mangled + .suggestion = remove this attribute + +lint_builtin_const_no_mangle = const items should never be `#[no_mangle]` + .suggestion = try a static value + +lint_builtin_mutable_transmutes = + transmuting &T to &mut T is undefined behavior, even if the reference is unused, consider instead using an UnsafeCell + +lint_builtin_unstable_features = unstable feature + +lint_ungated_async_fn_track_caller = `#[track_caller]` on async functions is a no-op + .label = this function will not propagate the caller location + +lint_builtin_unreachable_pub = unreachable `pub` {$what} + .suggestion = consider restricting its visibility + .help = or consider exporting it for use by other crates + +lint_builtin_unexpected_cli_config_name = unexpected `{$name}` as condition name + .help = was set with `--cfg` but isn't in the `--check-cfg` expected names + +lint_builtin_unexpected_cli_config_value = unexpected condition value `{$value}` for condition name `{$name}` + .help = was set with `--cfg` but isn't in the `--check-cfg` expected values + +lint_builtin_type_alias_bounds_help = use fully disambiguated paths (i.e., `::Assoc`) to refer to associated types in type aliases + +lint_builtin_type_alias_where_clause = where clauses are not enforced in type aliases + .suggestion = the clause will not be checked when the type alias is used, and should be removed + +lint_builtin_type_alias_generic_bounds = bounds on generic parameters are not enforced in type aliases + .suggestion = the bound will not be checked when the type alias is used, and should be removed + +lint_builtin_trivial_bounds = {$predicate_kind_name} bound {$predicate} does not depend on any type or lifetime parameters + +lint_builtin_ellipsis_inclusive_range_patterns = `...` range patterns are deprecated + .suggestion = use `..=` for an inclusive range + +lint_builtin_unnameable_test_items = cannot test inner items + +lint_builtin_keyword_idents = `{$kw}` is a keyword in the {$next} edition + .suggestion = you can use a raw identifier to stay compatible + +lint_builtin_explicit_outlives = outlives requirements can be inferred + .suggestion = remove {$count -> + [one] this bound + *[other] these bounds + } + +lint_builtin_incomplete_features = the feature `{$name}` is incomplete and may not be safe to use and/or cause compiler crashes + .note = see issue #{$n} for more information + .help = consider using `min_{$name}` instead, which is more stable and complete + +lint_builtin_unpermitted_type_init_zeroed = the type `{$ty}` does not permit zero-initialization +lint_builtin_unpermitted_type_init_unint = the type `{$ty}` does not permit being left uninitialized + +lint_builtin_unpermitted_type_init_label = this code causes undefined behavior when executed +lint_builtin_unpermitted_type_init_label_suggestion = help: use `MaybeUninit` instead, and only call `assume_init` after initialization is done + +lint_builtin_clashing_extern_same_name = `{$this}` redeclared with a different signature + .previous_decl_label = `{$orig}` previously declared here + .mismatch_label = this signature doesn't match the previous declaration +lint_builtin_clashing_extern_diff_name = `{$this}` redeclares `{$orig}` with a different signature + .previous_decl_label = `{$orig}` previously declared here + .mismatch_label = this signature doesn't match the previous declaration + +lint_builtin_deref_nullptr = dereferencing a null pointer + .label = this code causes undefined behavior when executed + +lint_builtin_asm_labels = avoid using named labels in inline assembly + +lint_builtin_special_module_name_used_lib = found module declaration for lib.rs + .note = lib.rs is the root of this crate's library target + .help = to refer to it from other targets, use the library's name as the path + +lint_builtin_special_module_name_used_main = found module declaration for main.rs + .note = a binary crate cannot be used as library + +lint_supertrait_as_deref_target = `{$t}` implements `Deref` with supertrait `{$target_principal}` as target + .label = target type is set here + +lint_overruled_attribute = {$lint_level}({$lint_source}) incompatible with previous forbid + .label = overruled by previous forbid + +lint_default_source = `forbid` lint level is the default for {$id} + +lint_node_source = `forbid` level set here + .note = {$reason} + +lint_command_line_source = `forbid` lint level was set on command line + +lint_malformed_attribute = malformed lint attribute input + +lint_bad_attribute_argument = bad attribute argument + +lint_reason_must_be_string_literal = reason must be a string literal + +lint_reason_must_come_last = reason in lint attribute must come last + +lint_unknown_tool_in_scoped_lint = unknown tool name `{$tool_name}` found in scoped lint: `{$tool_name}::{$lint_name}` + .help = add `#![register_tool({$tool_name})]` to the crate root + +lint_unsupported_group = `{$lint_group}` lint group is not supported with ´--force-warn´ + +lint_requested_level = requested on the command line with `{$level} {$lint_name}` + +lint_check_name_unknown = unknown lint: `{$lint_name}` + .help = did you mean: `{$suggestion}` + +lint_check_name_unknown_tool = unknown lint tool: `{$tool_name}` + +lint_check_name_warning = {$msg} + +lint_check_name_deprecated = lint name `{$lint_name}` is deprecated and does not have an effect anymore. Use: {$new_name} + +lint_opaque_hidden_inferred_bound = opaque type `{$ty}` does not satisfy its associated type bounds + .specifically = this associated type bound is unsatisfied for `{$proj_ty}` + +lint_opaque_hidden_inferred_bound_sugg = add this bound diff --git a/compiler/rustc_lint/src/lib.rs b/compiler/rustc_lint/src/lib.rs index 35dc533e56c..b3578540516 100644 --- a/compiler/rustc_lint/src/lib.rs +++ b/compiler/rustc_lint/src/lib.rs @@ -126,7 +126,7 @@ pub use rustc_session::lint::Level::{self, *}; pub use rustc_session::lint::{BufferedEarlyLint, FutureIncompatibleInfo, Lint, LintId}; pub use rustc_session::lint::{LintArray, LintPass}; -fluent_messages! { "../locales/en-US.ftl" } +fluent_messages! { "../messages.ftl" } pub fn provide(providers: &mut Providers) { levels::provide(providers); diff --git a/compiler/rustc_metadata/locales/en-US.ftl b/compiler/rustc_metadata/locales/en-US.ftl deleted file mode 100644 index 79b8b417257..00000000000 --- a/compiler/rustc_metadata/locales/en-US.ftl +++ /dev/null @@ -1,288 +0,0 @@ -metadata_rlib_required = - crate `{$crate_name}` required to be available in rlib format, but was not found in this form - -metadata_lib_required = - crate `{$crate_name}` required to be available in {$kind} format, but was not found in this form - -metadata_rustc_lib_required = - crate `{$crate_name}` required to be available in {$kind} format, but was not found in this form - .note = only .rmeta files are distributed for `rustc_private` crates other than `rustc_driver` - .help = try adding `extern crate rustc_driver;` at the top level of this crate - -metadata_crate_dep_multiple = - cannot satisfy dependencies so `{$crate_name}` only shows up once - .help = having upstream crates all available in one format will likely make this go away - -metadata_two_panic_runtimes = - cannot link together two panic runtimes: {$prev_name} and {$cur_name} - -metadata_bad_panic_strategy = - the linked panic runtime `{$runtime}` is not compiled with this crate's panic strategy `{$strategy}` - -metadata_required_panic_strategy = - the crate `{$crate_name}` requires panic strategy `{$found_strategy}` which is incompatible with this crate's strategy of `{$desired_strategy}` - -metadata_incompatible_panic_in_drop_strategy = - the crate `{$crate_name}` is compiled with the panic-in-drop strategy `{$found_strategy}` which is incompatible with this crate's strategy of `{$desired_strategy}` - -metadata_multiple_names_in_link = - multiple `name` arguments in a single `#[link]` attribute - -metadata_multiple_kinds_in_link = - multiple `kind` arguments in a single `#[link]` attribute - -metadata_link_name_form = - link name must be of the form `name = "string"` - -metadata_link_kind_form = - link kind must be of the form `kind = "string"` - -metadata_link_modifiers_form = - link modifiers must be of the form `modifiers = "string"` - -metadata_link_cfg_form = - link cfg must be of the form `cfg(/* predicate */)` - -metadata_wasm_import_form = - wasm import module must be of the form `wasm_import_module = "string"` - -metadata_empty_link_name = - link name must not be empty - .label = empty link name - -metadata_link_framework_apple = - link kind `framework` is only supported on Apple targets - -metadata_framework_only_windows = - link kind `raw-dylib` is only supported on Windows targets - -metadata_unknown_link_kind = - unknown link kind `{$kind}`, expected one of: static, dylib, framework, raw-dylib - .label = unknown link kind - -metadata_multiple_link_modifiers = - multiple `modifiers` arguments in a single `#[link]` attribute - -metadata_multiple_cfgs = - multiple `cfg` arguments in a single `#[link]` attribute - -metadata_link_cfg_single_predicate = - link cfg must have a single predicate argument - -metadata_multiple_wasm_import = - multiple `wasm_import_module` arguments in a single `#[link]` attribute - -metadata_unexpected_link_arg = - unexpected `#[link]` argument, expected one of: name, kind, modifiers, cfg, wasm_import_module, import_name_type - -metadata_invalid_link_modifier = - invalid linking modifier syntax, expected '+' or '-' prefix before one of: bundle, verbatim, whole-archive, as-needed - -metadata_multiple_modifiers = - multiple `{$modifier}` modifiers in a single `modifiers` argument - -metadata_bundle_needs_static = - linking modifier `bundle` is only compatible with `static` linking kind - -metadata_whole_archive_needs_static = - linking modifier `whole-archive` is only compatible with `static` linking kind - -metadata_as_needed_compatibility = - linking modifier `as-needed` is only compatible with `dylib` and `framework` linking kinds - -metadata_unknown_link_modifier = - unknown linking modifier `{$modifier}`, expected one of: bundle, verbatim, whole-archive, as-needed - -metadata_incompatible_wasm_link = - `wasm_import_module` is incompatible with other arguments in `#[link]` attributes - -metadata_link_requires_name = - `#[link]` attribute requires a `name = "string"` argument - .label = missing `name` argument - -metadata_raw_dylib_no_nul = - link name must not contain NUL characters if link kind is `raw-dylib` - -metadata_link_ordinal_raw_dylib = - `#[link_ordinal]` is only supported if link kind is `raw-dylib` - -metadata_lib_framework_apple = - library kind `framework` is only supported on Apple targets - -metadata_empty_renaming_target = - an empty renaming target was specified for library `{$lib_name}` - -metadata_renaming_no_link = - renaming of the library `{$lib_name}` was specified, however this crate contains no `#[link(...)]` attributes referencing this library - -metadata_multiple_renamings = - multiple renamings were specified for library `{$lib_name}` - -metadata_no_link_mod_override = - overriding linking modifiers from command line is not supported - -metadata_unsupported_abi_i686 = - ABI not supported by `#[link(kind = "raw-dylib")]` on i686 - -metadata_unsupported_abi = - ABI not supported by `#[link(kind = "raw-dylib")]` on this architecture - -metadata_fail_create_file_encoder = - failed to create file encoder: {$err} - -metadata_fail_seek_file = - failed to seek the file: {$err} - -metadata_fail_write_file = - failed to write to the file: {$err} - -metadata_crate_not_panic_runtime = - the crate `{$crate_name}` is not a panic runtime - -metadata_no_panic_strategy = - the crate `{$crate_name}` does not have the panic strategy `{$strategy}` - -metadata_profiler_builtins_needs_core = - `profiler_builtins` crate (required by compiler options) is not compatible with crate attribute `#![no_core]` - -metadata_not_profiler_runtime = - the crate `{$crate_name}` is not a profiler runtime - -metadata_no_multiple_global_alloc = - cannot define multiple global allocators - .label = cannot define a new global allocator - -metadata_prev_global_alloc = - previous global allocator defined here - -metadata_no_multiple_alloc_error_handler = - cannot define multiple allocation error handlers - .label = cannot define a new allocation error handler - -metadata_prev_alloc_error_handler = - previous allocation error handler defined here - -metadata_conflicting_global_alloc = - the `#[global_allocator]` in {$other_crate_name} conflicts with global allocator in: {$crate_name} - -metadata_conflicting_alloc_error_handler = - the `#[alloc_error_handler]` in {$other_crate_name} conflicts with allocation error handler in: {$crate_name} - -metadata_global_alloc_required = - no global memory allocator found but one is required; link to std or add `#[global_allocator]` to a static item that implements the GlobalAlloc trait - -metadata_no_transitive_needs_dep = - the crate `{$crate_name}` cannot depend on a crate that needs {$needs_crate_name}, but it depends on `{$deps_crate_name}` - -metadata_failed_write_error = - failed to write {$filename}: {$err} - -metadata_missing_native_library = - could not find native static library `{$libname}`, perhaps an -L flag is missing? - -metadata_only_provide_library_name = only provide the library name `{$suggested_name}`, not the full filename - -metadata_failed_create_tempdir = - couldn't create a temp dir: {$err} - -metadata_failed_create_file = - failed to create the file {$filename}: {$err} - -metadata_failed_create_encoded_metadata = - failed to create encoded metadata from file: {$err} - -metadata_non_ascii_name = - cannot load a crate with a non-ascii name `{$crate_name}` - -metadata_extern_location_not_exist = - extern location for {$crate_name} does not exist: {$location} - -metadata_extern_location_not_file = - extern location for {$crate_name} is not a file: {$location} - -metadata_multiple_candidates = - multiple candidates for `{$flavor}` dependency `{$crate_name}` found - -metadata_symbol_conflicts_current = - the current crate is indistinguishable from one of its dependencies: it has the same crate-name `{$crate_name}` and was compiled with the same `-C metadata` arguments. This will result in symbol conflicts between the two. - -metadata_symbol_conflicts_others = - found two different crates with name `{$crate_name}` that are not distinguished by differing `-C metadata`. This will result in symbol conflicts between the two. - -metadata_stable_crate_id_collision = - found crates (`{$crate_name0}` and `{$crate_name1}`) with colliding StableCrateId values. - -metadata_dl_error = - {$err} - -metadata_newer_crate_version = - found possibly newer version of crate `{$crate_name}`{$add_info} - .note = perhaps that crate needs to be recompiled? - -metadata_found_crate_versions = - the following crate versions were found:{$found_crates} - -metadata_no_crate_with_triple = - couldn't find crate `{$crate_name}` with expected target triple {$locator_triple}{$add_info} - -metadata_found_staticlib = - found staticlib `{$crate_name}` instead of rlib or dylib{$add_info} - .help = please recompile that crate using --crate-type lib - -metadata_incompatible_rustc = - found crate `{$crate_name}` compiled by an incompatible version of rustc{$add_info} - .help = please recompile that crate using this compiler ({$rustc_version}) (consider running `cargo clean` first) - -metadata_invalid_meta_files = - found invalid metadata files for crate `{$crate_name}`{$add_info} - -metadata_cannot_find_crate = - can't find crate for `{$crate_name}`{$add_info} - -metadata_no_dylib_plugin = - plugin `{$crate_name}` only found in rlib format, but must be available in dylib format - -metadata_target_not_installed = - the `{$locator_triple}` target may not be installed - -metadata_target_no_std_support = - the `{$locator_triple}` target may not support the standard library - -metadata_consider_downloading_target = - consider downloading the target with `rustup target add {$locator_triple}` - -metadata_std_required = - `std` is required by `{$current_crate}` because it does not declare `#![no_std]` - -metadata_consider_building_std = - consider building the standard library from source with `cargo build -Zbuild-std` - -metadata_compiler_missing_profiler = - the compiler may have been built without the profiler runtime - -metadata_install_missing_components = - maybe you need to install the missing components with: `rustup component add rust-src rustc-dev llvm-tools-preview` - -metadata_cant_find_crate = - can't find crate - -metadata_crate_location_unknown_type = - extern location for {$crate_name} is of an unknown type: {$path} - -metadata_lib_filename_form = - file name should be lib*.rlib or {$dll_prefix}*{$dll_suffix} - -metadata_multiple_import_name_type = - multiple `import_name_type` arguments in a single `#[link]` attribute - -metadata_import_name_type_form = - import name type must be of the form `import_name_type = "string"` - -metadata_import_name_type_x86 = - import name type is only supported on x86 - -metadata_unknown_import_name_type = - unknown import name type `{$import_name_type}`, expected one of: decorated, noprefix, undecorated - -metadata_import_name_type_raw = - import name type can only be used with link kind `raw-dylib` diff --git a/compiler/rustc_metadata/messages.ftl b/compiler/rustc_metadata/messages.ftl new file mode 100644 index 00000000000..79b8b417257 --- /dev/null +++ b/compiler/rustc_metadata/messages.ftl @@ -0,0 +1,288 @@ +metadata_rlib_required = + crate `{$crate_name}` required to be available in rlib format, but was not found in this form + +metadata_lib_required = + crate `{$crate_name}` required to be available in {$kind} format, but was not found in this form + +metadata_rustc_lib_required = + crate `{$crate_name}` required to be available in {$kind} format, but was not found in this form + .note = only .rmeta files are distributed for `rustc_private` crates other than `rustc_driver` + .help = try adding `extern crate rustc_driver;` at the top level of this crate + +metadata_crate_dep_multiple = + cannot satisfy dependencies so `{$crate_name}` only shows up once + .help = having upstream crates all available in one format will likely make this go away + +metadata_two_panic_runtimes = + cannot link together two panic runtimes: {$prev_name} and {$cur_name} + +metadata_bad_panic_strategy = + the linked panic runtime `{$runtime}` is not compiled with this crate's panic strategy `{$strategy}` + +metadata_required_panic_strategy = + the crate `{$crate_name}` requires panic strategy `{$found_strategy}` which is incompatible with this crate's strategy of `{$desired_strategy}` + +metadata_incompatible_panic_in_drop_strategy = + the crate `{$crate_name}` is compiled with the panic-in-drop strategy `{$found_strategy}` which is incompatible with this crate's strategy of `{$desired_strategy}` + +metadata_multiple_names_in_link = + multiple `name` arguments in a single `#[link]` attribute + +metadata_multiple_kinds_in_link = + multiple `kind` arguments in a single `#[link]` attribute + +metadata_link_name_form = + link name must be of the form `name = "string"` + +metadata_link_kind_form = + link kind must be of the form `kind = "string"` + +metadata_link_modifiers_form = + link modifiers must be of the form `modifiers = "string"` + +metadata_link_cfg_form = + link cfg must be of the form `cfg(/* predicate */)` + +metadata_wasm_import_form = + wasm import module must be of the form `wasm_import_module = "string"` + +metadata_empty_link_name = + link name must not be empty + .label = empty link name + +metadata_link_framework_apple = + link kind `framework` is only supported on Apple targets + +metadata_framework_only_windows = + link kind `raw-dylib` is only supported on Windows targets + +metadata_unknown_link_kind = + unknown link kind `{$kind}`, expected one of: static, dylib, framework, raw-dylib + .label = unknown link kind + +metadata_multiple_link_modifiers = + multiple `modifiers` arguments in a single `#[link]` attribute + +metadata_multiple_cfgs = + multiple `cfg` arguments in a single `#[link]` attribute + +metadata_link_cfg_single_predicate = + link cfg must have a single predicate argument + +metadata_multiple_wasm_import = + multiple `wasm_import_module` arguments in a single `#[link]` attribute + +metadata_unexpected_link_arg = + unexpected `#[link]` argument, expected one of: name, kind, modifiers, cfg, wasm_import_module, import_name_type + +metadata_invalid_link_modifier = + invalid linking modifier syntax, expected '+' or '-' prefix before one of: bundle, verbatim, whole-archive, as-needed + +metadata_multiple_modifiers = + multiple `{$modifier}` modifiers in a single `modifiers` argument + +metadata_bundle_needs_static = + linking modifier `bundle` is only compatible with `static` linking kind + +metadata_whole_archive_needs_static = + linking modifier `whole-archive` is only compatible with `static` linking kind + +metadata_as_needed_compatibility = + linking modifier `as-needed` is only compatible with `dylib` and `framework` linking kinds + +metadata_unknown_link_modifier = + unknown linking modifier `{$modifier}`, expected one of: bundle, verbatim, whole-archive, as-needed + +metadata_incompatible_wasm_link = + `wasm_import_module` is incompatible with other arguments in `#[link]` attributes + +metadata_link_requires_name = + `#[link]` attribute requires a `name = "string"` argument + .label = missing `name` argument + +metadata_raw_dylib_no_nul = + link name must not contain NUL characters if link kind is `raw-dylib` + +metadata_link_ordinal_raw_dylib = + `#[link_ordinal]` is only supported if link kind is `raw-dylib` + +metadata_lib_framework_apple = + library kind `framework` is only supported on Apple targets + +metadata_empty_renaming_target = + an empty renaming target was specified for library `{$lib_name}` + +metadata_renaming_no_link = + renaming of the library `{$lib_name}` was specified, however this crate contains no `#[link(...)]` attributes referencing this library + +metadata_multiple_renamings = + multiple renamings were specified for library `{$lib_name}` + +metadata_no_link_mod_override = + overriding linking modifiers from command line is not supported + +metadata_unsupported_abi_i686 = + ABI not supported by `#[link(kind = "raw-dylib")]` on i686 + +metadata_unsupported_abi = + ABI not supported by `#[link(kind = "raw-dylib")]` on this architecture + +metadata_fail_create_file_encoder = + failed to create file encoder: {$err} + +metadata_fail_seek_file = + failed to seek the file: {$err} + +metadata_fail_write_file = + failed to write to the file: {$err} + +metadata_crate_not_panic_runtime = + the crate `{$crate_name}` is not a panic runtime + +metadata_no_panic_strategy = + the crate `{$crate_name}` does not have the panic strategy `{$strategy}` + +metadata_profiler_builtins_needs_core = + `profiler_builtins` crate (required by compiler options) is not compatible with crate attribute `#![no_core]` + +metadata_not_profiler_runtime = + the crate `{$crate_name}` is not a profiler runtime + +metadata_no_multiple_global_alloc = + cannot define multiple global allocators + .label = cannot define a new global allocator + +metadata_prev_global_alloc = + previous global allocator defined here + +metadata_no_multiple_alloc_error_handler = + cannot define multiple allocation error handlers + .label = cannot define a new allocation error handler + +metadata_prev_alloc_error_handler = + previous allocation error handler defined here + +metadata_conflicting_global_alloc = + the `#[global_allocator]` in {$other_crate_name} conflicts with global allocator in: {$crate_name} + +metadata_conflicting_alloc_error_handler = + the `#[alloc_error_handler]` in {$other_crate_name} conflicts with allocation error handler in: {$crate_name} + +metadata_global_alloc_required = + no global memory allocator found but one is required; link to std or add `#[global_allocator]` to a static item that implements the GlobalAlloc trait + +metadata_no_transitive_needs_dep = + the crate `{$crate_name}` cannot depend on a crate that needs {$needs_crate_name}, but it depends on `{$deps_crate_name}` + +metadata_failed_write_error = + failed to write {$filename}: {$err} + +metadata_missing_native_library = + could not find native static library `{$libname}`, perhaps an -L flag is missing? + +metadata_only_provide_library_name = only provide the library name `{$suggested_name}`, not the full filename + +metadata_failed_create_tempdir = + couldn't create a temp dir: {$err} + +metadata_failed_create_file = + failed to create the file {$filename}: {$err} + +metadata_failed_create_encoded_metadata = + failed to create encoded metadata from file: {$err} + +metadata_non_ascii_name = + cannot load a crate with a non-ascii name `{$crate_name}` + +metadata_extern_location_not_exist = + extern location for {$crate_name} does not exist: {$location} + +metadata_extern_location_not_file = + extern location for {$crate_name} is not a file: {$location} + +metadata_multiple_candidates = + multiple candidates for `{$flavor}` dependency `{$crate_name}` found + +metadata_symbol_conflicts_current = + the current crate is indistinguishable from one of its dependencies: it has the same crate-name `{$crate_name}` and was compiled with the same `-C metadata` arguments. This will result in symbol conflicts between the two. + +metadata_symbol_conflicts_others = + found two different crates with name `{$crate_name}` that are not distinguished by differing `-C metadata`. This will result in symbol conflicts between the two. + +metadata_stable_crate_id_collision = + found crates (`{$crate_name0}` and `{$crate_name1}`) with colliding StableCrateId values. + +metadata_dl_error = + {$err} + +metadata_newer_crate_version = + found possibly newer version of crate `{$crate_name}`{$add_info} + .note = perhaps that crate needs to be recompiled? + +metadata_found_crate_versions = + the following crate versions were found:{$found_crates} + +metadata_no_crate_with_triple = + couldn't find crate `{$crate_name}` with expected target triple {$locator_triple}{$add_info} + +metadata_found_staticlib = + found staticlib `{$crate_name}` instead of rlib or dylib{$add_info} + .help = please recompile that crate using --crate-type lib + +metadata_incompatible_rustc = + found crate `{$crate_name}` compiled by an incompatible version of rustc{$add_info} + .help = please recompile that crate using this compiler ({$rustc_version}) (consider running `cargo clean` first) + +metadata_invalid_meta_files = + found invalid metadata files for crate `{$crate_name}`{$add_info} + +metadata_cannot_find_crate = + can't find crate for `{$crate_name}`{$add_info} + +metadata_no_dylib_plugin = + plugin `{$crate_name}` only found in rlib format, but must be available in dylib format + +metadata_target_not_installed = + the `{$locator_triple}` target may not be installed + +metadata_target_no_std_support = + the `{$locator_triple}` target may not support the standard library + +metadata_consider_downloading_target = + consider downloading the target with `rustup target add {$locator_triple}` + +metadata_std_required = + `std` is required by `{$current_crate}` because it does not declare `#![no_std]` + +metadata_consider_building_std = + consider building the standard library from source with `cargo build -Zbuild-std` + +metadata_compiler_missing_profiler = + the compiler may have been built without the profiler runtime + +metadata_install_missing_components = + maybe you need to install the missing components with: `rustup component add rust-src rustc-dev llvm-tools-preview` + +metadata_cant_find_crate = + can't find crate + +metadata_crate_location_unknown_type = + extern location for {$crate_name} is of an unknown type: {$path} + +metadata_lib_filename_form = + file name should be lib*.rlib or {$dll_prefix}*{$dll_suffix} + +metadata_multiple_import_name_type = + multiple `import_name_type` arguments in a single `#[link]` attribute + +metadata_import_name_type_form = + import name type must be of the form `import_name_type = "string"` + +metadata_import_name_type_x86 = + import name type is only supported on x86 + +metadata_unknown_import_name_type = + unknown import name type `{$import_name_type}`, expected one of: decorated, noprefix, undecorated + +metadata_import_name_type_raw = + import name type can only be used with link kind `raw-dylib` diff --git a/compiler/rustc_metadata/src/lib.rs b/compiler/rustc_metadata/src/lib.rs index 6f6d3731cea..98d9ad31fe0 100644 --- a/compiler/rustc_metadata/src/lib.rs +++ b/compiler/rustc_metadata/src/lib.rs @@ -47,4 +47,4 @@ pub use fs::{emit_wrapper_file, METADATA_FILENAME}; pub use native_libs::find_native_static_library; pub use rmeta::{encode_metadata, EncodedMetadata, METADATA_HEADER}; -fluent_messages! { "../locales/en-US.ftl" } +fluent_messages! { "../messages.ftl" } diff --git a/compiler/rustc_middle/locales/en-US.ftl b/compiler/rustc_middle/locales/en-US.ftl deleted file mode 100644 index 4f4e5c6a2c9..00000000000 --- a/compiler/rustc_middle/locales/en-US.ftl +++ /dev/null @@ -1,36 +0,0 @@ -middle_drop_check_overflow = - overflow while adding drop-check rules for {$ty} - .note = overflowed on {$overflow_ty} - -middle_opaque_hidden_type_mismatch = - concrete type differs from previous defining opaque type use - .label = expected `{$self_ty}`, got `{$other_ty}` - -middle_conflict_types = - this expression supplies two conflicting concrete types for the same opaque type - -middle_previous_use_here = - previous use here - -middle_limit_invalid = - `limit` must be a non-negative integer - .label = {$error_str} - -middle_const_eval_non_int = - constant evaluation of enum discriminant resulted in non-integer - -middle_unknown_layout = - the type `{$ty}` has an unknown layout - -middle_values_too_big = - values of the type `{$ty}` are too big for the current architecture - -middle_cannot_be_normalized = - unable to determine layout for `{$ty}` because `{$failure_ty}` cannot be normalized - -middle_strict_coherence_needs_negative_coherence = - to use `strict_coherence` on this trait, the `with_negative_coherence` feature must be enabled - .label = due to this attribute - -middle_const_not_used_in_type_alias = - const parameter `{$ct}` is part of concrete type but not used in parameter list for the `impl Trait` type alias diff --git a/compiler/rustc_middle/messages.ftl b/compiler/rustc_middle/messages.ftl new file mode 100644 index 00000000000..4f4e5c6a2c9 --- /dev/null +++ b/compiler/rustc_middle/messages.ftl @@ -0,0 +1,36 @@ +middle_drop_check_overflow = + overflow while adding drop-check rules for {$ty} + .note = overflowed on {$overflow_ty} + +middle_opaque_hidden_type_mismatch = + concrete type differs from previous defining opaque type use + .label = expected `{$self_ty}`, got `{$other_ty}` + +middle_conflict_types = + this expression supplies two conflicting concrete types for the same opaque type + +middle_previous_use_here = + previous use here + +middle_limit_invalid = + `limit` must be a non-negative integer + .label = {$error_str} + +middle_const_eval_non_int = + constant evaluation of enum discriminant resulted in non-integer + +middle_unknown_layout = + the type `{$ty}` has an unknown layout + +middle_values_too_big = + values of the type `{$ty}` are too big for the current architecture + +middle_cannot_be_normalized = + unable to determine layout for `{$ty}` because `{$failure_ty}` cannot be normalized + +middle_strict_coherence_needs_negative_coherence = + to use `strict_coherence` on this trait, the `with_negative_coherence` feature must be enabled + .label = due to this attribute + +middle_const_not_used_in_type_alias = + const parameter `{$ct}` is part of concrete type but not used in parameter list for the `impl Trait` type alias diff --git a/compiler/rustc_middle/src/lib.rs b/compiler/rustc_middle/src/lib.rs index c33b9d84eb0..45c4a1057d2 100644 --- a/compiler/rustc_middle/src/lib.rs +++ b/compiler/rustc_middle/src/lib.rs @@ -109,4 +109,4 @@ pub mod util { // Allows macros to refer to this crate as `::rustc_middle` extern crate self as rustc_middle; -fluent_messages! { "../locales/en-US.ftl" } +fluent_messages! { "../messages.ftl" } diff --git a/compiler/rustc_mir_build/locales/en-US.ftl b/compiler/rustc_mir_build/locales/en-US.ftl deleted file mode 100644 index 93e7fb330e0..00000000000 --- a/compiler/rustc_mir_build/locales/en-US.ftl +++ /dev/null @@ -1,382 +0,0 @@ -mir_build_unconditional_recursion = function cannot return without recursing - .label = cannot return without recursing - .help = a `loop` may express intention better if this is on purpose - -mir_build_unconditional_recursion_call_site_label = recursive call site - -mir_build_unsafe_op_in_unsafe_fn_call_to_unsafe_fn_requires_unsafe = - call to unsafe function `{$function}` is unsafe and requires unsafe block (error E0133) - .note = consult the function's documentation for information on how to avoid undefined behavior - .label = call to unsafe function - -mir_build_unsafe_op_in_unsafe_fn_call_to_unsafe_fn_requires_unsafe_nameless = - call to unsafe function is unsafe and requires unsafe block (error E0133) - .note = consult the function's documentation for information on how to avoid undefined behavior - .label = call to unsafe function - -mir_build_unsafe_op_in_unsafe_fn_inline_assembly_requires_unsafe = - use of inline assembly is unsafe and requires unsafe block (error E0133) - .note = inline assembly is entirely unchecked and can cause undefined behavior - .label = use of inline assembly - -mir_build_unsafe_op_in_unsafe_fn_initializing_type_with_requires_unsafe = - initializing type with `rustc_layout_scalar_valid_range` attr is unsafe and requires unsafe - block (error E0133) - .note = initializing a layout restricted type's field with a value outside the valid range is undefined behavior - .label = initializing type with `rustc_layout_scalar_valid_range` attr - -mir_build_unsafe_op_in_unsafe_fn_mutable_static_requires_unsafe = - use of mutable static is unsafe and requires unsafe block (error E0133) - .note = mutable statics can be mutated by multiple threads: aliasing violations or data races will cause undefined behavior - .label = use of mutable static - -mir_build_unsafe_op_in_unsafe_fn_extern_static_requires_unsafe = - use of extern static is unsafe and requires unsafe block (error E0133) - .note = extern statics are not controlled by the Rust type system: invalid data, aliasing violations or data races will cause undefined behavior - .label = use of extern static - -mir_build_unsafe_op_in_unsafe_fn_deref_raw_pointer_requires_unsafe = - dereference of raw pointer is unsafe and requires unsafe block (error E0133) - .note = raw pointers may be null, dangling or unaligned; they can violate aliasing rules and cause data races: all of these are undefined behavior - .label = dereference of raw pointer - -mir_build_unsafe_op_in_unsafe_fn_union_field_requires_unsafe = - access to union field is unsafe and requires unsafe block (error E0133) - .note = the field may not be properly initialized: using uninitialized data will cause undefined behavior - .label = access to union field - -mir_build_unsafe_op_in_unsafe_fn_mutation_of_layout_constrained_field_requires_unsafe = - mutation of layout constrained field is unsafe and requires unsafe block (error E0133) - .note = mutating layout constrained fields cannot statically be checked for valid values - .label = mutation of layout constrained field - -mir_build_unsafe_op_in_unsafe_fn_borrow_of_layout_constrained_field_requires_unsafe = - borrow of layout constrained field with interior mutability is unsafe and requires unsafe block (error E0133) - .note = references to fields of layout constrained fields lose the constraints. Coupled with interior mutability, the field can be changed to invalid values - .label = borrow of layout constrained field with interior mutability - -mir_build_unsafe_op_in_unsafe_fn_call_to_fn_with_requires_unsafe = - call to function `{$function}` with `#[target_feature]` is unsafe and requires unsafe block (error E0133) - .note = can only be called if the required target features are available - .label = call to function with `#[target_feature]` - -mir_build_call_to_unsafe_fn_requires_unsafe = - call to unsafe function `{$function}` is unsafe and requires unsafe block - .note = consult the function's documentation for information on how to avoid undefined behavior - .label = call to unsafe function - -mir_build_call_to_unsafe_fn_requires_unsafe_nameless = - call to unsafe function is unsafe and requires unsafe block - .note = consult the function's documentation for information on how to avoid undefined behavior - .label = call to unsafe function - -mir_build_call_to_unsafe_fn_requires_unsafe_unsafe_op_in_unsafe_fn_allowed = - call to unsafe function `{$function}` is unsafe and requires unsafe function or block - .note = consult the function's documentation for information on how to avoid undefined behavior - .label = call to unsafe function - -mir_build_call_to_unsafe_fn_requires_unsafe_nameless_unsafe_op_in_unsafe_fn_allowed = - call to unsafe function is unsafe and requires unsafe function or block - .note = consult the function's documentation for information on how to avoid undefined behavior - .label = call to unsafe function - -mir_build_inline_assembly_requires_unsafe = - use of inline assembly is unsafe and requires unsafe block - .note = inline assembly is entirely unchecked and can cause undefined behavior - .label = use of inline assembly - -mir_build_inline_assembly_requires_unsafe_unsafe_op_in_unsafe_fn_allowed = - use of inline assembly is unsafe and requires unsafe function or block - .note = inline assembly is entirely unchecked and can cause undefined behavior - .label = use of inline assembly - -mir_build_initializing_type_with_requires_unsafe = - initializing type with `rustc_layout_scalar_valid_range` attr is unsafe and requires unsafe block - .note = initializing a layout restricted type's field with a value outside the valid range is undefined behavior - .label = initializing type with `rustc_layout_scalar_valid_range` attr - -mir_build_initializing_type_with_requires_unsafe_unsafe_op_in_unsafe_fn_allowed = - initializing type with `rustc_layout_scalar_valid_range` attr is unsafe and requires unsafe function or block - .note = initializing a layout restricted type's field with a value outside the valid range is undefined behavior - .label = initializing type with `rustc_layout_scalar_valid_range` attr - -mir_build_mutable_static_requires_unsafe = - use of mutable static is unsafe and requires unsafe block - .note = mutable statics can be mutated by multiple threads: aliasing violations or data races will cause undefined behavior - .label = use of mutable static - -mir_build_mutable_static_requires_unsafe_unsafe_op_in_unsafe_fn_allowed = - use of mutable static is unsafe and requires unsafe function or block - .note = mutable statics can be mutated by multiple threads: aliasing violations or data races will cause undefined behavior - .label = use of mutable static - -mir_build_extern_static_requires_unsafe = - use of extern static is unsafe and requires unsafe block - .note = extern statics are not controlled by the Rust type system: invalid data, aliasing violations or data races will cause undefined behavior - .label = use of extern static - -mir_build_extern_static_requires_unsafe_unsafe_op_in_unsafe_fn_allowed = - use of extern static is unsafe and requires unsafe function or block - .note = extern statics are not controlled by the Rust type system: invalid data, aliasing violations or data races will cause undefined behavior - .label = use of extern static - -mir_build_deref_raw_pointer_requires_unsafe = - dereference of raw pointer is unsafe and requires unsafe block - .note = raw pointers may be null, dangling or unaligned; they can violate aliasing rules and cause data races: all of these are undefined behavior - .label = dereference of raw pointer - -mir_build_deref_raw_pointer_requires_unsafe_unsafe_op_in_unsafe_fn_allowed = - dereference of raw pointer is unsafe and requires unsafe function or block - .note = raw pointers may be null, dangling or unaligned; they can violate aliasing rules and cause data races: all of these are undefined behavior - .label = dereference of raw pointer - -mir_build_union_field_requires_unsafe = - access to union field is unsafe and requires unsafe block - .note = the field may not be properly initialized: using uninitialized data will cause undefined behavior - .label = access to union field - -mir_build_union_field_requires_unsafe_unsafe_op_in_unsafe_fn_allowed = - access to union field is unsafe and requires unsafe function or block - .note = the field may not be properly initialized: using uninitialized data will cause undefined behavior - .label = access to union field - -mir_build_mutation_of_layout_constrained_field_requires_unsafe = - mutation of layout constrained field is unsafe and requires unsafe block - .note = mutating layout constrained fields cannot statically be checked for valid values - .label = mutation of layout constrained field - -mir_build_mutation_of_layout_constrained_field_requires_unsafe_unsafe_op_in_unsafe_fn_allowed = - mutation of layout constrained field is unsafe and requires unsafe function or block - .note = mutating layout constrained fields cannot statically be checked for valid values - .label = mutation of layout constrained field - -mir_build_borrow_of_layout_constrained_field_requires_unsafe = - borrow of layout constrained field with interior mutability is unsafe and requires unsafe block - .note = references to fields of layout constrained fields lose the constraints. Coupled with interior mutability, the field can be changed to invalid values - .label = borrow of layout constrained field with interior mutability - -mir_build_borrow_of_layout_constrained_field_requires_unsafe_unsafe_op_in_unsafe_fn_allowed = - borrow of layout constrained field with interior mutability is unsafe and requires unsafe function or block - .note = references to fields of layout constrained fields lose the constraints. Coupled with interior mutability, the field can be changed to invalid values - .label = borrow of layout constrained field with interior mutability - -mir_build_call_to_fn_with_requires_unsafe = - call to function `{$function}` with `#[target_feature]` is unsafe and requires unsafe block - .note = can only be called if the required target features are available - .label = call to function with `#[target_feature]` - -mir_build_call_to_fn_with_requires_unsafe_unsafe_op_in_unsafe_fn_allowed = - call to function `{$function}` with `#[target_feature]` is unsafe and requires unsafe function or block - .note = can only be called if the required target features are available - .label = call to function with `#[target_feature]` - -mir_build_unused_unsafe = unnecessary `unsafe` block - .label = unnecessary `unsafe` block - -mir_build_unused_unsafe_enclosing_block_label = because it's nested under this `unsafe` block -mir_build_unused_unsafe_enclosing_fn_label = because it's nested under this `unsafe` fn - -mir_build_non_exhaustive_patterns_type_not_empty = non-exhaustive patterns: type `{$ty}` is non-empty - .def_note = `{$peeled_ty}` defined here - .type_note = the matched value is of type `{$ty}` - .non_exhaustive_type_note = the matched value is of type `{$ty}`, which is marked as non-exhaustive - .reference_note = references are always considered inhabited - .suggestion = ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown - .help = ensure that all possible cases are being handled by adding a match arm with a wildcard pattern - -mir_build_static_in_pattern = statics cannot be referenced in patterns - -mir_build_assoc_const_in_pattern = associated consts cannot be referenced in patterns - -mir_build_const_param_in_pattern = const parameters cannot be referenced in patterns - -mir_build_non_const_path = runtime values cannot be referenced in patterns - -mir_build_unreachable_pattern = unreachable pattern - .label = unreachable pattern - .catchall_label = matches any value - -mir_build_const_pattern_depends_on_generic_parameter = - constant pattern depends on a generic parameter - -mir_build_could_not_eval_const_pattern = could not evaluate constant pattern - -mir_build_lower_range_bound_must_be_less_than_or_equal_to_upper = - lower range bound must be less than or equal to upper - .label = lower bound larger than upper bound - .teach_note = When matching against a range, the compiler verifies that the range is non-empty. Range patterns include both end-points, so this is equivalent to requiring the start of the range to be less than or equal to the end of the range. - -mir_build_literal_in_range_out_of_bounds = - literal out of range for `{$ty}` - .label = this value doesn't fit in `{$ty}` whose maximum value is `{$max}` - -mir_build_lower_range_bound_must_be_less_than_upper = lower range bound must be less than upper - -mir_build_leading_irrefutable_let_patterns = leading irrefutable {$count -> - [one] pattern - *[other] patterns - } in let chain - .note = {$count -> - [one] this pattern - *[other] these patterns - } will always match - .help = consider moving {$count -> - [one] it - *[other] them - } outside of the construct - -mir_build_trailing_irrefutable_let_patterns = trailing irrefutable {$count -> - [one] pattern - *[other] patterns - } in let chain - .note = {$count -> - [one] this pattern - *[other] these patterns - } will always match - .help = consider moving {$count -> - [one] it - *[other] them - } into the body - -mir_build_bindings_with_variant_name = - pattern binding `{$ident}` is named the same as one of the variants of the type `{$ty_path}` - .suggestion = to match on the variant, qualify the path - -mir_build_irrefutable_let_patterns_generic_let = irrefutable `let` {$count -> - [one] pattern - *[other] patterns - } - .note = {$count -> - [one] this pattern - *[other] these patterns - } will always match, so the `let` is useless - .help = consider removing `let` - -mir_build_irrefutable_let_patterns_if_let = irrefutable `if let` {$count -> - [one] pattern - *[other] patterns - } - .note = {$count -> - [one] this pattern - *[other] these patterns - } will always match, so the `if let` is useless - .help = consider replacing the `if let` with a `let` - -mir_build_irrefutable_let_patterns_if_let_guard = irrefutable `if let` guard {$count -> - [one] pattern - *[other] patterns - } - .note = {$count -> - [one] this pattern - *[other] these patterns - } will always match, so the guard is useless - .help = consider removing the guard and adding a `let` inside the match arm - -mir_build_irrefutable_let_patterns_let_else = irrefutable `let...else` {$count -> - [one] pattern - *[other] patterns - } - .note = {$count -> - [one] this pattern - *[other] these patterns - } will always match, so the `else` clause is useless - .help = consider removing the `else` clause - -mir_build_irrefutable_let_patterns_while_let = irrefutable `while let` {$count -> - [one] pattern - *[other] patterns - } - .note = {$count -> - [one] this pattern - *[other] these patterns - } will always match, so the loop will never exit - .help = consider instead using a `loop {"{"} ... {"}"}` with a `let` inside it - -mir_build_borrow_of_moved_value = borrow of moved value - .label = value moved into `{$name}` here - .occurs_because_label = move occurs because `{$name}` has type `{$ty}` which does not implement the `Copy` trait - .value_borrowed_label = value borrowed here after move - .suggestion = borrow this binding in the pattern to avoid moving the value - -mir_build_multiple_mut_borrows = cannot borrow value as mutable more than once at a time - -mir_build_already_borrowed = cannot borrow value as mutable because it is also borrowed as immutable - -mir_build_already_mut_borrowed = cannot borrow value as immutable because it is also borrowed as mutable - -mir_build_moved_while_borrowed = cannot move out of value because it is borrowed - -mir_build_mutable_borrow = value is mutably borrowed by `{$name}` here - -mir_build_borrow = value is borrowed by `{$name}` here - -mir_build_moved = value is moved into `{$name}` here - -mir_build_union_pattern = cannot use unions in constant patterns - -mir_build_type_not_structural = - to use a constant of type `{$non_sm_ty}` in a pattern, `{$non_sm_ty}` must be annotated with `#[derive(PartialEq, Eq)]` - -mir_build_unsized_pattern = cannot use unsized non-slice type `{$non_sm_ty}` in constant patterns - -mir_build_invalid_pattern = `{$non_sm_ty}` cannot be used in patterns - -mir_build_float_pattern = floating-point types cannot be used in patterns - -mir_build_pointer_pattern = function pointers and unsized pointers in patterns behave unpredictably and should not be relied upon. See https://github.com/rust-lang/rust/issues/70861 for details. - -mir_build_indirect_structural_match = - to use a constant of type `{$non_sm_ty}` in a pattern, `{$non_sm_ty}` must be annotated with `#[derive(PartialEq, Eq)]` - -mir_build_nontrivial_structural_match = - to use a constant of type `{$non_sm_ty}` in a pattern, the constant's initializer must be trivial or `{$non_sm_ty}` must be annotated with `#[derive(PartialEq, Eq)]` - -mir_build_overlapping_range_endpoints = multiple patterns overlap on their endpoints - .range = ... with this range - .note = you likely meant to write mutually exclusive ranges - -mir_build_non_exhaustive_omitted_pattern = some variants are not matched explicitly - .help = ensure that all variants are matched explicitly by adding the suggested match arms - .note = the matched value is of type `{$scrut_ty}` and the `non_exhaustive_omitted_patterns` attribute was found - -mir_build_uncovered = {$count -> - [1] pattern `{$witness_1}` - [2] patterns `{$witness_1}` and `{$witness_2}` - [3] patterns `{$witness_1}`, `{$witness_2}` and `{$witness_3}` - *[other] patterns `{$witness_1}`, `{$witness_2}`, `{$witness_3}` and {$remainder} more - } not covered - -mir_build_pattern_not_covered = refutable pattern in {$origin} - .pattern_ty = the matched value is of type `{$pattern_ty}` - -mir_build_inform_irrefutable = `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant - -mir_build_more_information = for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html - -mir_build_res_defined_here = {$res} defined here - -mir_build_adt_defined_here = `{$ty}` defined here - -mir_build_variant_defined_here = not covered - -mir_build_interpreted_as_const = introduce a variable instead - -mir_build_confused = missing patterns are not covered because `{$variable}` is interpreted as {$article} {$res} pattern, not a new variable - -mir_build_suggest_if_let = you might want to use `if let` to ignore the {$count -> - [one] variant that isn't - *[other] variants that aren't - } matched - -mir_build_suggest_let_else = you might want to use `let else` to handle the {$count -> - [one] variant that isn't - *[other] variants that aren't - } matched - -mir_build_suggest_attempted_int_lit = alternatively, you could prepend the pattern with an underscore to define a new named variable; identifiers cannot begin with digits - - -mir_build_rustc_box_attribute_error = `#[rustc_box]` attribute used incorrectly - .attributes = no other attributes may be applied - .not_box = `#[rustc_box]` may only be applied to a `Box::new()` call - .missing_box = `#[rustc_box]` requires the `owned_box` lang item diff --git a/compiler/rustc_mir_build/messages.ftl b/compiler/rustc_mir_build/messages.ftl new file mode 100644 index 00000000000..93e7fb330e0 --- /dev/null +++ b/compiler/rustc_mir_build/messages.ftl @@ -0,0 +1,382 @@ +mir_build_unconditional_recursion = function cannot return without recursing + .label = cannot return without recursing + .help = a `loop` may express intention better if this is on purpose + +mir_build_unconditional_recursion_call_site_label = recursive call site + +mir_build_unsafe_op_in_unsafe_fn_call_to_unsafe_fn_requires_unsafe = + call to unsafe function `{$function}` is unsafe and requires unsafe block (error E0133) + .note = consult the function's documentation for information on how to avoid undefined behavior + .label = call to unsafe function + +mir_build_unsafe_op_in_unsafe_fn_call_to_unsafe_fn_requires_unsafe_nameless = + call to unsafe function is unsafe and requires unsafe block (error E0133) + .note = consult the function's documentation for information on how to avoid undefined behavior + .label = call to unsafe function + +mir_build_unsafe_op_in_unsafe_fn_inline_assembly_requires_unsafe = + use of inline assembly is unsafe and requires unsafe block (error E0133) + .note = inline assembly is entirely unchecked and can cause undefined behavior + .label = use of inline assembly + +mir_build_unsafe_op_in_unsafe_fn_initializing_type_with_requires_unsafe = + initializing type with `rustc_layout_scalar_valid_range` attr is unsafe and requires unsafe + block (error E0133) + .note = initializing a layout restricted type's field with a value outside the valid range is undefined behavior + .label = initializing type with `rustc_layout_scalar_valid_range` attr + +mir_build_unsafe_op_in_unsafe_fn_mutable_static_requires_unsafe = + use of mutable static is unsafe and requires unsafe block (error E0133) + .note = mutable statics can be mutated by multiple threads: aliasing violations or data races will cause undefined behavior + .label = use of mutable static + +mir_build_unsafe_op_in_unsafe_fn_extern_static_requires_unsafe = + use of extern static is unsafe and requires unsafe block (error E0133) + .note = extern statics are not controlled by the Rust type system: invalid data, aliasing violations or data races will cause undefined behavior + .label = use of extern static + +mir_build_unsafe_op_in_unsafe_fn_deref_raw_pointer_requires_unsafe = + dereference of raw pointer is unsafe and requires unsafe block (error E0133) + .note = raw pointers may be null, dangling or unaligned; they can violate aliasing rules and cause data races: all of these are undefined behavior + .label = dereference of raw pointer + +mir_build_unsafe_op_in_unsafe_fn_union_field_requires_unsafe = + access to union field is unsafe and requires unsafe block (error E0133) + .note = the field may not be properly initialized: using uninitialized data will cause undefined behavior + .label = access to union field + +mir_build_unsafe_op_in_unsafe_fn_mutation_of_layout_constrained_field_requires_unsafe = + mutation of layout constrained field is unsafe and requires unsafe block (error E0133) + .note = mutating layout constrained fields cannot statically be checked for valid values + .label = mutation of layout constrained field + +mir_build_unsafe_op_in_unsafe_fn_borrow_of_layout_constrained_field_requires_unsafe = + borrow of layout constrained field with interior mutability is unsafe and requires unsafe block (error E0133) + .note = references to fields of layout constrained fields lose the constraints. Coupled with interior mutability, the field can be changed to invalid values + .label = borrow of layout constrained field with interior mutability + +mir_build_unsafe_op_in_unsafe_fn_call_to_fn_with_requires_unsafe = + call to function `{$function}` with `#[target_feature]` is unsafe and requires unsafe block (error E0133) + .note = can only be called if the required target features are available + .label = call to function with `#[target_feature]` + +mir_build_call_to_unsafe_fn_requires_unsafe = + call to unsafe function `{$function}` is unsafe and requires unsafe block + .note = consult the function's documentation for information on how to avoid undefined behavior + .label = call to unsafe function + +mir_build_call_to_unsafe_fn_requires_unsafe_nameless = + call to unsafe function is unsafe and requires unsafe block + .note = consult the function's documentation for information on how to avoid undefined behavior + .label = call to unsafe function + +mir_build_call_to_unsafe_fn_requires_unsafe_unsafe_op_in_unsafe_fn_allowed = + call to unsafe function `{$function}` is unsafe and requires unsafe function or block + .note = consult the function's documentation for information on how to avoid undefined behavior + .label = call to unsafe function + +mir_build_call_to_unsafe_fn_requires_unsafe_nameless_unsafe_op_in_unsafe_fn_allowed = + call to unsafe function is unsafe and requires unsafe function or block + .note = consult the function's documentation for information on how to avoid undefined behavior + .label = call to unsafe function + +mir_build_inline_assembly_requires_unsafe = + use of inline assembly is unsafe and requires unsafe block + .note = inline assembly is entirely unchecked and can cause undefined behavior + .label = use of inline assembly + +mir_build_inline_assembly_requires_unsafe_unsafe_op_in_unsafe_fn_allowed = + use of inline assembly is unsafe and requires unsafe function or block + .note = inline assembly is entirely unchecked and can cause undefined behavior + .label = use of inline assembly + +mir_build_initializing_type_with_requires_unsafe = + initializing type with `rustc_layout_scalar_valid_range` attr is unsafe and requires unsafe block + .note = initializing a layout restricted type's field with a value outside the valid range is undefined behavior + .label = initializing type with `rustc_layout_scalar_valid_range` attr + +mir_build_initializing_type_with_requires_unsafe_unsafe_op_in_unsafe_fn_allowed = + initializing type with `rustc_layout_scalar_valid_range` attr is unsafe and requires unsafe function or block + .note = initializing a layout restricted type's field with a value outside the valid range is undefined behavior + .label = initializing type with `rustc_layout_scalar_valid_range` attr + +mir_build_mutable_static_requires_unsafe = + use of mutable static is unsafe and requires unsafe block + .note = mutable statics can be mutated by multiple threads: aliasing violations or data races will cause undefined behavior + .label = use of mutable static + +mir_build_mutable_static_requires_unsafe_unsafe_op_in_unsafe_fn_allowed = + use of mutable static is unsafe and requires unsafe function or block + .note = mutable statics can be mutated by multiple threads: aliasing violations or data races will cause undefined behavior + .label = use of mutable static + +mir_build_extern_static_requires_unsafe = + use of extern static is unsafe and requires unsafe block + .note = extern statics are not controlled by the Rust type system: invalid data, aliasing violations or data races will cause undefined behavior + .label = use of extern static + +mir_build_extern_static_requires_unsafe_unsafe_op_in_unsafe_fn_allowed = + use of extern static is unsafe and requires unsafe function or block + .note = extern statics are not controlled by the Rust type system: invalid data, aliasing violations or data races will cause undefined behavior + .label = use of extern static + +mir_build_deref_raw_pointer_requires_unsafe = + dereference of raw pointer is unsafe and requires unsafe block + .note = raw pointers may be null, dangling or unaligned; they can violate aliasing rules and cause data races: all of these are undefined behavior + .label = dereference of raw pointer + +mir_build_deref_raw_pointer_requires_unsafe_unsafe_op_in_unsafe_fn_allowed = + dereference of raw pointer is unsafe and requires unsafe function or block + .note = raw pointers may be null, dangling or unaligned; they can violate aliasing rules and cause data races: all of these are undefined behavior + .label = dereference of raw pointer + +mir_build_union_field_requires_unsafe = + access to union field is unsafe and requires unsafe block + .note = the field may not be properly initialized: using uninitialized data will cause undefined behavior + .label = access to union field + +mir_build_union_field_requires_unsafe_unsafe_op_in_unsafe_fn_allowed = + access to union field is unsafe and requires unsafe function or block + .note = the field may not be properly initialized: using uninitialized data will cause undefined behavior + .label = access to union field + +mir_build_mutation_of_layout_constrained_field_requires_unsafe = + mutation of layout constrained field is unsafe and requires unsafe block + .note = mutating layout constrained fields cannot statically be checked for valid values + .label = mutation of layout constrained field + +mir_build_mutation_of_layout_constrained_field_requires_unsafe_unsafe_op_in_unsafe_fn_allowed = + mutation of layout constrained field is unsafe and requires unsafe function or block + .note = mutating layout constrained fields cannot statically be checked for valid values + .label = mutation of layout constrained field + +mir_build_borrow_of_layout_constrained_field_requires_unsafe = + borrow of layout constrained field with interior mutability is unsafe and requires unsafe block + .note = references to fields of layout constrained fields lose the constraints. Coupled with interior mutability, the field can be changed to invalid values + .label = borrow of layout constrained field with interior mutability + +mir_build_borrow_of_layout_constrained_field_requires_unsafe_unsafe_op_in_unsafe_fn_allowed = + borrow of layout constrained field with interior mutability is unsafe and requires unsafe function or block + .note = references to fields of layout constrained fields lose the constraints. Coupled with interior mutability, the field can be changed to invalid values + .label = borrow of layout constrained field with interior mutability + +mir_build_call_to_fn_with_requires_unsafe = + call to function `{$function}` with `#[target_feature]` is unsafe and requires unsafe block + .note = can only be called if the required target features are available + .label = call to function with `#[target_feature]` + +mir_build_call_to_fn_with_requires_unsafe_unsafe_op_in_unsafe_fn_allowed = + call to function `{$function}` with `#[target_feature]` is unsafe and requires unsafe function or block + .note = can only be called if the required target features are available + .label = call to function with `#[target_feature]` + +mir_build_unused_unsafe = unnecessary `unsafe` block + .label = unnecessary `unsafe` block + +mir_build_unused_unsafe_enclosing_block_label = because it's nested under this `unsafe` block +mir_build_unused_unsafe_enclosing_fn_label = because it's nested under this `unsafe` fn + +mir_build_non_exhaustive_patterns_type_not_empty = non-exhaustive patterns: type `{$ty}` is non-empty + .def_note = `{$peeled_ty}` defined here + .type_note = the matched value is of type `{$ty}` + .non_exhaustive_type_note = the matched value is of type `{$ty}`, which is marked as non-exhaustive + .reference_note = references are always considered inhabited + .suggestion = ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown + .help = ensure that all possible cases are being handled by adding a match arm with a wildcard pattern + +mir_build_static_in_pattern = statics cannot be referenced in patterns + +mir_build_assoc_const_in_pattern = associated consts cannot be referenced in patterns + +mir_build_const_param_in_pattern = const parameters cannot be referenced in patterns + +mir_build_non_const_path = runtime values cannot be referenced in patterns + +mir_build_unreachable_pattern = unreachable pattern + .label = unreachable pattern + .catchall_label = matches any value + +mir_build_const_pattern_depends_on_generic_parameter = + constant pattern depends on a generic parameter + +mir_build_could_not_eval_const_pattern = could not evaluate constant pattern + +mir_build_lower_range_bound_must_be_less_than_or_equal_to_upper = + lower range bound must be less than or equal to upper + .label = lower bound larger than upper bound + .teach_note = When matching against a range, the compiler verifies that the range is non-empty. Range patterns include both end-points, so this is equivalent to requiring the start of the range to be less than or equal to the end of the range. + +mir_build_literal_in_range_out_of_bounds = + literal out of range for `{$ty}` + .label = this value doesn't fit in `{$ty}` whose maximum value is `{$max}` + +mir_build_lower_range_bound_must_be_less_than_upper = lower range bound must be less than upper + +mir_build_leading_irrefutable_let_patterns = leading irrefutable {$count -> + [one] pattern + *[other] patterns + } in let chain + .note = {$count -> + [one] this pattern + *[other] these patterns + } will always match + .help = consider moving {$count -> + [one] it + *[other] them + } outside of the construct + +mir_build_trailing_irrefutable_let_patterns = trailing irrefutable {$count -> + [one] pattern + *[other] patterns + } in let chain + .note = {$count -> + [one] this pattern + *[other] these patterns + } will always match + .help = consider moving {$count -> + [one] it + *[other] them + } into the body + +mir_build_bindings_with_variant_name = + pattern binding `{$ident}` is named the same as one of the variants of the type `{$ty_path}` + .suggestion = to match on the variant, qualify the path + +mir_build_irrefutable_let_patterns_generic_let = irrefutable `let` {$count -> + [one] pattern + *[other] patterns + } + .note = {$count -> + [one] this pattern + *[other] these patterns + } will always match, so the `let` is useless + .help = consider removing `let` + +mir_build_irrefutable_let_patterns_if_let = irrefutable `if let` {$count -> + [one] pattern + *[other] patterns + } + .note = {$count -> + [one] this pattern + *[other] these patterns + } will always match, so the `if let` is useless + .help = consider replacing the `if let` with a `let` + +mir_build_irrefutable_let_patterns_if_let_guard = irrefutable `if let` guard {$count -> + [one] pattern + *[other] patterns + } + .note = {$count -> + [one] this pattern + *[other] these patterns + } will always match, so the guard is useless + .help = consider removing the guard and adding a `let` inside the match arm + +mir_build_irrefutable_let_patterns_let_else = irrefutable `let...else` {$count -> + [one] pattern + *[other] patterns + } + .note = {$count -> + [one] this pattern + *[other] these patterns + } will always match, so the `else` clause is useless + .help = consider removing the `else` clause + +mir_build_irrefutable_let_patterns_while_let = irrefutable `while let` {$count -> + [one] pattern + *[other] patterns + } + .note = {$count -> + [one] this pattern + *[other] these patterns + } will always match, so the loop will never exit + .help = consider instead using a `loop {"{"} ... {"}"}` with a `let` inside it + +mir_build_borrow_of_moved_value = borrow of moved value + .label = value moved into `{$name}` here + .occurs_because_label = move occurs because `{$name}` has type `{$ty}` which does not implement the `Copy` trait + .value_borrowed_label = value borrowed here after move + .suggestion = borrow this binding in the pattern to avoid moving the value + +mir_build_multiple_mut_borrows = cannot borrow value as mutable more than once at a time + +mir_build_already_borrowed = cannot borrow value as mutable because it is also borrowed as immutable + +mir_build_already_mut_borrowed = cannot borrow value as immutable because it is also borrowed as mutable + +mir_build_moved_while_borrowed = cannot move out of value because it is borrowed + +mir_build_mutable_borrow = value is mutably borrowed by `{$name}` here + +mir_build_borrow = value is borrowed by `{$name}` here + +mir_build_moved = value is moved into `{$name}` here + +mir_build_union_pattern = cannot use unions in constant patterns + +mir_build_type_not_structural = + to use a constant of type `{$non_sm_ty}` in a pattern, `{$non_sm_ty}` must be annotated with `#[derive(PartialEq, Eq)]` + +mir_build_unsized_pattern = cannot use unsized non-slice type `{$non_sm_ty}` in constant patterns + +mir_build_invalid_pattern = `{$non_sm_ty}` cannot be used in patterns + +mir_build_float_pattern = floating-point types cannot be used in patterns + +mir_build_pointer_pattern = function pointers and unsized pointers in patterns behave unpredictably and should not be relied upon. See https://github.com/rust-lang/rust/issues/70861 for details. + +mir_build_indirect_structural_match = + to use a constant of type `{$non_sm_ty}` in a pattern, `{$non_sm_ty}` must be annotated with `#[derive(PartialEq, Eq)]` + +mir_build_nontrivial_structural_match = + to use a constant of type `{$non_sm_ty}` in a pattern, the constant's initializer must be trivial or `{$non_sm_ty}` must be annotated with `#[derive(PartialEq, Eq)]` + +mir_build_overlapping_range_endpoints = multiple patterns overlap on their endpoints + .range = ... with this range + .note = you likely meant to write mutually exclusive ranges + +mir_build_non_exhaustive_omitted_pattern = some variants are not matched explicitly + .help = ensure that all variants are matched explicitly by adding the suggested match arms + .note = the matched value is of type `{$scrut_ty}` and the `non_exhaustive_omitted_patterns` attribute was found + +mir_build_uncovered = {$count -> + [1] pattern `{$witness_1}` + [2] patterns `{$witness_1}` and `{$witness_2}` + [3] patterns `{$witness_1}`, `{$witness_2}` and `{$witness_3}` + *[other] patterns `{$witness_1}`, `{$witness_2}`, `{$witness_3}` and {$remainder} more + } not covered + +mir_build_pattern_not_covered = refutable pattern in {$origin} + .pattern_ty = the matched value is of type `{$pattern_ty}` + +mir_build_inform_irrefutable = `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant + +mir_build_more_information = for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html + +mir_build_res_defined_here = {$res} defined here + +mir_build_adt_defined_here = `{$ty}` defined here + +mir_build_variant_defined_here = not covered + +mir_build_interpreted_as_const = introduce a variable instead + +mir_build_confused = missing patterns are not covered because `{$variable}` is interpreted as {$article} {$res} pattern, not a new variable + +mir_build_suggest_if_let = you might want to use `if let` to ignore the {$count -> + [one] variant that isn't + *[other] variants that aren't + } matched + +mir_build_suggest_let_else = you might want to use `let else` to handle the {$count -> + [one] variant that isn't + *[other] variants that aren't + } matched + +mir_build_suggest_attempted_int_lit = alternatively, you could prepend the pattern with an underscore to define a new named variable; identifiers cannot begin with digits + + +mir_build_rustc_box_attribute_error = `#[rustc_box]` attribute used incorrectly + .attributes = no other attributes may be applied + .not_box = `#[rustc_box]` may only be applied to a `Box::new()` call + .missing_box = `#[rustc_box]` requires the `owned_box` lang item diff --git a/compiler/rustc_mir_build/src/lib.rs b/compiler/rustc_mir_build/src/lib.rs index e10a264d385..04709197578 100644 --- a/compiler/rustc_mir_build/src/lib.rs +++ b/compiler/rustc_mir_build/src/lib.rs @@ -28,7 +28,7 @@ use rustc_middle::ty::query::Providers; use rustc_errors::{DiagnosticMessage, SubdiagnosticMessage}; use rustc_macros::fluent_messages; -fluent_messages! { "../locales/en-US.ftl" } +fluent_messages! { "../messages.ftl" } pub fn provide(providers: &mut Providers) { providers.check_match = thir::pattern::check_match; diff --git a/compiler/rustc_mir_dataflow/locales/en-US.ftl b/compiler/rustc_mir_dataflow/locales/en-US.ftl deleted file mode 100644 index 98854152508..00000000000 --- a/compiler/rustc_mir_dataflow/locales/en-US.ftl +++ /dev/null @@ -1,29 +0,0 @@ -mir_dataflow_path_must_end_in_filename = - path must end in a filename - -mir_dataflow_unknown_formatter = - unknown formatter - -mir_dataflow_duplicate_values_for = - duplicate values for `{$name}` - -mir_dataflow_requires_an_argument = - `{$name}` requires an argument - -mir_dataflow_stop_after_dataflow_ended_compilation = - stop_after_dataflow ended compilation - -mir_dataflow_peek_must_be_place_or_ref_place = - rustc_peek: argument expression must be either `place` or `&place` - -mir_dataflow_peek_must_be_not_temporary = - dataflow::sanity_check cannot feed a non-temp to rustc_peek - -mir_dataflow_peek_bit_not_set = - rustc_peek: bit not set - -mir_dataflow_peek_argument_not_a_local = - rustc_peek: argument was not a local - -mir_dataflow_peek_argument_untracked = - rustc_peek: argument untracked diff --git a/compiler/rustc_mir_dataflow/messages.ftl b/compiler/rustc_mir_dataflow/messages.ftl new file mode 100644 index 00000000000..98854152508 --- /dev/null +++ b/compiler/rustc_mir_dataflow/messages.ftl @@ -0,0 +1,29 @@ +mir_dataflow_path_must_end_in_filename = + path must end in a filename + +mir_dataflow_unknown_formatter = + unknown formatter + +mir_dataflow_duplicate_values_for = + duplicate values for `{$name}` + +mir_dataflow_requires_an_argument = + `{$name}` requires an argument + +mir_dataflow_stop_after_dataflow_ended_compilation = + stop_after_dataflow ended compilation + +mir_dataflow_peek_must_be_place_or_ref_place = + rustc_peek: argument expression must be either `place` or `&place` + +mir_dataflow_peek_must_be_not_temporary = + dataflow::sanity_check cannot feed a non-temp to rustc_peek + +mir_dataflow_peek_bit_not_set = + rustc_peek: bit not set + +mir_dataflow_peek_argument_not_a_local = + rustc_peek: argument was not a local + +mir_dataflow_peek_argument_untracked = + rustc_peek: argument untracked diff --git a/compiler/rustc_mir_dataflow/src/lib.rs b/compiler/rustc_mir_dataflow/src/lib.rs index b1e03faff05..4ed6f7e90ff 100644 --- a/compiler/rustc_mir_dataflow/src/lib.rs +++ b/compiler/rustc_mir_dataflow/src/lib.rs @@ -46,7 +46,7 @@ pub mod storage; pub mod un_derefer; pub mod value_analysis; -fluent_messages! { "../locales/en-US.ftl" } +fluent_messages! { "../messages.ftl" } pub(crate) mod indexes { pub(crate) use super::move_paths::MovePathIndex; diff --git a/compiler/rustc_monomorphize/locales/en-US.ftl b/compiler/rustc_monomorphize/locales/en-US.ftl deleted file mode 100644 index 6cea6a603f3..00000000000 --- a/compiler/rustc_monomorphize/locales/en-US.ftl +++ /dev/null @@ -1,32 +0,0 @@ -monomorphize_recursion_limit = - reached the recursion limit while instantiating `{$shrunk}` - .note = `{$def_path_str}` defined here - -monomorphize_written_to_path = the full type name has been written to '{$path}' - -monomorphize_type_length_limit = reached the type-length limit while instantiating `{$shrunk}` - -monomorphize_consider_type_length_limit = - consider adding a `#![type_length_limit="{$type_length}"]` attribute to your crate - -monomorphize_fatal_error = {$error_message} - -monomorphize_unknown_partition_strategy = unknown partitioning strategy - -monomorphize_symbol_already_defined = symbol `{$symbol}` is already defined - -monomorphize_unused_generic_params = item has unused generic parameters - -monomorphize_large_assignments = - moving {$size} bytes - .label = value moved from here - .note = The current maximum size is {$limit}, but it can be customized with the move_size_limit attribute: `#![move_size_limit = "..."]` - -monomorphize_couldnt_dump_mono_stats = - unexpected error occurred while dumping monomorphization stats: {$error} - -monomorphize_encountered_error_while_instantiating = - the above error was encountered while instantiating `{$formatted_item}` - -monomorphize_unknown_cgu_collection_mode = - unknown codegen-item collection mode '{$mode}', falling back to 'lazy' mode diff --git a/compiler/rustc_monomorphize/messages.ftl b/compiler/rustc_monomorphize/messages.ftl new file mode 100644 index 00000000000..6cea6a603f3 --- /dev/null +++ b/compiler/rustc_monomorphize/messages.ftl @@ -0,0 +1,32 @@ +monomorphize_recursion_limit = + reached the recursion limit while instantiating `{$shrunk}` + .note = `{$def_path_str}` defined here + +monomorphize_written_to_path = the full type name has been written to '{$path}' + +monomorphize_type_length_limit = reached the type-length limit while instantiating `{$shrunk}` + +monomorphize_consider_type_length_limit = + consider adding a `#![type_length_limit="{$type_length}"]` attribute to your crate + +monomorphize_fatal_error = {$error_message} + +monomorphize_unknown_partition_strategy = unknown partitioning strategy + +monomorphize_symbol_already_defined = symbol `{$symbol}` is already defined + +monomorphize_unused_generic_params = item has unused generic parameters + +monomorphize_large_assignments = + moving {$size} bytes + .label = value moved from here + .note = The current maximum size is {$limit}, but it can be customized with the move_size_limit attribute: `#![move_size_limit = "..."]` + +monomorphize_couldnt_dump_mono_stats = + unexpected error occurred while dumping monomorphization stats: {$error} + +monomorphize_encountered_error_while_instantiating = + the above error was encountered while instantiating `{$formatted_item}` + +monomorphize_unknown_cgu_collection_mode = + unknown codegen-item collection mode '{$mode}', falling back to 'lazy' mode diff --git a/compiler/rustc_monomorphize/src/lib.rs b/compiler/rustc_monomorphize/src/lib.rs index f6b791f29c1..5000fb71937 100644 --- a/compiler/rustc_monomorphize/src/lib.rs +++ b/compiler/rustc_monomorphize/src/lib.rs @@ -23,7 +23,7 @@ mod partitioning; mod polymorphize; mod util; -fluent_messages! { "../locales/en-US.ftl" } +fluent_messages! { "../messages.ftl" } fn custom_coerce_unsize_info<'tcx>( tcx: TyCtxtAt<'tcx>, diff --git a/compiler/rustc_parse/locales/en-US.ftl b/compiler/rustc_parse/locales/en-US.ftl deleted file mode 100644 index ab7931d74d7..00000000000 --- a/compiler/rustc_parse/locales/en-US.ftl +++ /dev/null @@ -1,733 +0,0 @@ -parse_struct_literal_body_without_path = - struct literal body without path - .suggestion = you might have forgotten to add the struct literal inside the block - -parse_struct_literal_needing_parens = - invalid struct literal - .suggestion = you might need to surround the struct literal in parentheses - -parse_maybe_report_ambiguous_plus = - ambiguous `+` in a type - .suggestion = use parentheses to disambiguate - -parse_maybe_recover_from_bad_type_plus = - expected a path on the left-hand side of `+`, not `{$ty}` - -parse_add_paren = try adding parentheses - -parse_forgot_paren = perhaps you forgot parentheses? - -parse_expect_path = expected a path - -parse_maybe_recover_from_bad_qpath_stage_2 = - missing angle brackets in associated item path - .suggestion = try: `{$ty}` - -parse_incorrect_semicolon = - expected item, found `;` - .suggestion = remove this semicolon - .help = {$name} declarations are not followed by a semicolon - -parse_incorrect_use_of_await = - incorrect use of `await` - .parentheses_suggestion = `await` is not a method call, remove the parentheses - .postfix_suggestion = `await` is a postfix operation - -parse_in_in_typo = - expected iterable, found keyword `in` - .suggestion = remove the duplicated `in` - -parse_invalid_variable_declaration = - invalid variable declaration - -parse_switch_mut_let_order = - switch the order of `mut` and `let` -parse_missing_let_before_mut = missing keyword -parse_use_let_not_auto = write `let` instead of `auto` to introduce a new variable -parse_use_let_not_var = write `let` instead of `var` to introduce a new variable - -parse_invalid_comparison_operator = invalid comparison operator `{$invalid}` - .use_instead = `{$invalid}` is not a valid comparison operator, use `{$correct}` - .spaceship_operator_invalid = `<=>` is not a valid comparison operator, use `std::cmp::Ordering` - -parse_invalid_logical_operator = `{$incorrect}` is not a logical operator - .note = unlike in e.g., Python and PHP, `&&` and `||` are used for logical operators - .use_amp_amp_for_conjunction = use `&&` to perform logical conjunction - .use_pipe_pipe_for_disjunction = use `||` to perform logical disjunction - -parse_tilde_is_not_unary_operator = `~` cannot be used as a unary operator - .suggestion = use `!` to perform bitwise not - -parse_unexpected_if_with_if = unexpected `if` in the condition expression - .suggestion = remove the `if` - -parse_unexpected_token_after_not = unexpected {$negated_desc} after identifier -parse_unexpected_token_after_not_bitwise = use `!` to perform bitwise not -parse_unexpected_token_after_not_logical = use `!` to perform logical negation -parse_unexpected_token_after_not_default = use `!` to perform logical negation or bitwise not - -parse_malformed_loop_label = malformed loop label - .suggestion = use the correct loop label format - -parse_lifetime_in_borrow_expression = borrow expressions cannot be annotated with lifetimes - .suggestion = remove the lifetime annotation - .label = annotated with lifetime here - -parse_field_expression_with_generic = field expressions cannot have generic arguments - -parse_macro_invocation_with_qualified_path = macros cannot use qualified paths - -parse_unexpected_token_after_label = expected `while`, `for`, `loop` or `{"{"}` after a label - .suggestion_remove_label = consider removing the label - .suggestion_enclose_in_block = consider enclosing expression in a block - -parse_require_colon_after_labeled_expression = labeled expression must be followed by `:` - .note = labels are used before loops and blocks, allowing e.g., `break 'label` to them - .label = the label - .suggestion = add `:` after the label - -parse_do_catch_syntax_removed = found removed `do catch` syntax - .note = following RFC #2388, the new non-placeholder syntax is `try` - .suggestion = replace with the new syntax - -parse_float_literal_requires_integer_part = float literals must have an integer part - .suggestion = must have an integer part - -parse_invalid_int_literal_width = invalid width `{$width}` for integer literal - .help = valid widths are 8, 16, 32, 64 and 128 - -parse_invalid_num_literal_base_prefix = invalid base prefix for number literal - .note = base prefixes (`0xff`, `0b1010`, `0o755`) are lowercase - .suggestion = try making the prefix lowercase - -parse_invalid_num_literal_suffix = invalid suffix `{$suffix}` for number literal - .label = invalid suffix `{$suffix}` - .help = the suffix must be one of the numeric types (`u32`, `isize`, `f32`, etc.) - -parse_invalid_float_literal_width = invalid width `{$width}` for float literal - .help = valid widths are 32 and 64 - -parse_invalid_float_literal_suffix = invalid suffix `{$suffix}` for float literal - .label = invalid suffix `{$suffix}` - .help = valid suffixes are `f32` and `f64` - -parse_int_literal_too_large = integer literal is too large - -parse_missing_semicolon_before_array = expected `;`, found `[` - .suggestion = consider adding `;` here - -parse_invalid_block_macro_segment = cannot use a `block` macro fragment here - .label = the `block` fragment is within this context - -parse_expect_dotdot_not_dotdotdot = expected `..`, found `...` - .suggestion = use `..` to fill in the rest of the fields - -parse_if_expression_missing_then_block = this `if` expression is missing a block after the condition - .add_then_block = add a block here - .condition_possibly_unfinished = this binary operation is possibly unfinished - -parse_if_expression_missing_condition = missing condition for `if` expression - .condition_label = expected condition here - .block_label = if this block is the condition of the `if` expression, then it must be followed by another block - -parse_expected_expression_found_let = expected expression, found `let` statement - -parse_expect_eq_instead_of_eqeq = expected `=`, found `==` - .suggestion = consider using `=` here - -parse_expected_else_block = expected `{"{"}`, found {$first_tok} - .label = expected an `if` or a block after this `else` - .suggestion = add an `if` if this is the condition of a chained `else if` statement - -parse_outer_attribute_not_allowed_on_if_else = outer attributes are not allowed on `if` and `else` branches - .branch_label = the attributes are attached to this branch - .ctx_label = the branch belongs to this `{$ctx}` - .suggestion = remove the attributes - -parse_missing_in_in_for_loop = missing `in` in `for` loop - .use_in_not_of = try using `in` here instead - .add_in = try adding `in` here - -parse_missing_expression_in_for_loop = missing expression to iterate on in `for` loop - .suggestion = try adding an expression to the `for` loop - -parse_loop_else = `{$loop_kind}...else` loops are not supported - .note = consider moving this `else` clause to a separate `if` statement and use a `bool` variable to control if it should run - .loop_keyword = `else` is attached to this loop - -parse_missing_comma_after_match_arm = expected `,` following `match` arm - .suggestion = missing a comma here to end this `match` arm - -parse_catch_after_try = keyword `catch` cannot follow a `try` block - .help = try using `match` on the result of the `try` block instead - -parse_comma_after_base_struct = cannot use a comma after the base struct - .note = the base struct must always be the last field - .suggestion = remove this comma - -parse_eq_field_init = expected `:`, found `=` - .suggestion = replace equals symbol with a colon - -parse_dotdotdot = unexpected token: `...` - .suggest_exclusive_range = use `..` for an exclusive range - .suggest_inclusive_range = or `..=` for an inclusive range - -parse_left_arrow_operator = unexpected token: `<-` - .suggestion = if you meant to write a comparison against a negative value, add a space in between `<` and `-` - -parse_remove_let = expected pattern, found `let` - .suggestion = remove the unnecessary `let` keyword - -parse_use_eq_instead = unexpected `==` - .suggestion = try using `=` instead - -parse_use_empty_block_not_semi = expected { "`{}`" }, found `;` - .suggestion = try using { "`{}`" } instead - -parse_comparison_interpreted_as_generic = - `<` is interpreted as a start of generic arguments for `{$type}`, not a comparison - .label_args = interpreted as generic arguments - .label_comparison = not interpreted as comparison - .suggestion = try comparing the cast value - -parse_shift_interpreted_as_generic = - `<<` is interpreted as a start of generic arguments for `{$type}`, not a shift - .label_args = interpreted as generic arguments - .label_comparison = not interpreted as shift - .suggestion = try shifting the cast value - -parse_found_expr_would_be_stmt = expected expression, found `{$token}` - .label = expected expression - -parse_leading_plus_not_supported = leading `+` is not supported - .label = unexpected `+` - .suggestion_remove_plus = try removing the `+` - -parse_parentheses_with_struct_fields = invalid `struct` delimiters or `fn` call arguments - .suggestion_braces_for_struct = if `{$type}` is a struct, use braces as delimiters - .suggestion_no_fields_for_fn = if `{$type}` is a function, use the arguments directly - -parse_labeled_loop_in_break = parentheses are required around this expression to avoid confusion with a labeled break expression - -parse_sugg_wrap_expression_in_parentheses = wrap the expression in parentheses - -parse_array_brackets_instead_of_braces = this is a block expression, not an array - .suggestion = to make an array, use square brackets instead of curly braces - -parse_match_arm_body_without_braces = `match` arm body without braces - .label_statements = {$num_statements -> - [one] this statement is not surrounded by a body - *[other] these statements are not surrounded by a body - } - .label_arrow = while parsing the `match` arm starting here - .suggestion_add_braces = surround the {$num_statements -> - [one] statement - *[other] statements - } with a body - .suggestion_use_comma_not_semicolon = replace `;` with `,` to end a `match` arm expression - -parse_inclusive_range_extra_equals = unexpected `=` after inclusive range - .suggestion_remove_eq = use `..=` instead - .note = inclusive ranges end with a single equals sign (`..=`) - -parse_inclusive_range_match_arrow = unexpected `>` after inclusive range - .label = this is parsed as an inclusive range `..=` - .suggestion = add a space between the pattern and `=>` - -parse_inclusive_range_no_end = inclusive range with no end - .suggestion_open_range = use `..` instead - .note = inclusive ranges must be bounded at the end (`..=b` or `a..=b`) - -parse_struct_literal_not_allowed_here = struct literals are not allowed here - .suggestion = surround the struct literal with parentheses - -parse_invalid_interpolated_expression = invalid interpolated expression - -parse_hexadecimal_float_literal_not_supported = hexadecimal float literal is not supported -parse_octal_float_literal_not_supported = octal float literal is not supported -parse_binary_float_literal_not_supported = binary float literal is not supported -parse_not_supported = not supported - -parse_invalid_literal_suffix = suffixes on {$kind} literals are invalid - .label = invalid suffix `{$suffix}` - -parse_invalid_literal_suffix_on_tuple_index = suffixes on a tuple index are invalid - .label = invalid suffix `{$suffix}` - .tuple_exception_line_1 = `{$suffix}` is *temporarily* accepted on tuple index fields as it was incorrectly accepted on stable for a few releases - .tuple_exception_line_2 = on proc macros, you'll want to use `syn::Index::from` or `proc_macro::Literal::*_unsuffixed` for code that will desugar to tuple field access - .tuple_exception_line_3 = see issue #60210 for more information - -parse_non_string_abi_literal = non-string ABI literal - .suggestion = specify the ABI with a string literal - -parse_mismatched_closing_delimiter = mismatched closing delimiter: `{$delimiter}` - .label_unmatched = mismatched closing delimiter - .label_opening_candidate = closing delimiter possibly meant for this - .label_unclosed = unclosed delimiter - -parse_incorrect_visibility_restriction = incorrect visibility restriction - .help = some possible visibility restrictions are: - `pub(crate)`: visible only on the current crate - `pub(super)`: visible only in the current module's parent - `pub(in path::to::module)`: visible only on the specified path - .suggestion = make this visible only to module `{$inner_str}` with `in` - -parse_assignment_else_not_allowed = ... else {"{"} ... {"}"} is not allowed - -parse_expected_statement_after_outer_attr = expected statement after outer attribute - -parse_doc_comment_does_not_document_anything = found a documentation comment that doesn't document anything - .help = doc comments must come before what they document, if a comment was intended use `//` - .suggestion = missing comma here - -parse_const_let_mutually_exclusive = `const` and `let` are mutually exclusive - .suggestion = remove `let` - -parse_invalid_expression_in_let_else = a `{$operator}` expression cannot be directly assigned in `let...else` -parse_invalid_curly_in_let_else = right curly brace `{"}"}` before `else` in a `let...else` statement not allowed -parse_extra_if_in_let_else = remove the `if` if you meant to write a `let...else` statement - -parse_compound_assignment_expression_in_let = can't reassign to an uninitialized variable - .suggestion = initialize the variable - .help = if you meant to overwrite, remove the `let` binding - -parse_suffixed_literal_in_attribute = suffixed literals are not allowed in attributes - .help = instead of using a suffixed literal (`1u8`, `1.0f32`, etc.), use an unsuffixed version (`1`, `1.0`, etc.) - -parse_invalid_meta_item = expected unsuffixed literal or identifier, found `{$token}` - -parse_label_inner_attr_does_not_annotate_this = the inner attribute doesn't annotate this {$item} -parse_sugg_change_inner_attr_to_outer = to annotate the {$item}, change the attribute from inner to outer style - -parse_inner_attr_not_permitted_after_outer_doc_comment = an inner attribute is not permitted following an outer doc comment - .label_attr = not permitted following an outer doc comment - .label_prev_doc_comment = previous doc comment - .label_does_not_annotate_this = {parse_label_inner_attr_does_not_annotate_this} - .sugg_change_inner_to_outer = {parse_sugg_change_inner_attr_to_outer} - -parse_inner_attr_not_permitted_after_outer_attr = an inner attribute is not permitted following an outer attribute - .label_attr = not permitted following an outer attribute - .label_prev_attr = previous outer attribute - .label_does_not_annotate_this = {parse_label_inner_attr_does_not_annotate_this} - .sugg_change_inner_to_outer = {parse_sugg_change_inner_attr_to_outer} - -parse_inner_attr_not_permitted = an inner attribute is not permitted in this context - .label_does_not_annotate_this = {parse_label_inner_attr_does_not_annotate_this} - .sugg_change_inner_to_outer = {parse_sugg_change_inner_attr_to_outer} - -parse_inner_attr_explanation = inner attributes, like `#![no_std]`, annotate the item enclosing them, and are usually found at the beginning of source files -parse_outer_attr_explanation = outer attributes, like `#[test]`, annotate the item following them - -parse_inner_doc_comment_not_permitted = expected outer doc comment - .note = inner doc comments like this (starting with `//!` or `/*!`) can only appear before items - .suggestion = you might have meant to write a regular comment - .label_does_not_annotate_this = the inner doc comment doesn't annotate this {$item} - .sugg_change_inner_to_outer = to annotate the {$item}, change the doc comment from inner to outer style - -parse_expected_identifier_found_reserved_identifier_str = expected identifier, found reserved identifier `{$token}` -parse_expected_identifier_found_keyword_str = expected identifier, found keyword `{$token}` -parse_expected_identifier_found_reserved_keyword_str = expected identifier, found reserved keyword `{$token}` -parse_expected_identifier_found_doc_comment_str = expected identifier, found doc comment `{$token}` -parse_expected_identifier_found_str = expected identifier, found `{$token}` - -parse_expected_identifier_found_reserved_identifier = expected identifier, found reserved identifier -parse_expected_identifier_found_keyword = expected identifier, found keyword -parse_expected_identifier_found_reserved_keyword = expected identifier, found reserved keyword -parse_expected_identifier_found_doc_comment = expected identifier, found doc comment -parse_expected_identifier = expected identifier - -parse_sugg_escape_to_use_as_identifier = escape `{$ident_name}` to use it as an identifier - -parse_sugg_remove_comma = remove this comma - -parse_expected_semi_found_reserved_identifier_str = expected `;`, found reserved identifier `{$token}` -parse_expected_semi_found_keyword_str = expected `;`, found keyword `{$token}` -parse_expected_semi_found_reserved_keyword_str = expected `;`, found reserved keyword `{$token}` -parse_expected_semi_found_doc_comment_str = expected `;`, found doc comment `{$token}` -parse_expected_semi_found_str = expected `;`, found `{$token}` - -parse_sugg_change_this_to_semi = change this to `;` -parse_sugg_add_semi = add `;` here -parse_label_unexpected_token = unexpected token - -parse_unmatched_angle_brackets = {$num_extra_brackets -> - [one] unmatched angle bracket - *[other] unmatched angle brackets - } - .suggestion = {$num_extra_brackets -> - [one] remove extra angle bracket - *[other] remove extra angle brackets - } - -parse_generic_parameters_without_angle_brackets = generic parameters without surrounding angle brackets - .suggestion = surround the type parameters with angle brackets - -parse_comparison_operators_cannot_be_chained = comparison operators cannot be chained - .sugg_parentheses_for_function_args = or use `(...)` if you meant to specify fn arguments - .sugg_split_comparison = split the comparison into two - .sugg_parenthesize = parenthesize the comparison -parse_sugg_turbofish_syntax = use `::<...>` instead of `<...>` to specify lifetime, type, or const arguments - -parse_question_mark_in_type = invalid `?` in type - .label = `?` is only allowed on expressions, not types - .suggestion = if you meant to express that the type might not contain a value, use the `Option` wrapper type - -parse_unexpected_parentheses_in_for_head = unexpected parentheses surrounding `for` loop head - .suggestion = remove parentheses in `for` loop - -parse_doc_comment_on_param_type = documentation comments cannot be applied to a function parameter's type - .label = doc comments are not allowed here - -parse_attribute_on_param_type = attributes cannot be applied to a function parameter's type - .label = attributes are not allowed here - -parse_pattern_method_param_without_body = patterns aren't allowed in methods without bodies - .suggestion = give this argument a name or use an underscore to ignore it - -parse_self_param_not_first = unexpected `self` parameter in function - .label = must be the first parameter of an associated function - -parse_const_generic_without_braces = expressions must be enclosed in braces to be used as const generic arguments - .suggestion = enclose the `const` expression in braces - -parse_unexpected_const_param_declaration = unexpected `const` parameter declaration - .label = expected a `const` expression, not a parameter declaration - .suggestion = `const` parameters must be declared for the `impl` - -parse_unexpected_const_in_generic_param = expected lifetime, type, or constant, found keyword `const` - .suggestion = the `const` keyword is only needed in the definition of the type - -parse_async_move_order_incorrect = the order of `move` and `async` is incorrect - .suggestion = try switching the order - -parse_double_colon_in_bound = expected `:` followed by trait or lifetime - .suggestion = use single colon - -parse_fn_ptr_with_generics = function pointer types may not have generic parameters - .suggestion = consider moving the lifetime {$arity -> - [one] parameter - *[other] parameters - } to {$for_param_list_exists -> - [true] the - *[false] a - } `for` parameter list - -parse_invalid_identifier_with_leading_number = identifiers cannot start with a number - -parse_maybe_fn_typo_with_impl = you might have meant to write `impl` instead of `fn` - .suggestion = replace `fn` with `impl` here - -parse_expected_fn_path_found_fn_keyword = expected identifier, found keyword `fn` - .suggestion = use `Fn` to refer to the trait - -parse_where_clause_before_tuple_struct_body = where clauses are not allowed before tuple struct bodies - .label = unexpected where clause - .name_label = while parsing this tuple struct - .body_label = the struct body - .suggestion = move the body before the where clause - -parse_async_fn_in_2015 = `async fn` is not permitted in Rust 2015 - .label = to use `async fn`, switch to Rust 2018 or later - -parse_async_block_in_2015 = `async` blocks are only allowed in Rust 2018 or later - -parse_self_argument_pointer = cannot pass `self` by raw pointer - .label = cannot pass `self` by raw pointer - -parse_visibility_not_followed_by_item = visibility `{$vis}` is not followed by an item - .label = the visibility - .help = you likely meant to define an item, e.g., `{$vis} fn foo() {"{}"}` - -parse_default_not_followed_by_item = `default` is not followed by an item - .label = the `default` qualifier - .note = only `fn`, `const`, `type`, or `impl` items may be prefixed by `default` - -parse_missing_struct_for_struct_definition = missing `struct` for struct definition - .suggestion = add `struct` here to parse `{$ident}` as a public struct - -parse_missing_fn_for_function_definition = missing `fn` for function definition - .suggestion = add `fn` here to parse `{$ident}` as a public function - -parse_missing_fn_for_method_definition = missing `fn` for method definition - .suggestion = add `fn` here to parse `{$ident}` as a public method - -parse_ambiguous_missing_keyword_for_item_definition = missing `fn` or `struct` for function or struct definition - .suggestion = if you meant to call a macro, try - .help = if you meant to call a macro, remove the `pub` and add a trailing `!` after the identifier - -parse_missing_trait_in_trait_impl = missing trait in a trait impl - .suggestion_add_trait = add a trait here - .suggestion_remove_for = for an inherent impl, drop this `for` - -parse_missing_for_in_trait_impl = missing `for` in a trait impl - .suggestion = add `for` here - -parse_expected_trait_in_trait_impl_found_type = expected a trait, found type - -parse_non_item_in_item_list = non-item in item list - .suggestion_use_const_not_let = consider using `const` instead of `let` for associated const - .label_list_start = item list starts here - .label_non_item = non-item starts here - .label_list_end = item list ends here - .suggestion_remove_semicolon = consider removing this semicolon - -parse_bounds_not_allowed_on_trait_aliases = bounds are not allowed on trait aliases - -parse_trait_alias_cannot_be_auto = trait aliases cannot be `auto` -parse_trait_alias_cannot_be_unsafe = trait aliases cannot be `unsafe` - -parse_associated_static_item_not_allowed = associated `static` items are not allowed - -parse_extern_crate_name_with_dashes = crate name using dashes are not valid in `extern crate` statements - .label = dash-separated idents are not valid - .suggestion = if the original crate name uses dashes you need to use underscores in the code - -parse_extern_item_cannot_be_const = extern items cannot be `const` - .suggestion = try using a static value - .note = for more information, visit https://doc.rust-lang.org/std/keyword.extern.html - -parse_const_global_cannot_be_mutable = const globals cannot be mutable - .label = cannot be mutable - .suggestion = you might want to declare a static instead - -parse_missing_const_type = missing type for `{$kind}` item - .suggestion = provide a type for the item - -parse_enum_struct_mutually_exclusive = `enum` and `struct` are mutually exclusive - .suggestion = replace `enum struct` with - -parse_unexpected_token_after_struct_name = expected `where`, `{"{"}`, `(`, or `;` after struct name -parse_unexpected_token_after_struct_name_found_reserved_identifier = expected `where`, `{"{"}`, `(`, or `;` after struct name, found reserved identifier `{$token}` -parse_unexpected_token_after_struct_name_found_keyword = expected `where`, `{"{"}`, `(`, or `;` after struct name, found keyword `{$token}` -parse_unexpected_token_after_struct_name_found_reserved_keyword = expected `where`, `{"{"}`, `(`, or `;` after struct name, found reserved keyword `{$token}` -parse_unexpected_token_after_struct_name_found_doc_comment = expected `where`, `{"{"}`, `(`, or `;` after struct name, found doc comment `{$token}` -parse_unexpected_token_after_struct_name_found_other = expected `where`, `{"{"}`, `(`, or `;` after struct name, found `{$token}` - -parse_unexpected_self_in_generic_parameters = unexpected keyword `Self` in generic parameters - .note = you cannot use `Self` as a generic parameter because it is reserved for associated items - -parse_unexpected_default_value_for_lifetime_in_generic_parameters = unexpected default lifetime parameter - .label = lifetime parameters cannot have default values - -parse_multiple_where_clauses = cannot define duplicate `where` clauses on an item - .label = previous `where` clause starts here - .suggestion = consider joining the two `where` clauses into one - -parse_nonterminal_expected_item_keyword = expected an item keyword -parse_nonterminal_expected_statement = expected a statement -parse_nonterminal_expected_ident = expected ident, found `{$token}` -parse_nonterminal_expected_lifetime = expected a lifetime, found `{$token}` - -parse_or_pattern_not_allowed_in_let_binding = top-level or-patterns are not allowed in `let` bindings -parse_or_pattern_not_allowed_in_fn_parameters = top-level or-patterns are not allowed in function parameters -parse_sugg_remove_leading_vert_in_pattern = remove the `|` -parse_sugg_wrap_pattern_in_parens = wrap the pattern in parentheses - -parse_note_pattern_alternatives_use_single_vert = alternatives in or-patterns are separated with `|`, not `||` - -parse_unexpected_vert_vert_before_function_parameter = unexpected `||` before function parameter - .suggestion = remove the `||` - -parse_label_while_parsing_or_pattern_here = while parsing this or-pattern starting here - -parse_unexpected_vert_vert_in_pattern = unexpected token `||` in pattern - .suggestion = use a single `|` to separate multiple alternative patterns - -parse_trailing_vert_not_allowed = a trailing `|` is not allowed in an or-pattern - .suggestion = remove the `{$token}` - -parse_dotdotdot_rest_pattern = unexpected `...` - .label = not a valid pattern - .suggestion = for a rest pattern, use `..` instead of `...` - -parse_pattern_on_wrong_side_of_at = pattern on wrong side of `@` - .label_pattern = pattern on the left, should be on the right - .label_binding = binding on the right, should be on the left - .suggestion = switch the order - -parse_expected_binding_left_of_at = left-hand side of `@` must be a binding - .label_lhs = interpreted as a pattern, not a binding - .label_rhs = also a pattern - .note = bindings are `x`, `mut x`, `ref x`, and `ref mut x` - -parse_ambiguous_range_pattern = the range pattern here has ambiguous interpretation - .suggestion = add parentheses to clarify the precedence - -parse_unexpected_lifetime_in_pattern = unexpected lifetime `{$symbol}` in pattern - .suggestion = remove the lifetime - -parse_ref_mut_order_incorrect = the order of `mut` and `ref` is incorrect - .suggestion = try switching the order - -parse_mut_on_nested_ident_pattern = `mut` must be attached to each individual binding - .suggestion = add `mut` to each binding -parse_mut_on_non_ident_pattern = `mut` must be followed by a named binding - .suggestion = remove the `mut` prefix -parse_note_mut_pattern_usage = `mut` may be followed by `variable` and `variable @ pattern` - -parse_repeated_mut_in_pattern = `mut` on a binding may not be repeated - .suggestion = remove the additional `mut`s - -parse_dot_dot_dot_range_to_pattern_not_allowed = range-to patterns with `...` are not allowed - .suggestion = use `..=` instead - -parse_enum_pattern_instead_of_identifier = expected identifier, found enum pattern - -parse_dot_dot_dot_for_remaining_fields = expected field pattern, found `{$token_str}` - .suggestion = to omit remaining fields, use `..` - -parse_expected_comma_after_pattern_field = expected `,` - -parse_return_types_use_thin_arrow = return types are denoted using `->` - .suggestion = use `->` instead - -parse_need_plus_after_trait_object_lifetime = lifetime in trait object type must be followed by `+` - -parse_expected_mut_or_const_in_raw_pointer_type = expected `mut` or `const` keyword in raw pointer type - .suggestion = add `mut` or `const` here - -parse_lifetime_after_mut = lifetime must precede `mut` - .suggestion = place the lifetime before `mut` - -parse_dyn_after_mut = `mut` must precede `dyn` - .suggestion = place `mut` before `dyn` - -parse_fn_pointer_cannot_be_const = an `fn` pointer type cannot be `const` - .label = `const` because of this - .suggestion = remove the `const` qualifier - -parse_fn_pointer_cannot_be_async = an `fn` pointer type cannot be `async` - .label = `async` because of this - .suggestion = remove the `async` qualifier - -parse_nested_c_variadic_type = C-variadic type `...` may not be nested inside another type - -parse_invalid_dyn_keyword = invalid `dyn` keyword - .help = `dyn` is only needed at the start of a trait `+`-separated list - .suggestion = remove this keyword - -parse_negative_bounds_not_supported = negative bounds are not supported - .label = negative bounds are not supported - .suggestion = {$num_bounds -> - [one] remove the bound - *[other] remove the bounds - } - -parse_help_set_edition_cargo = set `edition = "{$edition}"` in `Cargo.toml` -parse_help_set_edition_standalone = pass `--edition {$edition}` to `rustc` -parse_note_edition_guide = for more on editions, read https://doc.rust-lang.org/edition-guide - -parse_unexpected_token_after_dot = unexpected token: `{$actual}` - -parse_cannot_be_raw_ident = `{$ident}` cannot be a raw identifier - -parse_cr_doc_comment = bare CR not allowed in {$block -> - [true] block doc-comment - *[false] doc-comment -} - -parse_no_digits_literal = no valid digits found for number - -parse_invalid_digit_literal = invalid digit for a base {$base} literal - -parse_empty_exponent_float = expected at least one digit in exponent - -parse_float_literal_unsupported_base = {$base} float literal is not supported - -parse_more_than_one_char = character literal may only contain one codepoint - .followed_by = this `{$chr}` is followed by the combining {$len -> - [one] mark - *[other] marks - } `{$escaped_marks}` - .non_printing = there are non-printing characters, the full sequence is `{$escaped}` - .consider_normalized = consider using the normalized form `{$ch}` of this character - .remove_non = consider removing the non-printing characters - .use_double_quotes = if you meant to write a {$is_byte -> - [true] byte string - *[false] `str` - } literal, use double quotes - -parse_no_brace_unicode_escape = incorrect unicode escape sequence - .label = {parse_no_brace_unicode_escape} - .use_braces = format of unicode escape sequences uses braces - .format_of_unicode = format of unicode escape sequences is `\u{"{...}"}` - -parse_invalid_unicode_escape = invalid unicode character escape - .label = invalid escape - .help = unicode escape must {$surrogate -> - [true] not be a surrogate - *[false] be at most 10FFFF - } - -parse_escape_only_char = {$byte -> - [true] byte - *[false] character - } constant must be escaped: `{$escaped_msg}` - .escape = escape the character - -parse_bare_cr = {$double_quotes -> - [true] bare CR not allowed in string, use `\r` instead - *[false] character constant must be escaped: `\r` - } - .escape = escape the character - -parse_bare_cr_in_raw_string = bare CR not allowed in raw string - -parse_too_short_hex_escape = numeric character escape is too short - -parse_invalid_char_in_escape = {parse_invalid_char_in_escape_msg}: `{$ch}` - .label = {parse_invalid_char_in_escape_msg} - -parse_invalid_char_in_escape_msg = invalid character in {$is_hex -> - [true] numeric character - *[false] unicode - } escape - -parse_out_of_range_hex_escape = out of range hex escape - .label = must be a character in the range [\x00-\x7f] - -parse_leading_underscore_unicode_escape = {parse_leading_underscore_unicode_escape_label}: `_` -parse_leading_underscore_unicode_escape_label = invalid start of unicode escape - -parse_overlong_unicode_escape = overlong unicode escape - .label = must have at most 6 hex digits - -parse_unclosed_unicode_escape = unterminated unicode escape - .label = missing a closing `{"}"}` - .terminate = terminate the unicode escape - -parse_unicode_escape_in_byte = unicode escape in byte string - .label = {parse_unicode_escape_in_byte} - .help = unicode escape sequences cannot be used as a byte or in a byte string - -parse_empty_unicode_escape = empty unicode escape - .label = this escape must have at least 1 hex digit - -parse_zero_chars = empty character literal - .label = {parse_zero_chars} - -parse_lone_slash = invalid trailing slash in literal - .label = {parse_lone_slash} - -parse_unskipped_whitespace = whitespace symbol '{$ch}' is not skipped - .label = {parse_unskipped_whitespace} - -parse_multiple_skipped_lines = multiple lines skipped by escaped newline - .label = skipping everything up to and including this point - -parse_unknown_prefix = prefix `{$prefix}` is unknown - .label = unknown prefix - .note = prefixed identifiers and literals are reserved since Rust 2021 - .suggestion_br = use `br` for a raw byte string - .suggestion_whitespace = consider inserting whitespace here - -parse_too_many_hashes = too many `#` symbols: raw strings may be delimited by up to 255 `#` symbols, but found {$num} - -parse_unknown_start_of_token = unknown start of token: {$escaped} - .sugg_quotes = Unicode characters '“' (Left Double Quotation Mark) and '”' (Right Double Quotation Mark) look like '{$ascii_str}' ({$ascii_name}), but are not - .sugg_other = Unicode character '{$ch}' ({$u_name}) looks like '{$ascii_str}' ({$ascii_name}), but it is not - .help_null = source files must contain UTF-8 encoded text, unexpected null bytes might occur when a different encoding is used - .note_repeats = character appears {$repeats -> - [one] once more - *[other] {$repeats} more times - } diff --git a/compiler/rustc_parse/messages.ftl b/compiler/rustc_parse/messages.ftl new file mode 100644 index 00000000000..ab7931d74d7 --- /dev/null +++ b/compiler/rustc_parse/messages.ftl @@ -0,0 +1,733 @@ +parse_struct_literal_body_without_path = + struct literal body without path + .suggestion = you might have forgotten to add the struct literal inside the block + +parse_struct_literal_needing_parens = + invalid struct literal + .suggestion = you might need to surround the struct literal in parentheses + +parse_maybe_report_ambiguous_plus = + ambiguous `+` in a type + .suggestion = use parentheses to disambiguate + +parse_maybe_recover_from_bad_type_plus = + expected a path on the left-hand side of `+`, not `{$ty}` + +parse_add_paren = try adding parentheses + +parse_forgot_paren = perhaps you forgot parentheses? + +parse_expect_path = expected a path + +parse_maybe_recover_from_bad_qpath_stage_2 = + missing angle brackets in associated item path + .suggestion = try: `{$ty}` + +parse_incorrect_semicolon = + expected item, found `;` + .suggestion = remove this semicolon + .help = {$name} declarations are not followed by a semicolon + +parse_incorrect_use_of_await = + incorrect use of `await` + .parentheses_suggestion = `await` is not a method call, remove the parentheses + .postfix_suggestion = `await` is a postfix operation + +parse_in_in_typo = + expected iterable, found keyword `in` + .suggestion = remove the duplicated `in` + +parse_invalid_variable_declaration = + invalid variable declaration + +parse_switch_mut_let_order = + switch the order of `mut` and `let` +parse_missing_let_before_mut = missing keyword +parse_use_let_not_auto = write `let` instead of `auto` to introduce a new variable +parse_use_let_not_var = write `let` instead of `var` to introduce a new variable + +parse_invalid_comparison_operator = invalid comparison operator `{$invalid}` + .use_instead = `{$invalid}` is not a valid comparison operator, use `{$correct}` + .spaceship_operator_invalid = `<=>` is not a valid comparison operator, use `std::cmp::Ordering` + +parse_invalid_logical_operator = `{$incorrect}` is not a logical operator + .note = unlike in e.g., Python and PHP, `&&` and `||` are used for logical operators + .use_amp_amp_for_conjunction = use `&&` to perform logical conjunction + .use_pipe_pipe_for_disjunction = use `||` to perform logical disjunction + +parse_tilde_is_not_unary_operator = `~` cannot be used as a unary operator + .suggestion = use `!` to perform bitwise not + +parse_unexpected_if_with_if = unexpected `if` in the condition expression + .suggestion = remove the `if` + +parse_unexpected_token_after_not = unexpected {$negated_desc} after identifier +parse_unexpected_token_after_not_bitwise = use `!` to perform bitwise not +parse_unexpected_token_after_not_logical = use `!` to perform logical negation +parse_unexpected_token_after_not_default = use `!` to perform logical negation or bitwise not + +parse_malformed_loop_label = malformed loop label + .suggestion = use the correct loop label format + +parse_lifetime_in_borrow_expression = borrow expressions cannot be annotated with lifetimes + .suggestion = remove the lifetime annotation + .label = annotated with lifetime here + +parse_field_expression_with_generic = field expressions cannot have generic arguments + +parse_macro_invocation_with_qualified_path = macros cannot use qualified paths + +parse_unexpected_token_after_label = expected `while`, `for`, `loop` or `{"{"}` after a label + .suggestion_remove_label = consider removing the label + .suggestion_enclose_in_block = consider enclosing expression in a block + +parse_require_colon_after_labeled_expression = labeled expression must be followed by `:` + .note = labels are used before loops and blocks, allowing e.g., `break 'label` to them + .label = the label + .suggestion = add `:` after the label + +parse_do_catch_syntax_removed = found removed `do catch` syntax + .note = following RFC #2388, the new non-placeholder syntax is `try` + .suggestion = replace with the new syntax + +parse_float_literal_requires_integer_part = float literals must have an integer part + .suggestion = must have an integer part + +parse_invalid_int_literal_width = invalid width `{$width}` for integer literal + .help = valid widths are 8, 16, 32, 64 and 128 + +parse_invalid_num_literal_base_prefix = invalid base prefix for number literal + .note = base prefixes (`0xff`, `0b1010`, `0o755`) are lowercase + .suggestion = try making the prefix lowercase + +parse_invalid_num_literal_suffix = invalid suffix `{$suffix}` for number literal + .label = invalid suffix `{$suffix}` + .help = the suffix must be one of the numeric types (`u32`, `isize`, `f32`, etc.) + +parse_invalid_float_literal_width = invalid width `{$width}` for float literal + .help = valid widths are 32 and 64 + +parse_invalid_float_literal_suffix = invalid suffix `{$suffix}` for float literal + .label = invalid suffix `{$suffix}` + .help = valid suffixes are `f32` and `f64` + +parse_int_literal_too_large = integer literal is too large + +parse_missing_semicolon_before_array = expected `;`, found `[` + .suggestion = consider adding `;` here + +parse_invalid_block_macro_segment = cannot use a `block` macro fragment here + .label = the `block` fragment is within this context + +parse_expect_dotdot_not_dotdotdot = expected `..`, found `...` + .suggestion = use `..` to fill in the rest of the fields + +parse_if_expression_missing_then_block = this `if` expression is missing a block after the condition + .add_then_block = add a block here + .condition_possibly_unfinished = this binary operation is possibly unfinished + +parse_if_expression_missing_condition = missing condition for `if` expression + .condition_label = expected condition here + .block_label = if this block is the condition of the `if` expression, then it must be followed by another block + +parse_expected_expression_found_let = expected expression, found `let` statement + +parse_expect_eq_instead_of_eqeq = expected `=`, found `==` + .suggestion = consider using `=` here + +parse_expected_else_block = expected `{"{"}`, found {$first_tok} + .label = expected an `if` or a block after this `else` + .suggestion = add an `if` if this is the condition of a chained `else if` statement + +parse_outer_attribute_not_allowed_on_if_else = outer attributes are not allowed on `if` and `else` branches + .branch_label = the attributes are attached to this branch + .ctx_label = the branch belongs to this `{$ctx}` + .suggestion = remove the attributes + +parse_missing_in_in_for_loop = missing `in` in `for` loop + .use_in_not_of = try using `in` here instead + .add_in = try adding `in` here + +parse_missing_expression_in_for_loop = missing expression to iterate on in `for` loop + .suggestion = try adding an expression to the `for` loop + +parse_loop_else = `{$loop_kind}...else` loops are not supported + .note = consider moving this `else` clause to a separate `if` statement and use a `bool` variable to control if it should run + .loop_keyword = `else` is attached to this loop + +parse_missing_comma_after_match_arm = expected `,` following `match` arm + .suggestion = missing a comma here to end this `match` arm + +parse_catch_after_try = keyword `catch` cannot follow a `try` block + .help = try using `match` on the result of the `try` block instead + +parse_comma_after_base_struct = cannot use a comma after the base struct + .note = the base struct must always be the last field + .suggestion = remove this comma + +parse_eq_field_init = expected `:`, found `=` + .suggestion = replace equals symbol with a colon + +parse_dotdotdot = unexpected token: `...` + .suggest_exclusive_range = use `..` for an exclusive range + .suggest_inclusive_range = or `..=` for an inclusive range + +parse_left_arrow_operator = unexpected token: `<-` + .suggestion = if you meant to write a comparison against a negative value, add a space in between `<` and `-` + +parse_remove_let = expected pattern, found `let` + .suggestion = remove the unnecessary `let` keyword + +parse_use_eq_instead = unexpected `==` + .suggestion = try using `=` instead + +parse_use_empty_block_not_semi = expected { "`{}`" }, found `;` + .suggestion = try using { "`{}`" } instead + +parse_comparison_interpreted_as_generic = + `<` is interpreted as a start of generic arguments for `{$type}`, not a comparison + .label_args = interpreted as generic arguments + .label_comparison = not interpreted as comparison + .suggestion = try comparing the cast value + +parse_shift_interpreted_as_generic = + `<<` is interpreted as a start of generic arguments for `{$type}`, not a shift + .label_args = interpreted as generic arguments + .label_comparison = not interpreted as shift + .suggestion = try shifting the cast value + +parse_found_expr_would_be_stmt = expected expression, found `{$token}` + .label = expected expression + +parse_leading_plus_not_supported = leading `+` is not supported + .label = unexpected `+` + .suggestion_remove_plus = try removing the `+` + +parse_parentheses_with_struct_fields = invalid `struct` delimiters or `fn` call arguments + .suggestion_braces_for_struct = if `{$type}` is a struct, use braces as delimiters + .suggestion_no_fields_for_fn = if `{$type}` is a function, use the arguments directly + +parse_labeled_loop_in_break = parentheses are required around this expression to avoid confusion with a labeled break expression + +parse_sugg_wrap_expression_in_parentheses = wrap the expression in parentheses + +parse_array_brackets_instead_of_braces = this is a block expression, not an array + .suggestion = to make an array, use square brackets instead of curly braces + +parse_match_arm_body_without_braces = `match` arm body without braces + .label_statements = {$num_statements -> + [one] this statement is not surrounded by a body + *[other] these statements are not surrounded by a body + } + .label_arrow = while parsing the `match` arm starting here + .suggestion_add_braces = surround the {$num_statements -> + [one] statement + *[other] statements + } with a body + .suggestion_use_comma_not_semicolon = replace `;` with `,` to end a `match` arm expression + +parse_inclusive_range_extra_equals = unexpected `=` after inclusive range + .suggestion_remove_eq = use `..=` instead + .note = inclusive ranges end with a single equals sign (`..=`) + +parse_inclusive_range_match_arrow = unexpected `>` after inclusive range + .label = this is parsed as an inclusive range `..=` + .suggestion = add a space between the pattern and `=>` + +parse_inclusive_range_no_end = inclusive range with no end + .suggestion_open_range = use `..` instead + .note = inclusive ranges must be bounded at the end (`..=b` or `a..=b`) + +parse_struct_literal_not_allowed_here = struct literals are not allowed here + .suggestion = surround the struct literal with parentheses + +parse_invalid_interpolated_expression = invalid interpolated expression + +parse_hexadecimal_float_literal_not_supported = hexadecimal float literal is not supported +parse_octal_float_literal_not_supported = octal float literal is not supported +parse_binary_float_literal_not_supported = binary float literal is not supported +parse_not_supported = not supported + +parse_invalid_literal_suffix = suffixes on {$kind} literals are invalid + .label = invalid suffix `{$suffix}` + +parse_invalid_literal_suffix_on_tuple_index = suffixes on a tuple index are invalid + .label = invalid suffix `{$suffix}` + .tuple_exception_line_1 = `{$suffix}` is *temporarily* accepted on tuple index fields as it was incorrectly accepted on stable for a few releases + .tuple_exception_line_2 = on proc macros, you'll want to use `syn::Index::from` or `proc_macro::Literal::*_unsuffixed` for code that will desugar to tuple field access + .tuple_exception_line_3 = see issue #60210 for more information + +parse_non_string_abi_literal = non-string ABI literal + .suggestion = specify the ABI with a string literal + +parse_mismatched_closing_delimiter = mismatched closing delimiter: `{$delimiter}` + .label_unmatched = mismatched closing delimiter + .label_opening_candidate = closing delimiter possibly meant for this + .label_unclosed = unclosed delimiter + +parse_incorrect_visibility_restriction = incorrect visibility restriction + .help = some possible visibility restrictions are: + `pub(crate)`: visible only on the current crate + `pub(super)`: visible only in the current module's parent + `pub(in path::to::module)`: visible only on the specified path + .suggestion = make this visible only to module `{$inner_str}` with `in` + +parse_assignment_else_not_allowed = ... else {"{"} ... {"}"} is not allowed + +parse_expected_statement_after_outer_attr = expected statement after outer attribute + +parse_doc_comment_does_not_document_anything = found a documentation comment that doesn't document anything + .help = doc comments must come before what they document, if a comment was intended use `//` + .suggestion = missing comma here + +parse_const_let_mutually_exclusive = `const` and `let` are mutually exclusive + .suggestion = remove `let` + +parse_invalid_expression_in_let_else = a `{$operator}` expression cannot be directly assigned in `let...else` +parse_invalid_curly_in_let_else = right curly brace `{"}"}` before `else` in a `let...else` statement not allowed +parse_extra_if_in_let_else = remove the `if` if you meant to write a `let...else` statement + +parse_compound_assignment_expression_in_let = can't reassign to an uninitialized variable + .suggestion = initialize the variable + .help = if you meant to overwrite, remove the `let` binding + +parse_suffixed_literal_in_attribute = suffixed literals are not allowed in attributes + .help = instead of using a suffixed literal (`1u8`, `1.0f32`, etc.), use an unsuffixed version (`1`, `1.0`, etc.) + +parse_invalid_meta_item = expected unsuffixed literal or identifier, found `{$token}` + +parse_label_inner_attr_does_not_annotate_this = the inner attribute doesn't annotate this {$item} +parse_sugg_change_inner_attr_to_outer = to annotate the {$item}, change the attribute from inner to outer style + +parse_inner_attr_not_permitted_after_outer_doc_comment = an inner attribute is not permitted following an outer doc comment + .label_attr = not permitted following an outer doc comment + .label_prev_doc_comment = previous doc comment + .label_does_not_annotate_this = {parse_label_inner_attr_does_not_annotate_this} + .sugg_change_inner_to_outer = {parse_sugg_change_inner_attr_to_outer} + +parse_inner_attr_not_permitted_after_outer_attr = an inner attribute is not permitted following an outer attribute + .label_attr = not permitted following an outer attribute + .label_prev_attr = previous outer attribute + .label_does_not_annotate_this = {parse_label_inner_attr_does_not_annotate_this} + .sugg_change_inner_to_outer = {parse_sugg_change_inner_attr_to_outer} + +parse_inner_attr_not_permitted = an inner attribute is not permitted in this context + .label_does_not_annotate_this = {parse_label_inner_attr_does_not_annotate_this} + .sugg_change_inner_to_outer = {parse_sugg_change_inner_attr_to_outer} + +parse_inner_attr_explanation = inner attributes, like `#![no_std]`, annotate the item enclosing them, and are usually found at the beginning of source files +parse_outer_attr_explanation = outer attributes, like `#[test]`, annotate the item following them + +parse_inner_doc_comment_not_permitted = expected outer doc comment + .note = inner doc comments like this (starting with `//!` or `/*!`) can only appear before items + .suggestion = you might have meant to write a regular comment + .label_does_not_annotate_this = the inner doc comment doesn't annotate this {$item} + .sugg_change_inner_to_outer = to annotate the {$item}, change the doc comment from inner to outer style + +parse_expected_identifier_found_reserved_identifier_str = expected identifier, found reserved identifier `{$token}` +parse_expected_identifier_found_keyword_str = expected identifier, found keyword `{$token}` +parse_expected_identifier_found_reserved_keyword_str = expected identifier, found reserved keyword `{$token}` +parse_expected_identifier_found_doc_comment_str = expected identifier, found doc comment `{$token}` +parse_expected_identifier_found_str = expected identifier, found `{$token}` + +parse_expected_identifier_found_reserved_identifier = expected identifier, found reserved identifier +parse_expected_identifier_found_keyword = expected identifier, found keyword +parse_expected_identifier_found_reserved_keyword = expected identifier, found reserved keyword +parse_expected_identifier_found_doc_comment = expected identifier, found doc comment +parse_expected_identifier = expected identifier + +parse_sugg_escape_to_use_as_identifier = escape `{$ident_name}` to use it as an identifier + +parse_sugg_remove_comma = remove this comma + +parse_expected_semi_found_reserved_identifier_str = expected `;`, found reserved identifier `{$token}` +parse_expected_semi_found_keyword_str = expected `;`, found keyword `{$token}` +parse_expected_semi_found_reserved_keyword_str = expected `;`, found reserved keyword `{$token}` +parse_expected_semi_found_doc_comment_str = expected `;`, found doc comment `{$token}` +parse_expected_semi_found_str = expected `;`, found `{$token}` + +parse_sugg_change_this_to_semi = change this to `;` +parse_sugg_add_semi = add `;` here +parse_label_unexpected_token = unexpected token + +parse_unmatched_angle_brackets = {$num_extra_brackets -> + [one] unmatched angle bracket + *[other] unmatched angle brackets + } + .suggestion = {$num_extra_brackets -> + [one] remove extra angle bracket + *[other] remove extra angle brackets + } + +parse_generic_parameters_without_angle_brackets = generic parameters without surrounding angle brackets + .suggestion = surround the type parameters with angle brackets + +parse_comparison_operators_cannot_be_chained = comparison operators cannot be chained + .sugg_parentheses_for_function_args = or use `(...)` if you meant to specify fn arguments + .sugg_split_comparison = split the comparison into two + .sugg_parenthesize = parenthesize the comparison +parse_sugg_turbofish_syntax = use `::<...>` instead of `<...>` to specify lifetime, type, or const arguments + +parse_question_mark_in_type = invalid `?` in type + .label = `?` is only allowed on expressions, not types + .suggestion = if you meant to express that the type might not contain a value, use the `Option` wrapper type + +parse_unexpected_parentheses_in_for_head = unexpected parentheses surrounding `for` loop head + .suggestion = remove parentheses in `for` loop + +parse_doc_comment_on_param_type = documentation comments cannot be applied to a function parameter's type + .label = doc comments are not allowed here + +parse_attribute_on_param_type = attributes cannot be applied to a function parameter's type + .label = attributes are not allowed here + +parse_pattern_method_param_without_body = patterns aren't allowed in methods without bodies + .suggestion = give this argument a name or use an underscore to ignore it + +parse_self_param_not_first = unexpected `self` parameter in function + .label = must be the first parameter of an associated function + +parse_const_generic_without_braces = expressions must be enclosed in braces to be used as const generic arguments + .suggestion = enclose the `const` expression in braces + +parse_unexpected_const_param_declaration = unexpected `const` parameter declaration + .label = expected a `const` expression, not a parameter declaration + .suggestion = `const` parameters must be declared for the `impl` + +parse_unexpected_const_in_generic_param = expected lifetime, type, or constant, found keyword `const` + .suggestion = the `const` keyword is only needed in the definition of the type + +parse_async_move_order_incorrect = the order of `move` and `async` is incorrect + .suggestion = try switching the order + +parse_double_colon_in_bound = expected `:` followed by trait or lifetime + .suggestion = use single colon + +parse_fn_ptr_with_generics = function pointer types may not have generic parameters + .suggestion = consider moving the lifetime {$arity -> + [one] parameter + *[other] parameters + } to {$for_param_list_exists -> + [true] the + *[false] a + } `for` parameter list + +parse_invalid_identifier_with_leading_number = identifiers cannot start with a number + +parse_maybe_fn_typo_with_impl = you might have meant to write `impl` instead of `fn` + .suggestion = replace `fn` with `impl` here + +parse_expected_fn_path_found_fn_keyword = expected identifier, found keyword `fn` + .suggestion = use `Fn` to refer to the trait + +parse_where_clause_before_tuple_struct_body = where clauses are not allowed before tuple struct bodies + .label = unexpected where clause + .name_label = while parsing this tuple struct + .body_label = the struct body + .suggestion = move the body before the where clause + +parse_async_fn_in_2015 = `async fn` is not permitted in Rust 2015 + .label = to use `async fn`, switch to Rust 2018 or later + +parse_async_block_in_2015 = `async` blocks are only allowed in Rust 2018 or later + +parse_self_argument_pointer = cannot pass `self` by raw pointer + .label = cannot pass `self` by raw pointer + +parse_visibility_not_followed_by_item = visibility `{$vis}` is not followed by an item + .label = the visibility + .help = you likely meant to define an item, e.g., `{$vis} fn foo() {"{}"}` + +parse_default_not_followed_by_item = `default` is not followed by an item + .label = the `default` qualifier + .note = only `fn`, `const`, `type`, or `impl` items may be prefixed by `default` + +parse_missing_struct_for_struct_definition = missing `struct` for struct definition + .suggestion = add `struct` here to parse `{$ident}` as a public struct + +parse_missing_fn_for_function_definition = missing `fn` for function definition + .suggestion = add `fn` here to parse `{$ident}` as a public function + +parse_missing_fn_for_method_definition = missing `fn` for method definition + .suggestion = add `fn` here to parse `{$ident}` as a public method + +parse_ambiguous_missing_keyword_for_item_definition = missing `fn` or `struct` for function or struct definition + .suggestion = if you meant to call a macro, try + .help = if you meant to call a macro, remove the `pub` and add a trailing `!` after the identifier + +parse_missing_trait_in_trait_impl = missing trait in a trait impl + .suggestion_add_trait = add a trait here + .suggestion_remove_for = for an inherent impl, drop this `for` + +parse_missing_for_in_trait_impl = missing `for` in a trait impl + .suggestion = add `for` here + +parse_expected_trait_in_trait_impl_found_type = expected a trait, found type + +parse_non_item_in_item_list = non-item in item list + .suggestion_use_const_not_let = consider using `const` instead of `let` for associated const + .label_list_start = item list starts here + .label_non_item = non-item starts here + .label_list_end = item list ends here + .suggestion_remove_semicolon = consider removing this semicolon + +parse_bounds_not_allowed_on_trait_aliases = bounds are not allowed on trait aliases + +parse_trait_alias_cannot_be_auto = trait aliases cannot be `auto` +parse_trait_alias_cannot_be_unsafe = trait aliases cannot be `unsafe` + +parse_associated_static_item_not_allowed = associated `static` items are not allowed + +parse_extern_crate_name_with_dashes = crate name using dashes are not valid in `extern crate` statements + .label = dash-separated idents are not valid + .suggestion = if the original crate name uses dashes you need to use underscores in the code + +parse_extern_item_cannot_be_const = extern items cannot be `const` + .suggestion = try using a static value + .note = for more information, visit https://doc.rust-lang.org/std/keyword.extern.html + +parse_const_global_cannot_be_mutable = const globals cannot be mutable + .label = cannot be mutable + .suggestion = you might want to declare a static instead + +parse_missing_const_type = missing type for `{$kind}` item + .suggestion = provide a type for the item + +parse_enum_struct_mutually_exclusive = `enum` and `struct` are mutually exclusive + .suggestion = replace `enum struct` with + +parse_unexpected_token_after_struct_name = expected `where`, `{"{"}`, `(`, or `;` after struct name +parse_unexpected_token_after_struct_name_found_reserved_identifier = expected `where`, `{"{"}`, `(`, or `;` after struct name, found reserved identifier `{$token}` +parse_unexpected_token_after_struct_name_found_keyword = expected `where`, `{"{"}`, `(`, or `;` after struct name, found keyword `{$token}` +parse_unexpected_token_after_struct_name_found_reserved_keyword = expected `where`, `{"{"}`, `(`, or `;` after struct name, found reserved keyword `{$token}` +parse_unexpected_token_after_struct_name_found_doc_comment = expected `where`, `{"{"}`, `(`, or `;` after struct name, found doc comment `{$token}` +parse_unexpected_token_after_struct_name_found_other = expected `where`, `{"{"}`, `(`, or `;` after struct name, found `{$token}` + +parse_unexpected_self_in_generic_parameters = unexpected keyword `Self` in generic parameters + .note = you cannot use `Self` as a generic parameter because it is reserved for associated items + +parse_unexpected_default_value_for_lifetime_in_generic_parameters = unexpected default lifetime parameter + .label = lifetime parameters cannot have default values + +parse_multiple_where_clauses = cannot define duplicate `where` clauses on an item + .label = previous `where` clause starts here + .suggestion = consider joining the two `where` clauses into one + +parse_nonterminal_expected_item_keyword = expected an item keyword +parse_nonterminal_expected_statement = expected a statement +parse_nonterminal_expected_ident = expected ident, found `{$token}` +parse_nonterminal_expected_lifetime = expected a lifetime, found `{$token}` + +parse_or_pattern_not_allowed_in_let_binding = top-level or-patterns are not allowed in `let` bindings +parse_or_pattern_not_allowed_in_fn_parameters = top-level or-patterns are not allowed in function parameters +parse_sugg_remove_leading_vert_in_pattern = remove the `|` +parse_sugg_wrap_pattern_in_parens = wrap the pattern in parentheses + +parse_note_pattern_alternatives_use_single_vert = alternatives in or-patterns are separated with `|`, not `||` + +parse_unexpected_vert_vert_before_function_parameter = unexpected `||` before function parameter + .suggestion = remove the `||` + +parse_label_while_parsing_or_pattern_here = while parsing this or-pattern starting here + +parse_unexpected_vert_vert_in_pattern = unexpected token `||` in pattern + .suggestion = use a single `|` to separate multiple alternative patterns + +parse_trailing_vert_not_allowed = a trailing `|` is not allowed in an or-pattern + .suggestion = remove the `{$token}` + +parse_dotdotdot_rest_pattern = unexpected `...` + .label = not a valid pattern + .suggestion = for a rest pattern, use `..` instead of `...` + +parse_pattern_on_wrong_side_of_at = pattern on wrong side of `@` + .label_pattern = pattern on the left, should be on the right + .label_binding = binding on the right, should be on the left + .suggestion = switch the order + +parse_expected_binding_left_of_at = left-hand side of `@` must be a binding + .label_lhs = interpreted as a pattern, not a binding + .label_rhs = also a pattern + .note = bindings are `x`, `mut x`, `ref x`, and `ref mut x` + +parse_ambiguous_range_pattern = the range pattern here has ambiguous interpretation + .suggestion = add parentheses to clarify the precedence + +parse_unexpected_lifetime_in_pattern = unexpected lifetime `{$symbol}` in pattern + .suggestion = remove the lifetime + +parse_ref_mut_order_incorrect = the order of `mut` and `ref` is incorrect + .suggestion = try switching the order + +parse_mut_on_nested_ident_pattern = `mut` must be attached to each individual binding + .suggestion = add `mut` to each binding +parse_mut_on_non_ident_pattern = `mut` must be followed by a named binding + .suggestion = remove the `mut` prefix +parse_note_mut_pattern_usage = `mut` may be followed by `variable` and `variable @ pattern` + +parse_repeated_mut_in_pattern = `mut` on a binding may not be repeated + .suggestion = remove the additional `mut`s + +parse_dot_dot_dot_range_to_pattern_not_allowed = range-to patterns with `...` are not allowed + .suggestion = use `..=` instead + +parse_enum_pattern_instead_of_identifier = expected identifier, found enum pattern + +parse_dot_dot_dot_for_remaining_fields = expected field pattern, found `{$token_str}` + .suggestion = to omit remaining fields, use `..` + +parse_expected_comma_after_pattern_field = expected `,` + +parse_return_types_use_thin_arrow = return types are denoted using `->` + .suggestion = use `->` instead + +parse_need_plus_after_trait_object_lifetime = lifetime in trait object type must be followed by `+` + +parse_expected_mut_or_const_in_raw_pointer_type = expected `mut` or `const` keyword in raw pointer type + .suggestion = add `mut` or `const` here + +parse_lifetime_after_mut = lifetime must precede `mut` + .suggestion = place the lifetime before `mut` + +parse_dyn_after_mut = `mut` must precede `dyn` + .suggestion = place `mut` before `dyn` + +parse_fn_pointer_cannot_be_const = an `fn` pointer type cannot be `const` + .label = `const` because of this + .suggestion = remove the `const` qualifier + +parse_fn_pointer_cannot_be_async = an `fn` pointer type cannot be `async` + .label = `async` because of this + .suggestion = remove the `async` qualifier + +parse_nested_c_variadic_type = C-variadic type `...` may not be nested inside another type + +parse_invalid_dyn_keyword = invalid `dyn` keyword + .help = `dyn` is only needed at the start of a trait `+`-separated list + .suggestion = remove this keyword + +parse_negative_bounds_not_supported = negative bounds are not supported + .label = negative bounds are not supported + .suggestion = {$num_bounds -> + [one] remove the bound + *[other] remove the bounds + } + +parse_help_set_edition_cargo = set `edition = "{$edition}"` in `Cargo.toml` +parse_help_set_edition_standalone = pass `--edition {$edition}` to `rustc` +parse_note_edition_guide = for more on editions, read https://doc.rust-lang.org/edition-guide + +parse_unexpected_token_after_dot = unexpected token: `{$actual}` + +parse_cannot_be_raw_ident = `{$ident}` cannot be a raw identifier + +parse_cr_doc_comment = bare CR not allowed in {$block -> + [true] block doc-comment + *[false] doc-comment +} + +parse_no_digits_literal = no valid digits found for number + +parse_invalid_digit_literal = invalid digit for a base {$base} literal + +parse_empty_exponent_float = expected at least one digit in exponent + +parse_float_literal_unsupported_base = {$base} float literal is not supported + +parse_more_than_one_char = character literal may only contain one codepoint + .followed_by = this `{$chr}` is followed by the combining {$len -> + [one] mark + *[other] marks + } `{$escaped_marks}` + .non_printing = there are non-printing characters, the full sequence is `{$escaped}` + .consider_normalized = consider using the normalized form `{$ch}` of this character + .remove_non = consider removing the non-printing characters + .use_double_quotes = if you meant to write a {$is_byte -> + [true] byte string + *[false] `str` + } literal, use double quotes + +parse_no_brace_unicode_escape = incorrect unicode escape sequence + .label = {parse_no_brace_unicode_escape} + .use_braces = format of unicode escape sequences uses braces + .format_of_unicode = format of unicode escape sequences is `\u{"{...}"}` + +parse_invalid_unicode_escape = invalid unicode character escape + .label = invalid escape + .help = unicode escape must {$surrogate -> + [true] not be a surrogate + *[false] be at most 10FFFF + } + +parse_escape_only_char = {$byte -> + [true] byte + *[false] character + } constant must be escaped: `{$escaped_msg}` + .escape = escape the character + +parse_bare_cr = {$double_quotes -> + [true] bare CR not allowed in string, use `\r` instead + *[false] character constant must be escaped: `\r` + } + .escape = escape the character + +parse_bare_cr_in_raw_string = bare CR not allowed in raw string + +parse_too_short_hex_escape = numeric character escape is too short + +parse_invalid_char_in_escape = {parse_invalid_char_in_escape_msg}: `{$ch}` + .label = {parse_invalid_char_in_escape_msg} + +parse_invalid_char_in_escape_msg = invalid character in {$is_hex -> + [true] numeric character + *[false] unicode + } escape + +parse_out_of_range_hex_escape = out of range hex escape + .label = must be a character in the range [\x00-\x7f] + +parse_leading_underscore_unicode_escape = {parse_leading_underscore_unicode_escape_label}: `_` +parse_leading_underscore_unicode_escape_label = invalid start of unicode escape + +parse_overlong_unicode_escape = overlong unicode escape + .label = must have at most 6 hex digits + +parse_unclosed_unicode_escape = unterminated unicode escape + .label = missing a closing `{"}"}` + .terminate = terminate the unicode escape + +parse_unicode_escape_in_byte = unicode escape in byte string + .label = {parse_unicode_escape_in_byte} + .help = unicode escape sequences cannot be used as a byte or in a byte string + +parse_empty_unicode_escape = empty unicode escape + .label = this escape must have at least 1 hex digit + +parse_zero_chars = empty character literal + .label = {parse_zero_chars} + +parse_lone_slash = invalid trailing slash in literal + .label = {parse_lone_slash} + +parse_unskipped_whitespace = whitespace symbol '{$ch}' is not skipped + .label = {parse_unskipped_whitespace} + +parse_multiple_skipped_lines = multiple lines skipped by escaped newline + .label = skipping everything up to and including this point + +parse_unknown_prefix = prefix `{$prefix}` is unknown + .label = unknown prefix + .note = prefixed identifiers and literals are reserved since Rust 2021 + .suggestion_br = use `br` for a raw byte string + .suggestion_whitespace = consider inserting whitespace here + +parse_too_many_hashes = too many `#` symbols: raw strings may be delimited by up to 255 `#` symbols, but found {$num} + +parse_unknown_start_of_token = unknown start of token: {$escaped} + .sugg_quotes = Unicode characters '“' (Left Double Quotation Mark) and '”' (Right Double Quotation Mark) look like '{$ascii_str}' ({$ascii_name}), but are not + .sugg_other = Unicode character '{$ch}' ({$u_name}) looks like '{$ascii_str}' ({$ascii_name}), but it is not + .help_null = source files must contain UTF-8 encoded text, unexpected null bytes might occur when a different encoding is used + .note_repeats = character appears {$repeats -> + [one] once more + *[other] {$repeats} more times + } diff --git a/compiler/rustc_parse/src/lib.rs b/compiler/rustc_parse/src/lib.rs index d1c3fd0cd0f..17466cd0e6d 100644 --- a/compiler/rustc_parse/src/lib.rs +++ b/compiler/rustc_parse/src/lib.rs @@ -36,7 +36,7 @@ pub mod validate_attr; mod errors; -fluent_messages! { "../locales/en-US.ftl" } +fluent_messages! { "../messages.ftl" } // A bunch of utility functions of the form `parse__from_` // where includes crate, expr, item, stmt, tts, and one that diff --git a/compiler/rustc_passes/locales/en-US.ftl b/compiler/rustc_passes/locales/en-US.ftl deleted file mode 100644 index 3fa78efc290..00000000000 --- a/compiler/rustc_passes/locales/en-US.ftl +++ /dev/null @@ -1,748 +0,0 @@ --passes_previously_accepted = - this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - --passes_see_issue = - see issue #{$issue} for more information - -passes_incorrect_do_not_recommend_location = - `#[do_not_recommend]` can only be placed on trait implementations - -passes_outer_crate_level_attr = - crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - -passes_inner_crate_level_attr = - crate-level attribute should be in the root module - -passes_ignored_attr_with_macro = - `#[{$sym}]` is ignored on struct fields, match arms and macro defs - .warn = {-passes_previously_accepted} - .note = {-passes_see_issue(issue: "80564")} - -passes_ignored_attr = - `#[{$sym}]` is ignored on struct fields and match arms - .warn = {-passes_previously_accepted} - .note = {-passes_see_issue(issue: "80564")} - -passes_inline_ignored_function_prototype = - `#[inline]` is ignored on function prototypes - -passes_inline_ignored_constants = - `#[inline]` is ignored on constants - .warn = {-passes_previously_accepted} - .note = {-passes_see_issue(issue: "65833")} - -passes_inline_not_fn_or_closure = - attribute should be applied to function or closure - .label = not a function or closure - -passes_no_coverage_ignored_function_prototype = - `#[no_coverage]` is ignored on function prototypes - -passes_no_coverage_propagate = - `#[no_coverage]` does not propagate into items and must be applied to the contained functions directly - -passes_no_coverage_fn_defn = - `#[no_coverage]` may only be applied to function definitions - -passes_no_coverage_not_coverable = - `#[no_coverage]` must be applied to coverable code - .label = not coverable code - -passes_should_be_applied_to_fn = - attribute should be applied to a function definition - .label = {$on_crate -> - [true] cannot be applied to crates - *[false] not a function definition - } - -passes_naked_tracked_caller = - cannot use `#[track_caller]` with `#[naked]` - -passes_should_be_applied_to_struct_enum = - attribute should be applied to a struct or enum - .label = not a struct or enum - -passes_should_be_applied_to_trait = - attribute should be applied to a trait - .label = not a trait - -passes_target_feature_on_statement = - {passes_should_be_applied_to_fn} - .warn = {-passes_previously_accepted} - .label = {passes_should_be_applied_to_fn.label} - -passes_should_be_applied_to_static = - attribute should be applied to a static - .label = not a static - -passes_doc_expect_str = - doc {$attr_name} attribute expects a string: #[doc({$attr_name} = "a")] - -passes_doc_alias_empty = - {$attr_str} attribute cannot have empty value - -passes_doc_alias_bad_char = - {$char_} character isn't allowed in {$attr_str} - -passes_doc_alias_start_end = - {$attr_str} cannot start or end with ' ' - -passes_doc_alias_bad_location = - {$attr_str} isn't allowed on {$location} - -passes_doc_alias_not_an_alias = - {$attr_str} is the same as the item's name - -passes_doc_alias_duplicated = doc alias is duplicated - .label = first defined here - -passes_doc_alias_not_string_literal = - `#[doc(alias("a"))]` expects string literals - -passes_doc_alias_malformed = - doc alias attribute expects a string `#[doc(alias = "a")]` or a list of strings `#[doc(alias("a", "b"))]` - -passes_doc_keyword_empty_mod = - `#[doc(keyword = "...")]` should be used on empty modules - -passes_doc_keyword_not_mod = - `#[doc(keyword = "...")]` should be used on modules - -passes_doc_keyword_invalid_ident = - `{$doc_keyword}` is not a valid identifier - -passes_doc_fake_variadic_not_valid = - `#[doc(fake_variadic)]` must be used on the first of a set of tuple or fn pointer trait impls with varying arity - -passes_doc_keyword_only_impl = - `#[doc(keyword = "...")]` should be used on impl blocks - -passes_doc_inline_conflict_first = - this attribute... - -passes_doc_inline_conflict_second = - {"."}..conflicts with this attribute - -passes_doc_inline_conflict = - conflicting doc inlining attributes - .help = remove one of the conflicting attributes - -passes_doc_inline_only_use = - this attribute can only be applied to a `use` item - .label = only applicable on `use` items - .not_a_use_item_label = not a `use` item - .note = read for more information - -passes_doc_attr_not_crate_level = - `#![doc({$attr_name} = "...")]` isn't allowed as a crate-level attribute - -passes_attr_crate_level = - this attribute can only be applied at the crate level - .suggestion = to apply to the crate, use an inner attribute - .help = to apply to the crate, use an inner attribute - .note = read for more information - -passes_doc_test_unknown = - unknown `doc(test)` attribute `{$path}` - -passes_doc_test_takes_list = - `#[doc(test(...)]` takes a list of attributes - -passes_doc_primitive = - `doc(primitive)` should never have been stable - -passes_doc_cfg_hide_takes_list = - `#[doc(cfg_hide(...)]` takes a list of attributes - -passes_doc_test_unknown_any = - unknown `doc` attribute `{$path}` - -passes_doc_test_unknown_spotlight = - unknown `doc` attribute `{$path}` - .note = `doc(spotlight)` was renamed to `doc(notable_trait)` - .suggestion = use `notable_trait` instead - .no_op_note = `doc(spotlight)` is now a no-op - -passes_doc_test_unknown_include = - unknown `doc` attribute `{$path}` - .suggestion = use `doc = include_str!` instead - -passes_doc_invalid = - invalid `doc` attribute - -passes_pass_by_value = - `pass_by_value` attribute should be applied to a struct, enum or type alias - .label = is not a struct, enum or type alias - -passes_allow_incoherent_impl = - `rustc_allow_incoherent_impl` attribute should be applied to impl items. - .label = the only currently supported targets are inherent methods - -passes_has_incoherent_inherent_impl = - `rustc_has_incoherent_inherent_impls` attribute should be applied to types or traits. - .label = only adts, extern types and traits are supported - -passes_both_ffi_const_and_pure = - `#[ffi_const]` function cannot be `#[ffi_pure]` - -passes_ffi_pure_invalid_target = - `#[ffi_pure]` may only be used on foreign functions - -passes_ffi_const_invalid_target = - `#[ffi_const]` may only be used on foreign functions - -passes_ffi_returns_twice_invalid_target = - `#[ffi_returns_twice]` may only be used on foreign functions - -passes_must_use_async = - `must_use` attribute on `async` functions applies to the anonymous `Future` returned by the function, not the value within - .label = this attribute does nothing, the `Future`s returned by async functions are already `must_use` - -passes_must_use_no_effect = - `#[must_use]` has no effect when applied to {$article} {$target} - -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 - -passes_cold = - {passes_should_be_applied_to_fn} - .warn = {-passes_previously_accepted} - .label = {passes_should_be_applied_to_fn.label} - -passes_link = - attribute should be applied to an `extern` block with non-Rust ABI - .warn = {-passes_previously_accepted} - .label = not an `extern` block - -passes_link_name = - attribute should be applied to a foreign function or static - .warn = {-passes_previously_accepted} - .label = not a foreign function or static - .help = try `#[link(name = "{$value}")]` instead - -passes_no_link = - attribute should be applied to an `extern crate` item - .label = not an `extern crate` item - -passes_export_name = - attribute should be applied to a free function, impl method or static - .label = not a free function, impl method or static - -passes_rustc_layout_scalar_valid_range_not_struct = - attribute should be applied to a struct - .label = not a struct - -passes_rustc_layout_scalar_valid_range_arg = - expected exactly one integer literal argument - -passes_rustc_legacy_const_generics_only = - #[rustc_legacy_const_generics] functions must only have const generics - .label = non-const generic parameter - -passes_rustc_legacy_const_generics_index = - #[rustc_legacy_const_generics] must have one index for each generic parameter - .label = generic parameters - -passes_rustc_legacy_const_generics_index_exceed = - index exceeds number of arguments - .label = there {$arg_count -> - [one] is - *[other] are - } only {$arg_count} {$arg_count -> - [one] argument - *[other] arguments - } - -passes_rustc_legacy_const_generics_index_negative = - arguments should be non-negative integers - -passes_rustc_dirty_clean = - attribute requires -Z query-dep-graph to be enabled - -passes_link_section = - attribute should be applied to a function or static - .warn = {-passes_previously_accepted} - .label = not a function or static - -passes_no_mangle_foreign = - `#[no_mangle]` has no effect on a foreign {$foreign_item_kind} - .warn = {-passes_previously_accepted} - .label = foreign {$foreign_item_kind} - .note = symbol names in extern blocks are not mangled - .suggestion = remove this attribute - -passes_no_mangle = - attribute should be applied to a free function, impl method or static - .warn = {-passes_previously_accepted} - .label = not a free function, impl method or static - -passes_repr_ident = - meta item in `repr` must be an identifier - -passes_repr_conflicting = - conflicting representation hints - -passes_used_static = - attribute must be applied to a `static` variable - -passes_used_compiler_linker = - `used(compiler)` and `used(linker)` can't be used together - -passes_allow_internal_unstable = - attribute should be applied to a macro - .label = not a macro - -passes_debug_visualizer_placement = - attribute should be applied to a module - -passes_debug_visualizer_invalid = - invalid argument - .note_1 = expected: `natvis_file = "..."` - .note_2 = OR - .note_3 = expected: `gdb_script_file = "..."` - -passes_debug_visualizer_unreadable = - couldn't read {$file}: {$error} - -passes_rustc_allow_const_fn_unstable = - attribute should be applied to `const fn` - .label = not a `const fn` - -passes_rustc_std_internal_symbol = - attribute should be applied to functions or statics - .label = not a function or static - -passes_const_trait = - attribute should be applied to a trait - -passes_stability_promotable = - attribute cannot be applied to an expression - -passes_deprecated = - attribute is ignored here - -passes_macro_use = - `#[{$name}]` only has an effect on `extern crate` and modules - -passes_macro_export = - `#[macro_export]` only has an effect on macro definitions - -passes_plugin_registrar = - `#[plugin_registrar]` only has an effect on functions - -passes_unused_empty_lints_note = - attribute `{$name}` with an empty list has no effect - -passes_unused_no_lints_note = - attribute `{$name}` without any lints has no effect - -passes_unused_default_method_body_const_note = - `default_method_body_is_const` has been replaced with `#[const_trait]` on traits - -passes_unused = - unused attribute - .suggestion = remove this attribute - -passes_non_exported_macro_invalid_attrs = - attribute should be applied to function or closure - .label = not a function or closure - -passes_unused_duplicate = - unused attribute - .suggestion = remove this attribute - .note = attribute also specified here - .warn = {-passes_previously_accepted} - -passes_unused_multiple = - multiple `{$name}` attributes - .suggestion = remove this attribute - .note = attribute also specified here - -passes_rustc_lint_opt_ty = - `#[rustc_lint_opt_ty]` should be applied to a struct - .label = not a struct - -passes_rustc_lint_opt_deny_field_access = - `#[rustc_lint_opt_deny_field_access]` should be applied to a field - .label = not a field - -passes_link_ordinal = - attribute should be applied to a foreign function or static - .label = not a foreign function or static - -passes_collapse_debuginfo = - `collapse_debuginfo` attribute should be applied to macro definitions - .label = not a macro definition - -passes_deprecated_annotation_has_no_effect = - this `#[deprecated]` annotation has no effect - .suggestion = remove the unnecessary deprecation attribute - -passes_unknown_external_lang_item = - unknown external lang item: `{$lang_item}` - -passes_missing_panic_handler = - `#[panic_handler]` function required, but not found - -passes_missing_lang_item = - language item required, but not found: `{$name}` - .note = this can occur when a binary crate with `#![no_std]` is compiled for a target where `{$name}` is defined in the standard library - .help = you may be able to compile for a target that doesn't need `{$name}`, specify a target with `--target` or in `.cargo/config` - -passes_lang_item_on_incorrect_target = - `{$name}` language item must be applied to a {$expected_target} - .label = attribute should be applied to a {$expected_target}, not a {$actual_target} - -passes_unknown_lang_item = - definition of an unknown language item: `{$name}` - .label = definition of unknown language item `{$name}` - -passes_invalid_attr_at_crate_level = - `{$name}` attribute cannot be used at crate level - .suggestion = perhaps you meant to use an outer attribute - -passes_duplicate_diagnostic_item_in_crate = - duplicate diagnostic item in crate `{$crate_name}`: `{$name}`. - .note = the diagnostic item is first defined in crate `{$orig_crate_name}`. - -passes_diagnostic_item_first_defined = - the diagnostic item is first defined here - -passes_abi = - abi: {$abi} - -passes_align = - align: {$align} - -passes_size = - size: {$size} - -passes_homogeneous_aggregate = - homogeneous_aggregate: {$homogeneous_aggregate} - -passes_layout_of = - layout_of({$normalized_ty}) = {$ty_layout} - -passes_unrecognized_field = - unrecognized field name `{$name}` - -passes_layout = - layout error: {$layout_error} - -passes_feature_stable_twice = - feature `{$feature}` is declared stable since {$since}, but was previously declared stable since {$prev_since} - -passes_feature_previously_declared = - feature `{$feature}` is declared {$declared}, but was previously declared {$prev_declared} - -passes_expr_not_allowed_in_context = - {$expr} is not allowed in a `{$context}` - -passes_const_impl_const_trait = - const `impl`s must be for traits marked with `#[const_trait]` - .note = this trait must be annotated with `#[const_trait]` - -passes_break_non_loop = - `break` with value from a `{$kind}` loop - .label = can only break with a value inside `loop` or breakable block - .label2 = you can't `break` with a value in a `{$kind}` loop - .suggestion = use `break` on its own without a value inside this `{$kind}` loop - .break_expr_suggestion = alternatively, you might have meant to use the available loop label - -passes_continue_labeled_block = - `continue` pointing to a labeled block - .label = labeled blocks cannot be `continue`'d - .block_label = labeled block the `continue` points to - -passes_break_inside_closure = - `{$name}` inside of a closure - .label = cannot `{$name}` inside of a closure - .closure_label = enclosing closure - -passes_break_inside_async_block = - `{$name}` inside of an `async` block - .label = cannot `{$name}` inside of an `async` block - .async_block_label = enclosing `async` block - -passes_outside_loop = - `{$name}` outside of a loop{$is_break -> - [true] {" or labeled block"} - *[false] {""} - } - .label = cannot `{$name}` outside of a loop{$is_break -> - [true] {" or labeled block"} - *[false] {""} - } - -passes_unlabeled_in_labeled_block = - unlabeled `{$cf_type}` inside of a labeled block - .label = `{$cf_type}` statements that would diverge to or through a labeled block need to bear a label - -passes_unlabeled_cf_in_while_condition = - `break` or `continue` with no label in the condition of a `while` loop - .label = unlabeled `{$cf_type}` in the condition of a `while` loop - -passes_cannot_inline_naked_function = - naked functions cannot be inlined - -passes_undefined_naked_function_abi = - Rust ABI is unsupported in naked functions - -passes_no_patterns = - patterns not allowed in naked function parameters - -passes_params_not_allowed = - referencing function parameters is not allowed in naked functions - .help = follow the calling convention in asm block to use parameters - -passes_naked_functions_asm_block = - naked functions must contain a single asm block - .label_multiple_asm = multiple asm blocks are unsupported in naked functions - .label_non_asm = non-asm is unsupported in naked functions - -passes_naked_functions_operands = - only `const` and `sym` operands are supported in naked functions - -passes_naked_functions_asm_options = - asm options unsupported in naked functions: {$unsupported_options} - -passes_naked_functions_must_use_noreturn = - asm in naked functions must use `noreturn` option - .suggestion = consider specifying that the asm block is responsible for returning from the function - -passes_attr_only_on_main = - `{$attr}` attribute can only be used on `fn main()` - -passes_attr_only_on_root_main = - `{$attr}` attribute can only be used on root `fn main()` - -passes_attr_only_in_functions = - `{$attr}` attribute can only be used on functions - -passes_multiple_rustc_main = - multiple functions with a `#[rustc_main]` attribute - .first = first `#[rustc_main]` function - .additional = additional `#[rustc_main]` function - -passes_multiple_start_functions = - multiple `start` functions - .label = multiple `start` functions - .previous = previous `#[start]` function here - -passes_extern_main = - the `main` function cannot be declared in an `extern` block - -passes_unix_sigpipe_values = - valid values for `#[unix_sigpipe = "..."]` are `inherit`, `sig_ign`, or `sig_dfl` - -passes_no_main_function = - `main` function not found in crate `{$crate_name}` - .here_is_main = here is a function named `main` - .one_or_more_possible_main = you have one or more functions named `main` not defined at the crate level - .consider_moving_main = consider moving the `main` function definitions - .main_must_be_defined_at_crate = the main function must be defined at the crate level{$has_filename -> - [true] {" "}(in `{$filename}`) - *[false] {""} - } - .consider_adding_main_to_file = consider adding a `main` function to `{$filename}` - .consider_adding_main_at_crate = consider adding a `main` function at the crate level - .teach_note = If you don't know the basics of Rust, you can go look to the Rust Book to get started: https://doc.rust-lang.org/book/ - .non_function_main = non-function item at `crate::main` is found - -passes_duplicate_lang_item = - found duplicate lang item `{$lang_item_name}` - .first_defined_span = the lang item is first defined here - .first_defined_crate_depends = the lang item is first defined in crate `{$orig_crate_name}` (which `{$orig_dependency_of}` depends on) - .first_defined_crate = the lang item is first defined in crate `{$orig_crate_name}`. - .first_definition_local = first definition in the local crate (`{$orig_crate_name}`) - .second_definition_local = second definition in the local crate (`{$crate_name}`) - .first_definition_path = first definition in `{$orig_crate_name}` loaded from {$orig_path} - .second_definition_path = second definition in `{$crate_name}` loaded from {$path} - -passes_duplicate_lang_item_crate = - duplicate lang item in crate `{$crate_name}`: `{$lang_item_name}`. - .first_defined_span = the lang item is first defined here - .first_defined_crate_depends = the lang item is first defined in crate `{$orig_crate_name}` (which `{$orig_dependency_of}` depends on) - .first_defined_crate = the lang item is first defined in crate `{$orig_crate_name}`. - .first_definition_local = first definition in the local crate (`{$orig_crate_name}`) - .second_definition_local = second definition in the local crate (`{$crate_name}`) - .first_definition_path = first definition in `{$orig_crate_name}` loaded from {$orig_path} - .second_definition_path = second definition in `{$crate_name}` loaded from {$path} - -passes_duplicate_lang_item_crate_depends = - duplicate lang item in crate `{$crate_name}` (which `{$dependency_of}` depends on): `{$lang_item_name}`. - .first_defined_span = the lang item is first defined here - .first_defined_crate_depends = the lang item is first defined in crate `{$orig_crate_name}` (which `{$orig_dependency_of}` depends on) - .first_defined_crate = the lang item is first defined in crate `{$orig_crate_name}`. - .first_definition_local = first definition in the local crate (`{$orig_crate_name}`) - .second_definition_local = second definition in the local crate (`{$crate_name}`) - .first_definition_path = first definition in `{$orig_crate_name}` loaded from {$orig_path} - .second_definition_path = second definition in `{$crate_name}` loaded from {$path} - -passes_incorrect_target = - `{$name}` language item must be applied to a {$kind} with {$at_least -> - [true] at least {$num} - *[false] {$num} - } generic {$num -> - [one] argument - *[other] arguments - } - .label = this {$kind} has {$actual_num} generic {$actual_num -> - [one] argument - *[other] arguments - } - -passes_useless_assignment = - useless assignment of {$is_field_assign -> - [true] field - *[false] variable - } of type `{$ty}` to itself - -passes_only_has_effect_on = - `#[{$attr_name}]` only has an effect on {$target_name -> - [function] functions - [module] modules - [implementation_block] implementation blocks - *[unspecified] (unspecified--this is a compiler bug) - } - -passes_object_lifetime_err = - {$repr} - -passes_unrecognized_repr_hint = - unrecognized representation hint - .help = valid reprs are `C`, `align`, `packed`, `transparent`, `simd`, `i8`, `u8`, `i16`, `u16`, `i32`, `u32`, `i64`, `u64`, `i128`, `u128`, `isize`, `usize` - -passes_attr_application_enum = - attribute should be applied to an enum - .label = not an enum - -passes_attr_application_struct = - attribute should be applied to a struct - .label = not a struct - -passes_attr_application_struct_union = - attribute should be applied to a struct or union - .label = not a struct or union - -passes_attr_application_struct_enum_union = - attribute should be applied to a struct, enum, or union - .label = not a struct, enum, or union - -passes_attr_application_struct_enum_function_union = - attribute should be applied to a struct, enum, function, or union - .label = not a struct, enum, function, or union - -passes_transparent_incompatible = - transparent {$target} cannot have other repr hints - -passes_deprecated_attribute = - deprecated attribute must be paired with either stable or unstable attribute - -passes_useless_stability = - this stability annotation is useless - .label = useless stability annotation - .item = the stability attribute annotates this item - -passes_invalid_stability = - invalid stability version found - .label = invalid stability version - .item = the stability attribute annotates this item - -passes_cannot_stabilize_deprecated = - an API can't be stabilized after it is deprecated - .label = invalid version - .item = the stability attribute annotates this item - -passes_invalid_deprecation_version = - invalid deprecation version found - .label = invalid deprecation version - .item = the stability attribute annotates this item - -passes_missing_stability_attr = - {$descr} has missing stability attribute - -passes_missing_const_stab_attr = - {$descr} has missing const stability attribute - -passes_trait_impl_const_stable = - trait implementations cannot be const stable yet - .note = see issue #67792 for more information - -passes_feature_only_on_nightly = - `#![feature]` may not be used on the {$release_channel} release channel - -passes_unknown_feature = - unknown feature `{$feature}` - -passes_implied_feature_not_exist = - feature `{$implied_by}` implying `{$feature}` does not exist - -passes_duplicate_feature_err = - the feature `{$feature}` has already been declared - -passes_missing_const_err = - attributes `#[rustc_const_unstable]` and `#[rustc_const_stable]` require the function or method to be `const` - .help = make the function or method const - .label = attribute specified here - -passes_dead_codes = - { $multiple -> - *[true] multiple {$descr}s are - [false] { $num -> - [one] {$descr} {$name_list} is - *[other] {$descr}s {$name_list} are - } - } never {$participle} - -passes_change_fields_to_be_of_unit_type = - consider changing the { $num -> - [one] field - *[other] fields - } to be of unit type to suppress this warning while preserving the field numbering, or remove the { $num -> - [one] field - *[other] fields - } - -passes_parent_info = - {$num -> - [one] {$descr} - *[other] {$descr}s - } in this {$parent_descr} - -passes_ignored_derived_impls = - `{$name}` has {$trait_list_len -> - [one] a derived impl - *[other] derived impls - } for the {$trait_list_len -> - [one] trait {$trait_list}, but this is - *[other] traits {$trait_list}, but these are - } intentionally ignored during dead code analysis - -passes_proc_macro_typeerror = mismatched {$kind} signature - .label = found {$found}, expected type `proc_macro::TokenStream` - .note = {$kind}s must have a signature of `{$expected_signature}` - -passes_proc_macro_diff_arg_count = mismatched {$kind} signature - .label = found unexpected {$count -> - [one] argument - *[other] arguments - } - .note = {$kind}s must have a signature of `{$expected_signature}` - -passes_proc_macro_missing_args = mismatched {$kind} signature - .label = {$kind} must have {$expected_input_count -> - [one] one argument - *[other] two arguments - } of type `proc_macro::TokenStream` - -passes_proc_macro_invalid_abi = proc macro functions may not be `extern "{$abi}"` - -passes_proc_macro_unsafe = proc macro functions may not be `unsafe` - -passes_skipping_const_checks = skipping const checks - -passes_invalid_macro_export_arguments = `{$name}` isn't a valid `#[macro_export]` argument - -passes_invalid_macro_export_arguments_too_many_items = `#[macro_export]` can only take 1 or 0 arguments diff --git a/compiler/rustc_passes/messages.ftl b/compiler/rustc_passes/messages.ftl new file mode 100644 index 00000000000..3fa78efc290 --- /dev/null +++ b/compiler/rustc_passes/messages.ftl @@ -0,0 +1,748 @@ +-passes_previously_accepted = + this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + +-passes_see_issue = + see issue #{$issue} for more information + +passes_incorrect_do_not_recommend_location = + `#[do_not_recommend]` can only be placed on trait implementations + +passes_outer_crate_level_attr = + crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` + +passes_inner_crate_level_attr = + crate-level attribute should be in the root module + +passes_ignored_attr_with_macro = + `#[{$sym}]` is ignored on struct fields, match arms and macro defs + .warn = {-passes_previously_accepted} + .note = {-passes_see_issue(issue: "80564")} + +passes_ignored_attr = + `#[{$sym}]` is ignored on struct fields and match arms + .warn = {-passes_previously_accepted} + .note = {-passes_see_issue(issue: "80564")} + +passes_inline_ignored_function_prototype = + `#[inline]` is ignored on function prototypes + +passes_inline_ignored_constants = + `#[inline]` is ignored on constants + .warn = {-passes_previously_accepted} + .note = {-passes_see_issue(issue: "65833")} + +passes_inline_not_fn_or_closure = + attribute should be applied to function or closure + .label = not a function or closure + +passes_no_coverage_ignored_function_prototype = + `#[no_coverage]` is ignored on function prototypes + +passes_no_coverage_propagate = + `#[no_coverage]` does not propagate into items and must be applied to the contained functions directly + +passes_no_coverage_fn_defn = + `#[no_coverage]` may only be applied to function definitions + +passes_no_coverage_not_coverable = + `#[no_coverage]` must be applied to coverable code + .label = not coverable code + +passes_should_be_applied_to_fn = + attribute should be applied to a function definition + .label = {$on_crate -> + [true] cannot be applied to crates + *[false] not a function definition + } + +passes_naked_tracked_caller = + cannot use `#[track_caller]` with `#[naked]` + +passes_should_be_applied_to_struct_enum = + attribute should be applied to a struct or enum + .label = not a struct or enum + +passes_should_be_applied_to_trait = + attribute should be applied to a trait + .label = not a trait + +passes_target_feature_on_statement = + {passes_should_be_applied_to_fn} + .warn = {-passes_previously_accepted} + .label = {passes_should_be_applied_to_fn.label} + +passes_should_be_applied_to_static = + attribute should be applied to a static + .label = not a static + +passes_doc_expect_str = + doc {$attr_name} attribute expects a string: #[doc({$attr_name} = "a")] + +passes_doc_alias_empty = + {$attr_str} attribute cannot have empty value + +passes_doc_alias_bad_char = + {$char_} character isn't allowed in {$attr_str} + +passes_doc_alias_start_end = + {$attr_str} cannot start or end with ' ' + +passes_doc_alias_bad_location = + {$attr_str} isn't allowed on {$location} + +passes_doc_alias_not_an_alias = + {$attr_str} is the same as the item's name + +passes_doc_alias_duplicated = doc alias is duplicated + .label = first defined here + +passes_doc_alias_not_string_literal = + `#[doc(alias("a"))]` expects string literals + +passes_doc_alias_malformed = + doc alias attribute expects a string `#[doc(alias = "a")]` or a list of strings `#[doc(alias("a", "b"))]` + +passes_doc_keyword_empty_mod = + `#[doc(keyword = "...")]` should be used on empty modules + +passes_doc_keyword_not_mod = + `#[doc(keyword = "...")]` should be used on modules + +passes_doc_keyword_invalid_ident = + `{$doc_keyword}` is not a valid identifier + +passes_doc_fake_variadic_not_valid = + `#[doc(fake_variadic)]` must be used on the first of a set of tuple or fn pointer trait impls with varying arity + +passes_doc_keyword_only_impl = + `#[doc(keyword = "...")]` should be used on impl blocks + +passes_doc_inline_conflict_first = + this attribute... + +passes_doc_inline_conflict_second = + {"."}..conflicts with this attribute + +passes_doc_inline_conflict = + conflicting doc inlining attributes + .help = remove one of the conflicting attributes + +passes_doc_inline_only_use = + this attribute can only be applied to a `use` item + .label = only applicable on `use` items + .not_a_use_item_label = not a `use` item + .note = read for more information + +passes_doc_attr_not_crate_level = + `#![doc({$attr_name} = "...")]` isn't allowed as a crate-level attribute + +passes_attr_crate_level = + this attribute can only be applied at the crate level + .suggestion = to apply to the crate, use an inner attribute + .help = to apply to the crate, use an inner attribute + .note = read for more information + +passes_doc_test_unknown = + unknown `doc(test)` attribute `{$path}` + +passes_doc_test_takes_list = + `#[doc(test(...)]` takes a list of attributes + +passes_doc_primitive = + `doc(primitive)` should never have been stable + +passes_doc_cfg_hide_takes_list = + `#[doc(cfg_hide(...)]` takes a list of attributes + +passes_doc_test_unknown_any = + unknown `doc` attribute `{$path}` + +passes_doc_test_unknown_spotlight = + unknown `doc` attribute `{$path}` + .note = `doc(spotlight)` was renamed to `doc(notable_trait)` + .suggestion = use `notable_trait` instead + .no_op_note = `doc(spotlight)` is now a no-op + +passes_doc_test_unknown_include = + unknown `doc` attribute `{$path}` + .suggestion = use `doc = include_str!` instead + +passes_doc_invalid = + invalid `doc` attribute + +passes_pass_by_value = + `pass_by_value` attribute should be applied to a struct, enum or type alias + .label = is not a struct, enum or type alias + +passes_allow_incoherent_impl = + `rustc_allow_incoherent_impl` attribute should be applied to impl items. + .label = the only currently supported targets are inherent methods + +passes_has_incoherent_inherent_impl = + `rustc_has_incoherent_inherent_impls` attribute should be applied to types or traits. + .label = only adts, extern types and traits are supported + +passes_both_ffi_const_and_pure = + `#[ffi_const]` function cannot be `#[ffi_pure]` + +passes_ffi_pure_invalid_target = + `#[ffi_pure]` may only be used on foreign functions + +passes_ffi_const_invalid_target = + `#[ffi_const]` may only be used on foreign functions + +passes_ffi_returns_twice_invalid_target = + `#[ffi_returns_twice]` may only be used on foreign functions + +passes_must_use_async = + `must_use` attribute on `async` functions applies to the anonymous `Future` returned by the function, not the value within + .label = this attribute does nothing, the `Future`s returned by async functions are already `must_use` + +passes_must_use_no_effect = + `#[must_use]` has no effect when applied to {$article} {$target} + +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 + +passes_cold = + {passes_should_be_applied_to_fn} + .warn = {-passes_previously_accepted} + .label = {passes_should_be_applied_to_fn.label} + +passes_link = + attribute should be applied to an `extern` block with non-Rust ABI + .warn = {-passes_previously_accepted} + .label = not an `extern` block + +passes_link_name = + attribute should be applied to a foreign function or static + .warn = {-passes_previously_accepted} + .label = not a foreign function or static + .help = try `#[link(name = "{$value}")]` instead + +passes_no_link = + attribute should be applied to an `extern crate` item + .label = not an `extern crate` item + +passes_export_name = + attribute should be applied to a free function, impl method or static + .label = not a free function, impl method or static + +passes_rustc_layout_scalar_valid_range_not_struct = + attribute should be applied to a struct + .label = not a struct + +passes_rustc_layout_scalar_valid_range_arg = + expected exactly one integer literal argument + +passes_rustc_legacy_const_generics_only = + #[rustc_legacy_const_generics] functions must only have const generics + .label = non-const generic parameter + +passes_rustc_legacy_const_generics_index = + #[rustc_legacy_const_generics] must have one index for each generic parameter + .label = generic parameters + +passes_rustc_legacy_const_generics_index_exceed = + index exceeds number of arguments + .label = there {$arg_count -> + [one] is + *[other] are + } only {$arg_count} {$arg_count -> + [one] argument + *[other] arguments + } + +passes_rustc_legacy_const_generics_index_negative = + arguments should be non-negative integers + +passes_rustc_dirty_clean = + attribute requires -Z query-dep-graph to be enabled + +passes_link_section = + attribute should be applied to a function or static + .warn = {-passes_previously_accepted} + .label = not a function or static + +passes_no_mangle_foreign = + `#[no_mangle]` has no effect on a foreign {$foreign_item_kind} + .warn = {-passes_previously_accepted} + .label = foreign {$foreign_item_kind} + .note = symbol names in extern blocks are not mangled + .suggestion = remove this attribute + +passes_no_mangle = + attribute should be applied to a free function, impl method or static + .warn = {-passes_previously_accepted} + .label = not a free function, impl method or static + +passes_repr_ident = + meta item in `repr` must be an identifier + +passes_repr_conflicting = + conflicting representation hints + +passes_used_static = + attribute must be applied to a `static` variable + +passes_used_compiler_linker = + `used(compiler)` and `used(linker)` can't be used together + +passes_allow_internal_unstable = + attribute should be applied to a macro + .label = not a macro + +passes_debug_visualizer_placement = + attribute should be applied to a module + +passes_debug_visualizer_invalid = + invalid argument + .note_1 = expected: `natvis_file = "..."` + .note_2 = OR + .note_3 = expected: `gdb_script_file = "..."` + +passes_debug_visualizer_unreadable = + couldn't read {$file}: {$error} + +passes_rustc_allow_const_fn_unstable = + attribute should be applied to `const fn` + .label = not a `const fn` + +passes_rustc_std_internal_symbol = + attribute should be applied to functions or statics + .label = not a function or static + +passes_const_trait = + attribute should be applied to a trait + +passes_stability_promotable = + attribute cannot be applied to an expression + +passes_deprecated = + attribute is ignored here + +passes_macro_use = + `#[{$name}]` only has an effect on `extern crate` and modules + +passes_macro_export = + `#[macro_export]` only has an effect on macro definitions + +passes_plugin_registrar = + `#[plugin_registrar]` only has an effect on functions + +passes_unused_empty_lints_note = + attribute `{$name}` with an empty list has no effect + +passes_unused_no_lints_note = + attribute `{$name}` without any lints has no effect + +passes_unused_default_method_body_const_note = + `default_method_body_is_const` has been replaced with `#[const_trait]` on traits + +passes_unused = + unused attribute + .suggestion = remove this attribute + +passes_non_exported_macro_invalid_attrs = + attribute should be applied to function or closure + .label = not a function or closure + +passes_unused_duplicate = + unused attribute + .suggestion = remove this attribute + .note = attribute also specified here + .warn = {-passes_previously_accepted} + +passes_unused_multiple = + multiple `{$name}` attributes + .suggestion = remove this attribute + .note = attribute also specified here + +passes_rustc_lint_opt_ty = + `#[rustc_lint_opt_ty]` should be applied to a struct + .label = not a struct + +passes_rustc_lint_opt_deny_field_access = + `#[rustc_lint_opt_deny_field_access]` should be applied to a field + .label = not a field + +passes_link_ordinal = + attribute should be applied to a foreign function or static + .label = not a foreign function or static + +passes_collapse_debuginfo = + `collapse_debuginfo` attribute should be applied to macro definitions + .label = not a macro definition + +passes_deprecated_annotation_has_no_effect = + this `#[deprecated]` annotation has no effect + .suggestion = remove the unnecessary deprecation attribute + +passes_unknown_external_lang_item = + unknown external lang item: `{$lang_item}` + +passes_missing_panic_handler = + `#[panic_handler]` function required, but not found + +passes_missing_lang_item = + language item required, but not found: `{$name}` + .note = this can occur when a binary crate with `#![no_std]` is compiled for a target where `{$name}` is defined in the standard library + .help = you may be able to compile for a target that doesn't need `{$name}`, specify a target with `--target` or in `.cargo/config` + +passes_lang_item_on_incorrect_target = + `{$name}` language item must be applied to a {$expected_target} + .label = attribute should be applied to a {$expected_target}, not a {$actual_target} + +passes_unknown_lang_item = + definition of an unknown language item: `{$name}` + .label = definition of unknown language item `{$name}` + +passes_invalid_attr_at_crate_level = + `{$name}` attribute cannot be used at crate level + .suggestion = perhaps you meant to use an outer attribute + +passes_duplicate_diagnostic_item_in_crate = + duplicate diagnostic item in crate `{$crate_name}`: `{$name}`. + .note = the diagnostic item is first defined in crate `{$orig_crate_name}`. + +passes_diagnostic_item_first_defined = + the diagnostic item is first defined here + +passes_abi = + abi: {$abi} + +passes_align = + align: {$align} + +passes_size = + size: {$size} + +passes_homogeneous_aggregate = + homogeneous_aggregate: {$homogeneous_aggregate} + +passes_layout_of = + layout_of({$normalized_ty}) = {$ty_layout} + +passes_unrecognized_field = + unrecognized field name `{$name}` + +passes_layout = + layout error: {$layout_error} + +passes_feature_stable_twice = + feature `{$feature}` is declared stable since {$since}, but was previously declared stable since {$prev_since} + +passes_feature_previously_declared = + feature `{$feature}` is declared {$declared}, but was previously declared {$prev_declared} + +passes_expr_not_allowed_in_context = + {$expr} is not allowed in a `{$context}` + +passes_const_impl_const_trait = + const `impl`s must be for traits marked with `#[const_trait]` + .note = this trait must be annotated with `#[const_trait]` + +passes_break_non_loop = + `break` with value from a `{$kind}` loop + .label = can only break with a value inside `loop` or breakable block + .label2 = you can't `break` with a value in a `{$kind}` loop + .suggestion = use `break` on its own without a value inside this `{$kind}` loop + .break_expr_suggestion = alternatively, you might have meant to use the available loop label + +passes_continue_labeled_block = + `continue` pointing to a labeled block + .label = labeled blocks cannot be `continue`'d + .block_label = labeled block the `continue` points to + +passes_break_inside_closure = + `{$name}` inside of a closure + .label = cannot `{$name}` inside of a closure + .closure_label = enclosing closure + +passes_break_inside_async_block = + `{$name}` inside of an `async` block + .label = cannot `{$name}` inside of an `async` block + .async_block_label = enclosing `async` block + +passes_outside_loop = + `{$name}` outside of a loop{$is_break -> + [true] {" or labeled block"} + *[false] {""} + } + .label = cannot `{$name}` outside of a loop{$is_break -> + [true] {" or labeled block"} + *[false] {""} + } + +passes_unlabeled_in_labeled_block = + unlabeled `{$cf_type}` inside of a labeled block + .label = `{$cf_type}` statements that would diverge to or through a labeled block need to bear a label + +passes_unlabeled_cf_in_while_condition = + `break` or `continue` with no label in the condition of a `while` loop + .label = unlabeled `{$cf_type}` in the condition of a `while` loop + +passes_cannot_inline_naked_function = + naked functions cannot be inlined + +passes_undefined_naked_function_abi = + Rust ABI is unsupported in naked functions + +passes_no_patterns = + patterns not allowed in naked function parameters + +passes_params_not_allowed = + referencing function parameters is not allowed in naked functions + .help = follow the calling convention in asm block to use parameters + +passes_naked_functions_asm_block = + naked functions must contain a single asm block + .label_multiple_asm = multiple asm blocks are unsupported in naked functions + .label_non_asm = non-asm is unsupported in naked functions + +passes_naked_functions_operands = + only `const` and `sym` operands are supported in naked functions + +passes_naked_functions_asm_options = + asm options unsupported in naked functions: {$unsupported_options} + +passes_naked_functions_must_use_noreturn = + asm in naked functions must use `noreturn` option + .suggestion = consider specifying that the asm block is responsible for returning from the function + +passes_attr_only_on_main = + `{$attr}` attribute can only be used on `fn main()` + +passes_attr_only_on_root_main = + `{$attr}` attribute can only be used on root `fn main()` + +passes_attr_only_in_functions = + `{$attr}` attribute can only be used on functions + +passes_multiple_rustc_main = + multiple functions with a `#[rustc_main]` attribute + .first = first `#[rustc_main]` function + .additional = additional `#[rustc_main]` function + +passes_multiple_start_functions = + multiple `start` functions + .label = multiple `start` functions + .previous = previous `#[start]` function here + +passes_extern_main = + the `main` function cannot be declared in an `extern` block + +passes_unix_sigpipe_values = + valid values for `#[unix_sigpipe = "..."]` are `inherit`, `sig_ign`, or `sig_dfl` + +passes_no_main_function = + `main` function not found in crate `{$crate_name}` + .here_is_main = here is a function named `main` + .one_or_more_possible_main = you have one or more functions named `main` not defined at the crate level + .consider_moving_main = consider moving the `main` function definitions + .main_must_be_defined_at_crate = the main function must be defined at the crate level{$has_filename -> + [true] {" "}(in `{$filename}`) + *[false] {""} + } + .consider_adding_main_to_file = consider adding a `main` function to `{$filename}` + .consider_adding_main_at_crate = consider adding a `main` function at the crate level + .teach_note = If you don't know the basics of Rust, you can go look to the Rust Book to get started: https://doc.rust-lang.org/book/ + .non_function_main = non-function item at `crate::main` is found + +passes_duplicate_lang_item = + found duplicate lang item `{$lang_item_name}` + .first_defined_span = the lang item is first defined here + .first_defined_crate_depends = the lang item is first defined in crate `{$orig_crate_name}` (which `{$orig_dependency_of}` depends on) + .first_defined_crate = the lang item is first defined in crate `{$orig_crate_name}`. + .first_definition_local = first definition in the local crate (`{$orig_crate_name}`) + .second_definition_local = second definition in the local crate (`{$crate_name}`) + .first_definition_path = first definition in `{$orig_crate_name}` loaded from {$orig_path} + .second_definition_path = second definition in `{$crate_name}` loaded from {$path} + +passes_duplicate_lang_item_crate = + duplicate lang item in crate `{$crate_name}`: `{$lang_item_name}`. + .first_defined_span = the lang item is first defined here + .first_defined_crate_depends = the lang item is first defined in crate `{$orig_crate_name}` (which `{$orig_dependency_of}` depends on) + .first_defined_crate = the lang item is first defined in crate `{$orig_crate_name}`. + .first_definition_local = first definition in the local crate (`{$orig_crate_name}`) + .second_definition_local = second definition in the local crate (`{$crate_name}`) + .first_definition_path = first definition in `{$orig_crate_name}` loaded from {$orig_path} + .second_definition_path = second definition in `{$crate_name}` loaded from {$path} + +passes_duplicate_lang_item_crate_depends = + duplicate lang item in crate `{$crate_name}` (which `{$dependency_of}` depends on): `{$lang_item_name}`. + .first_defined_span = the lang item is first defined here + .first_defined_crate_depends = the lang item is first defined in crate `{$orig_crate_name}` (which `{$orig_dependency_of}` depends on) + .first_defined_crate = the lang item is first defined in crate `{$orig_crate_name}`. + .first_definition_local = first definition in the local crate (`{$orig_crate_name}`) + .second_definition_local = second definition in the local crate (`{$crate_name}`) + .first_definition_path = first definition in `{$orig_crate_name}` loaded from {$orig_path} + .second_definition_path = second definition in `{$crate_name}` loaded from {$path} + +passes_incorrect_target = + `{$name}` language item must be applied to a {$kind} with {$at_least -> + [true] at least {$num} + *[false] {$num} + } generic {$num -> + [one] argument + *[other] arguments + } + .label = this {$kind} has {$actual_num} generic {$actual_num -> + [one] argument + *[other] arguments + } + +passes_useless_assignment = + useless assignment of {$is_field_assign -> + [true] field + *[false] variable + } of type `{$ty}` to itself + +passes_only_has_effect_on = + `#[{$attr_name}]` only has an effect on {$target_name -> + [function] functions + [module] modules + [implementation_block] implementation blocks + *[unspecified] (unspecified--this is a compiler bug) + } + +passes_object_lifetime_err = + {$repr} + +passes_unrecognized_repr_hint = + unrecognized representation hint + .help = valid reprs are `C`, `align`, `packed`, `transparent`, `simd`, `i8`, `u8`, `i16`, `u16`, `i32`, `u32`, `i64`, `u64`, `i128`, `u128`, `isize`, `usize` + +passes_attr_application_enum = + attribute should be applied to an enum + .label = not an enum + +passes_attr_application_struct = + attribute should be applied to a struct + .label = not a struct + +passes_attr_application_struct_union = + attribute should be applied to a struct or union + .label = not a struct or union + +passes_attr_application_struct_enum_union = + attribute should be applied to a struct, enum, or union + .label = not a struct, enum, or union + +passes_attr_application_struct_enum_function_union = + attribute should be applied to a struct, enum, function, or union + .label = not a struct, enum, function, or union + +passes_transparent_incompatible = + transparent {$target} cannot have other repr hints + +passes_deprecated_attribute = + deprecated attribute must be paired with either stable or unstable attribute + +passes_useless_stability = + this stability annotation is useless + .label = useless stability annotation + .item = the stability attribute annotates this item + +passes_invalid_stability = + invalid stability version found + .label = invalid stability version + .item = the stability attribute annotates this item + +passes_cannot_stabilize_deprecated = + an API can't be stabilized after it is deprecated + .label = invalid version + .item = the stability attribute annotates this item + +passes_invalid_deprecation_version = + invalid deprecation version found + .label = invalid deprecation version + .item = the stability attribute annotates this item + +passes_missing_stability_attr = + {$descr} has missing stability attribute + +passes_missing_const_stab_attr = + {$descr} has missing const stability attribute + +passes_trait_impl_const_stable = + trait implementations cannot be const stable yet + .note = see issue #67792 for more information + +passes_feature_only_on_nightly = + `#![feature]` may not be used on the {$release_channel} release channel + +passes_unknown_feature = + unknown feature `{$feature}` + +passes_implied_feature_not_exist = + feature `{$implied_by}` implying `{$feature}` does not exist + +passes_duplicate_feature_err = + the feature `{$feature}` has already been declared + +passes_missing_const_err = + attributes `#[rustc_const_unstable]` and `#[rustc_const_stable]` require the function or method to be `const` + .help = make the function or method const + .label = attribute specified here + +passes_dead_codes = + { $multiple -> + *[true] multiple {$descr}s are + [false] { $num -> + [one] {$descr} {$name_list} is + *[other] {$descr}s {$name_list} are + } + } never {$participle} + +passes_change_fields_to_be_of_unit_type = + consider changing the { $num -> + [one] field + *[other] fields + } to be of unit type to suppress this warning while preserving the field numbering, or remove the { $num -> + [one] field + *[other] fields + } + +passes_parent_info = + {$num -> + [one] {$descr} + *[other] {$descr}s + } in this {$parent_descr} + +passes_ignored_derived_impls = + `{$name}` has {$trait_list_len -> + [one] a derived impl + *[other] derived impls + } for the {$trait_list_len -> + [one] trait {$trait_list}, but this is + *[other] traits {$trait_list}, but these are + } intentionally ignored during dead code analysis + +passes_proc_macro_typeerror = mismatched {$kind} signature + .label = found {$found}, expected type `proc_macro::TokenStream` + .note = {$kind}s must have a signature of `{$expected_signature}` + +passes_proc_macro_diff_arg_count = mismatched {$kind} signature + .label = found unexpected {$count -> + [one] argument + *[other] arguments + } + .note = {$kind}s must have a signature of `{$expected_signature}` + +passes_proc_macro_missing_args = mismatched {$kind} signature + .label = {$kind} must have {$expected_input_count -> + [one] one argument + *[other] two arguments + } of type `proc_macro::TokenStream` + +passes_proc_macro_invalid_abi = proc macro functions may not be `extern "{$abi}"` + +passes_proc_macro_unsafe = proc macro functions may not be `unsafe` + +passes_skipping_const_checks = skipping const checks + +passes_invalid_macro_export_arguments = `{$name}` isn't a valid `#[macro_export]` argument + +passes_invalid_macro_export_arguments_too_many_items = `#[macro_export]` can only take 1 or 0 arguments diff --git a/compiler/rustc_passes/src/lib.rs b/compiler/rustc_passes/src/lib.rs index 0cb8424082c..b7e07aff42b 100644 --- a/compiler/rustc_passes/src/lib.rs +++ b/compiler/rustc_passes/src/lib.rs @@ -42,7 +42,7 @@ pub mod stability; mod upvars; mod weak_lang_items; -fluent_messages! { "../locales/en-US.ftl" } +fluent_messages! { "../messages.ftl" } pub fn provide(providers: &mut Providers) { check_attr::provide(providers); diff --git a/compiler/rustc_plugin_impl/locales/en-US.ftl b/compiler/rustc_plugin_impl/locales/en-US.ftl deleted file mode 100644 index 8db32a42c1d..00000000000 --- a/compiler/rustc_plugin_impl/locales/en-US.ftl +++ /dev/null @@ -1,4 +0,0 @@ -plugin_impl_load_plugin_error = {$msg} - -plugin_impl_malformed_plugin_attribute = malformed `plugin` attribute - .label = malformed attribute diff --git a/compiler/rustc_plugin_impl/messages.ftl b/compiler/rustc_plugin_impl/messages.ftl new file mode 100644 index 00000000000..8db32a42c1d --- /dev/null +++ b/compiler/rustc_plugin_impl/messages.ftl @@ -0,0 +1,4 @@ +plugin_impl_load_plugin_error = {$msg} + +plugin_impl_malformed_plugin_attribute = malformed `plugin` attribute + .label = malformed attribute diff --git a/compiler/rustc_plugin_impl/src/lib.rs b/compiler/rustc_plugin_impl/src/lib.rs index 3f03eef9ee3..672189e22cf 100644 --- a/compiler/rustc_plugin_impl/src/lib.rs +++ b/compiler/rustc_plugin_impl/src/lib.rs @@ -18,7 +18,7 @@ use rustc_macros::fluent_messages; mod errors; pub mod load; -fluent_messages! { "../locales/en-US.ftl" } +fluent_messages! { "../messages.ftl" } /// Structure used to register plugins. /// diff --git a/compiler/rustc_privacy/locales/en-US.ftl b/compiler/rustc_privacy/locales/en-US.ftl deleted file mode 100644 index a26d1b2b381..00000000000 --- a/compiler/rustc_privacy/locales/en-US.ftl +++ /dev/null @@ -1,23 +0,0 @@ -privacy_field_is_private = field `{$field_name}` of {$variant_descr} `{$def_path_str}` is private -privacy_field_is_private_is_update_syntax_label = field `{$field_name}` is private -privacy_field_is_private_label = private field - -privacy_item_is_private = {$kind} `{$descr}` is private - .label = private {$kind} -privacy_unnamed_item_is_private = {$kind} is private - .label = private {$kind} - -privacy_in_public_interface = {$vis_descr} {$kind} `{$descr}` in public interface - .label = can't leak {$vis_descr} {$kind} - .visibility_label = `{$descr}` declared as {$vis_descr} - -privacy_report_effective_visibility = {$descr} - -privacy_from_private_dep_in_public_interface = - {$kind} `{$descr}` from private dependency '{$krate}' in public interface - -privacy_private_in_public_lint = - {$vis_descr} {$kind} `{$descr}` in public interface (error {$kind -> - [trait] E0445 - *[other] E0446 - }) diff --git a/compiler/rustc_privacy/messages.ftl b/compiler/rustc_privacy/messages.ftl new file mode 100644 index 00000000000..a26d1b2b381 --- /dev/null +++ b/compiler/rustc_privacy/messages.ftl @@ -0,0 +1,23 @@ +privacy_field_is_private = field `{$field_name}` of {$variant_descr} `{$def_path_str}` is private +privacy_field_is_private_is_update_syntax_label = field `{$field_name}` is private +privacy_field_is_private_label = private field + +privacy_item_is_private = {$kind} `{$descr}` is private + .label = private {$kind} +privacy_unnamed_item_is_private = {$kind} is private + .label = private {$kind} + +privacy_in_public_interface = {$vis_descr} {$kind} `{$descr}` in public interface + .label = can't leak {$vis_descr} {$kind} + .visibility_label = `{$descr}` declared as {$vis_descr} + +privacy_report_effective_visibility = {$descr} + +privacy_from_private_dep_in_public_interface = + {$kind} `{$descr}` from private dependency '{$krate}' in public interface + +privacy_private_in_public_lint = + {$vis_descr} {$kind} `{$descr}` in public interface (error {$kind -> + [trait] E0445 + *[other] E0446 + }) diff --git a/compiler/rustc_privacy/src/lib.rs b/compiler/rustc_privacy/src/lib.rs index 99a44b0ca4d..ef7c68c1a33 100644 --- a/compiler/rustc_privacy/src/lib.rs +++ b/compiler/rustc_privacy/src/lib.rs @@ -46,7 +46,7 @@ use errors::{ UnnamedItemIsPrivate, }; -fluent_messages! { "../locales/en-US.ftl" } +fluent_messages! { "../messages.ftl" } //////////////////////////////////////////////////////////////////////////////// /// Generic infrastructure used to implement specific visitors below. diff --git a/compiler/rustc_query_system/locales/en-US.ftl b/compiler/rustc_query_system/locales/en-US.ftl deleted file mode 100644 index 870e824039c..00000000000 --- a/compiler/rustc_query_system/locales/en-US.ftl +++ /dev/null @@ -1,30 +0,0 @@ -query_system_reentrant = internal compiler error: re-entrant incremental verify failure, suppressing message - -query_system_increment_compilation = internal compiler error: encountered incremental compilation error with {$dep_node} - .help = This is a known issue with the compiler. Run {$run_cmd} to allow your project to compile - -query_system_increment_compilation_note1 = Please follow the instructions below to create a bug report with the provided information -query_system_increment_compilation_note2 = See for more information - -query_system_cycle = cycle detected when {$stack_bottom} - -query_system_cycle_usage = cycle used when {$usage} - -query_system_cycle_stack_single = ...which immediately requires {$stack_bottom} again - -query_system_cycle_stack_middle = ...which requires {$desc}... - -query_system_cycle_stack_multiple = ...which again requires {$stack_bottom}, completing the cycle - -query_system_cycle_recursive_ty_alias = type aliases cannot be recursive -query_system_cycle_recursive_ty_alias_help1 = consider using a struct, enum, or union instead to break the cycle -query_system_cycle_recursive_ty_alias_help2 = see for more information - -query_system_cycle_recursive_trait_alias = trait aliases cannot be recursive - -query_system_cycle_which_requires = ...which requires {$desc}... - -query_system_query_overflow = queries overflow the depth limit! - .help = consider increasing the recursion limit by adding a `#![recursion_limit = "{$suggested_limit}"]` attribute to your crate (`{$crate_name}`) - -query_system_layout_of_depth = query depth increased by {$depth} when {$desc} diff --git a/compiler/rustc_query_system/messages.ftl b/compiler/rustc_query_system/messages.ftl new file mode 100644 index 00000000000..870e824039c --- /dev/null +++ b/compiler/rustc_query_system/messages.ftl @@ -0,0 +1,30 @@ +query_system_reentrant = internal compiler error: re-entrant incremental verify failure, suppressing message + +query_system_increment_compilation = internal compiler error: encountered incremental compilation error with {$dep_node} + .help = This is a known issue with the compiler. Run {$run_cmd} to allow your project to compile + +query_system_increment_compilation_note1 = Please follow the instructions below to create a bug report with the provided information +query_system_increment_compilation_note2 = See for more information + +query_system_cycle = cycle detected when {$stack_bottom} + +query_system_cycle_usage = cycle used when {$usage} + +query_system_cycle_stack_single = ...which immediately requires {$stack_bottom} again + +query_system_cycle_stack_middle = ...which requires {$desc}... + +query_system_cycle_stack_multiple = ...which again requires {$stack_bottom}, completing the cycle + +query_system_cycle_recursive_ty_alias = type aliases cannot be recursive +query_system_cycle_recursive_ty_alias_help1 = consider using a struct, enum, or union instead to break the cycle +query_system_cycle_recursive_ty_alias_help2 = see for more information + +query_system_cycle_recursive_trait_alias = trait aliases cannot be recursive + +query_system_cycle_which_requires = ...which requires {$desc}... + +query_system_query_overflow = queries overflow the depth limit! + .help = consider increasing the recursion limit by adding a `#![recursion_limit = "{$suggested_limit}"]` attribute to your crate (`{$crate_name}`) + +query_system_layout_of_depth = query depth increased by {$depth} when {$desc} diff --git a/compiler/rustc_query_system/src/lib.rs b/compiler/rustc_query_system/src/lib.rs index 6cc4c9a7e1e..bb812b006e9 100644 --- a/compiler/rustc_query_system/src/lib.rs +++ b/compiler/rustc_query_system/src/lib.rs @@ -30,4 +30,4 @@ pub use error::LayoutOfDepth; pub use error::QueryOverflow; pub use values::Value; -fluent_messages! { "../locales/en-US.ftl" } +fluent_messages! { "../messages.ftl" } diff --git a/compiler/rustc_resolve/locales/en-US.ftl b/compiler/rustc_resolve/locales/en-US.ftl deleted file mode 100644 index 817bb83ed78..00000000000 --- a/compiler/rustc_resolve/locales/en-US.ftl +++ /dev/null @@ -1,211 +0,0 @@ -resolve_parent_module_reset_for_binding = - parent module is reset for binding - -resolve_ampersand_used_without_explicit_lifetime_name = - `&` without an explicit lifetime name cannot be used here - .note = explicit lifetime name needed here - -resolve_underscore_lifetime_name_cannot_be_used_here = - `'_` cannot be used here - .note = `'_` is a reserved lifetime name - -resolve_crate_may_not_be_imported = - `$crate` may not be imported - -resolve_crate_root_imports_must_be_named_explicitly = - crate root imports need to be explicitly named: `use crate as name;` - -resolve_generic_params_from_outer_function = - can't use generic parameters from outer function - .label = use of generic parameter from outer function - .suggestion = try using a local generic parameter instead - -resolve_self_type_implicitly_declared_by_impl = - `Self` type implicitly declared here, by this `impl` - -resolve_cannot_use_self_type_here = - can't use `Self` here - -resolve_use_a_type_here_instead = - use a type here instead - -resolve_type_param_from_outer_fn = - type parameter from outer function - -resolve_const_param_from_outer_fn = - const parameter from outer function - -resolve_try_using_local_generic_parameter = - try using a local generic parameter instead - -resolve_try_adding_local_generic_param_on_method = - try adding a local generic parameter in this method instead - -resolve_help_try_using_local_generic_param = - try using a local generic paramter instead - -resolve_name_is_already_used_as_generic_parameter = - the name `{$name}` is already used for a generic parameter in this item's generic parameters - .label = already used - .first_use_of_name = first use of `{$name}` - -resolve_method_not_member_of_trait = - method `{$method}` is not a member of trait `{$trait_}` - .label = not a member of trait `{$trait_}` - -resolve_associated_fn_with_similar_name_exists = - there is an associated function with a similar name - -resolve_type_not_member_of_trait = - type `{$type_}` is not a member of trait `{$trait_}` - .label = not a member of trait `{$trait_}` - -resolve_associated_type_with_similar_name_exists = - there is an associated type with a similar name - -resolve_const_not_member_of_trait = - const `{$const_}` is not a member of trait `{$trait_}` - .label = not a member of trait `{$trait_}` - -resolve_associated_const_with_similar_name_exists = - there is an associated constant with a similar name - -resolve_variable_bound_with_different_mode = - variable `{$variable_name}` is bound inconsistently across alternatives separated by `|` - .label = bound in different ways - .first_binding_span = first binding - -resolve_ident_bound_more_than_once_in_parameter_list = - identifier `{$identifier}` is bound more than once in this parameter list - .label = used as parameter more than once - -resolve_ident_bound_more_than_once_in_same_pattern = - identifier `{$identifier}` is bound more than once in the same pattern - .label = used in a pattern more than once - -resolve_undeclared_label = - use of undeclared label `{$name}` - .label = undeclared label `{$name}` - -resolve_label_with_similar_name_reachable = - a label with a similar name is reachable - -resolve_try_using_similarly_named_label = - try using similarly named label - -resolve_unreachable_label_with_similar_name_exists = - a label with a similar name exists but is unreachable - -resolve_self_import_can_only_appear_once_in_the_list = - `self` import can only appear once in an import list - .label = can only appear once in an import list - -resolve_self_import_only_in_import_list_with_non_empty_prefix = - `self` import can only appear in an import list with a non-empty prefix - .label = can only appear in an import list with a non-empty prefix - -resolve_cannot_capture_dynamic_environment_in_fn_item = - can't capture dynamic environment in a fn item - .help = use the `|| {"{"} ... {"}"}` closure form instead - -resolve_attempt_to_use_non_constant_value_in_constant = - attempt to use a non-constant value in a constant - -resolve_attempt_to_use_non_constant_value_in_constant_with_suggestion = - consider using `{$suggestion}` instead of `{$current}` - -resolve_attempt_to_use_non_constant_value_in_constant_label_with_suggestion = - non-constant value - -resolve_attempt_to_use_non_constant_value_in_constant_without_suggestion = - this would need to be a `{$suggestion}` - -resolve_self_imports_only_allowed_within = - `self` imports are only allowed within a {"{"} {"}"} list - -resolve_self_imports_only_allowed_within_suggestion = - consider importing the module directly - -resolve_self_imports_only_allowed_within_multipart_suggestion = - alternatively, use the multi-path `use` syntax to import `self` - -resolve_binding_shadows_something_unacceptable = - {$shadowing_binding}s cannot shadow {$shadowed_binding}s - .label = cannot be named the same as {$article} {$shadowed_binding} - .label_shadowed_binding = the {$shadowed_binding} `{$name}` is {$participle} here - -resolve_binding_shadows_something_unacceptable_suggestion = - try specify the pattern arguments - -resolve_forward_declared_generic_param = - generic parameters with a default cannot use forward declared identifiers - .label = defaulted generic parameters cannot be forward declared - -resolve_param_in_ty_of_const_param = - the type of const parameters must not depend on other generic parameters - .label = the type must not depend on the parameter `{$name}` - -resolve_self_in_generic_param_default = - generic parameters cannot use `Self` in their defaults - .label = `Self` in generic parameter default - -resolve_param_in_non_trivial_anon_const = - generic parameters may not be used in const operations - .label = cannot perform const operation using `{$name}` - -resolve_param_in_non_trivial_anon_const_help = - use `#![feature(generic_const_exprs)]` to allow generic const expressions - -resolve_param_in_non_trivial_anon_const_sub_type = - type parameters may not be used in const expressions - -resolve_param_in_non_trivial_anon_const_sub_non_type = - const parameters may only be used as standalone arguments, i.e. `{$name}` - -resolve_unreachable_label = - use of unreachable label `{$name}` - .label = unreachable label `{$name}` - .label_definition_span = unreachable label defined here - .note = labels are unreachable through functions, closures, async blocks and modules - -resolve_unreachable_label_suggestion_use_similarly_named = - try using similarly named label - -resolve_unreachable_label_similar_name_reachable = - a label with a similar name is reachable - -resolve_unreachable_label_similar_name_unreachable = - a label with a similar name exists but is also unreachable - -resolve_trait_impl_mismatch = - item `{$name}` is an associated {$kind}, which doesn't match its trait `{$trait_path}` - .label = does not match trait - .label_trait_item = item in trait - -resolve_invalid_asm_sym = - invalid `sym` operand - .label = is a local variable - .help = `sym` operands must refer to either a function or a static - -resolve_trait_impl_duplicate = - duplicate definitions with name `{$name}`: - .label = duplicate definition - .old_span_label = previous definition here - .trait_item_span = item in trait - -resolve_relative_2018 = - relative paths are not supported in visibilities in 2018 edition or later - .suggestion = try - -resolve_ancestor_only = - visibilities can only be restricted to ancestor modules - -resolve_expected_found = - expected module, found {$res} `{$path_str}` - .label = not a module - -resolve_indeterminate = - cannot determine resolution for the visibility - -resolve_module_only = - visibility must resolve to a module diff --git a/compiler/rustc_resolve/messages.ftl b/compiler/rustc_resolve/messages.ftl new file mode 100644 index 00000000000..817bb83ed78 --- /dev/null +++ b/compiler/rustc_resolve/messages.ftl @@ -0,0 +1,211 @@ +resolve_parent_module_reset_for_binding = + parent module is reset for binding + +resolve_ampersand_used_without_explicit_lifetime_name = + `&` without an explicit lifetime name cannot be used here + .note = explicit lifetime name needed here + +resolve_underscore_lifetime_name_cannot_be_used_here = + `'_` cannot be used here + .note = `'_` is a reserved lifetime name + +resolve_crate_may_not_be_imported = + `$crate` may not be imported + +resolve_crate_root_imports_must_be_named_explicitly = + crate root imports need to be explicitly named: `use crate as name;` + +resolve_generic_params_from_outer_function = + can't use generic parameters from outer function + .label = use of generic parameter from outer function + .suggestion = try using a local generic parameter instead + +resolve_self_type_implicitly_declared_by_impl = + `Self` type implicitly declared here, by this `impl` + +resolve_cannot_use_self_type_here = + can't use `Self` here + +resolve_use_a_type_here_instead = + use a type here instead + +resolve_type_param_from_outer_fn = + type parameter from outer function + +resolve_const_param_from_outer_fn = + const parameter from outer function + +resolve_try_using_local_generic_parameter = + try using a local generic parameter instead + +resolve_try_adding_local_generic_param_on_method = + try adding a local generic parameter in this method instead + +resolve_help_try_using_local_generic_param = + try using a local generic paramter instead + +resolve_name_is_already_used_as_generic_parameter = + the name `{$name}` is already used for a generic parameter in this item's generic parameters + .label = already used + .first_use_of_name = first use of `{$name}` + +resolve_method_not_member_of_trait = + method `{$method}` is not a member of trait `{$trait_}` + .label = not a member of trait `{$trait_}` + +resolve_associated_fn_with_similar_name_exists = + there is an associated function with a similar name + +resolve_type_not_member_of_trait = + type `{$type_}` is not a member of trait `{$trait_}` + .label = not a member of trait `{$trait_}` + +resolve_associated_type_with_similar_name_exists = + there is an associated type with a similar name + +resolve_const_not_member_of_trait = + const `{$const_}` is not a member of trait `{$trait_}` + .label = not a member of trait `{$trait_}` + +resolve_associated_const_with_similar_name_exists = + there is an associated constant with a similar name + +resolve_variable_bound_with_different_mode = + variable `{$variable_name}` is bound inconsistently across alternatives separated by `|` + .label = bound in different ways + .first_binding_span = first binding + +resolve_ident_bound_more_than_once_in_parameter_list = + identifier `{$identifier}` is bound more than once in this parameter list + .label = used as parameter more than once + +resolve_ident_bound_more_than_once_in_same_pattern = + identifier `{$identifier}` is bound more than once in the same pattern + .label = used in a pattern more than once + +resolve_undeclared_label = + use of undeclared label `{$name}` + .label = undeclared label `{$name}` + +resolve_label_with_similar_name_reachable = + a label with a similar name is reachable + +resolve_try_using_similarly_named_label = + try using similarly named label + +resolve_unreachable_label_with_similar_name_exists = + a label with a similar name exists but is unreachable + +resolve_self_import_can_only_appear_once_in_the_list = + `self` import can only appear once in an import list + .label = can only appear once in an import list + +resolve_self_import_only_in_import_list_with_non_empty_prefix = + `self` import can only appear in an import list with a non-empty prefix + .label = can only appear in an import list with a non-empty prefix + +resolve_cannot_capture_dynamic_environment_in_fn_item = + can't capture dynamic environment in a fn item + .help = use the `|| {"{"} ... {"}"}` closure form instead + +resolve_attempt_to_use_non_constant_value_in_constant = + attempt to use a non-constant value in a constant + +resolve_attempt_to_use_non_constant_value_in_constant_with_suggestion = + consider using `{$suggestion}` instead of `{$current}` + +resolve_attempt_to_use_non_constant_value_in_constant_label_with_suggestion = + non-constant value + +resolve_attempt_to_use_non_constant_value_in_constant_without_suggestion = + this would need to be a `{$suggestion}` + +resolve_self_imports_only_allowed_within = + `self` imports are only allowed within a {"{"} {"}"} list + +resolve_self_imports_only_allowed_within_suggestion = + consider importing the module directly + +resolve_self_imports_only_allowed_within_multipart_suggestion = + alternatively, use the multi-path `use` syntax to import `self` + +resolve_binding_shadows_something_unacceptable = + {$shadowing_binding}s cannot shadow {$shadowed_binding}s + .label = cannot be named the same as {$article} {$shadowed_binding} + .label_shadowed_binding = the {$shadowed_binding} `{$name}` is {$participle} here + +resolve_binding_shadows_something_unacceptable_suggestion = + try specify the pattern arguments + +resolve_forward_declared_generic_param = + generic parameters with a default cannot use forward declared identifiers + .label = defaulted generic parameters cannot be forward declared + +resolve_param_in_ty_of_const_param = + the type of const parameters must not depend on other generic parameters + .label = the type must not depend on the parameter `{$name}` + +resolve_self_in_generic_param_default = + generic parameters cannot use `Self` in their defaults + .label = `Self` in generic parameter default + +resolve_param_in_non_trivial_anon_const = + generic parameters may not be used in const operations + .label = cannot perform const operation using `{$name}` + +resolve_param_in_non_trivial_anon_const_help = + use `#![feature(generic_const_exprs)]` to allow generic const expressions + +resolve_param_in_non_trivial_anon_const_sub_type = + type parameters may not be used in const expressions + +resolve_param_in_non_trivial_anon_const_sub_non_type = + const parameters may only be used as standalone arguments, i.e. `{$name}` + +resolve_unreachable_label = + use of unreachable label `{$name}` + .label = unreachable label `{$name}` + .label_definition_span = unreachable label defined here + .note = labels are unreachable through functions, closures, async blocks and modules + +resolve_unreachable_label_suggestion_use_similarly_named = + try using similarly named label + +resolve_unreachable_label_similar_name_reachable = + a label with a similar name is reachable + +resolve_unreachable_label_similar_name_unreachable = + a label with a similar name exists but is also unreachable + +resolve_trait_impl_mismatch = + item `{$name}` is an associated {$kind}, which doesn't match its trait `{$trait_path}` + .label = does not match trait + .label_trait_item = item in trait + +resolve_invalid_asm_sym = + invalid `sym` operand + .label = is a local variable + .help = `sym` operands must refer to either a function or a static + +resolve_trait_impl_duplicate = + duplicate definitions with name `{$name}`: + .label = duplicate definition + .old_span_label = previous definition here + .trait_item_span = item in trait + +resolve_relative_2018 = + relative paths are not supported in visibilities in 2018 edition or later + .suggestion = try + +resolve_ancestor_only = + visibilities can only be restricted to ancestor modules + +resolve_expected_found = + expected module, found {$res} `{$path_str}` + .label = not a module + +resolve_indeterminate = + cannot determine resolution for the visibility + +resolve_module_only = + visibility must resolve to a module diff --git a/compiler/rustc_resolve/src/lib.rs b/compiler/rustc_resolve/src/lib.rs index e822c18fa5f..ce4834decfd 100644 --- a/compiler/rustc_resolve/src/lib.rs +++ b/compiler/rustc_resolve/src/lib.rs @@ -81,7 +81,7 @@ mod late; mod macros; pub mod rustdoc; -fluent_messages! { "../locales/en-US.ftl" } +fluent_messages! { "../messages.ftl" } enum Weak { Yes, diff --git a/compiler/rustc_session/locales/en-US.ftl b/compiler/rustc_session/locales/en-US.ftl deleted file mode 100644 index ff53f22d43f..00000000000 --- a/compiler/rustc_session/locales/en-US.ftl +++ /dev/null @@ -1,95 +0,0 @@ -session_incorrect_cgu_reuse_type = - CGU-reuse for `{$cgu_user_name}` is `{$actual_reuse}` but should be {$at_least -> - [one] {"at least "} - *[other] {""} - }`{$expected_reuse}` - -session_cgu_not_recorded = - CGU-reuse for `{$cgu_user_name}` is (mangled: `{$cgu_name}`) was not recorded - -session_feature_gate_error = {$explain} - -session_feature_diagnostic_for_issue = - see issue #{$n} for more information - -session_feature_diagnostic_help = - add `#![feature({$feature})]` to the crate attributes to enable - -session_not_circumvent_feature = `-Zunleash-the-miri-inside-of-you` may not be used to circumvent feature gates, except when testing error paths in the CTFE engine - -session_profile_use_file_does_not_exist = file `{$path}` passed to `-C profile-use` does not exist. - -session_linker_plugin_lto_windows_not_supported = linker plugin based LTO is not supported together with `-C prefer-dynamic` when targeting Windows-like targets - -session_profile_sample_use_file_does_not_exist = file `{$path}` passed to `-C profile-sample-use` does not exist. - -session_target_requires_unwind_tables = target requires unwind tables, they cannot be disabled with `-C force-unwind-tables=no` - -session_instrumentation_not_supported = {$us} instrumentation is not supported for this target - -session_sanitizer_not_supported = {$us} sanitizer is not supported for this target - -session_sanitizers_not_supported = {$us} sanitizers are not supported for this target - -session_cannot_mix_and_match_sanitizers = `-Zsanitizer={$first}` is incompatible with `-Zsanitizer={$second}` - -session_cannot_enable_crt_static_linux = sanitizer is incompatible with statically linked libc, disable it using `-C target-feature=-crt-static` - -session_sanitizer_cfi_enabled = `-Zsanitizer=cfi` requires `-Clto` - -session_unstable_virtual_function_elimination = `-Zvirtual-function-elimination` requires `-Clto` - -session_unsupported_dwarf_version = requested DWARF version {$dwarf_version} is greater than 5 - -session_target_stack_protector_not_supported = `-Z stack-protector={$stack_protector}` is not supported for target {$target_triple} and will be ignored - -session_branch_protection_requires_aarch64 = `-Zbranch-protection` is only supported on aarch64 - -session_split_debuginfo_unstable_platform = `-Csplit-debuginfo={$debuginfo}` is unstable on this platform - -session_file_is_not_writeable = output file {$file} is not writeable -- check its permissions - -session_crate_name_does_not_match = `--crate-name` and `#[crate_name]` are required to match, but `{$s}` != `{$name}` - -session_crate_name_invalid = crate names cannot start with a `-`, but `{$s}` has a leading hyphen - -session_crate_name_empty = crate name must not be empty - -session_invalid_character_in_create_name = invalid character `{$character}` in crate name: `{$crate_name}` - -session_expr_parentheses_needed = parentheses are required to parse this as an expression - -session_skipping_const_checks = skipping const checks -session_unleashed_feature_help_named = skipping check for `{$gate}` feature -session_unleashed_feature_help_unnamed = skipping check that does not even have a feature gate - -session_hexadecimal_float_literal_not_supported = hexadecimal float literal is not supported -session_octal_float_literal_not_supported = octal float literal is not supported -session_binary_float_literal_not_supported = binary float literal is not supported -session_not_supported = not supported - -session_invalid_literal_suffix = suffixes on {$kind} literals are invalid - .label = invalid suffix `{$suffix}` - -session_invalid_num_literal_base_prefix = invalid base prefix for number literal - .note = base prefixes (`0xff`, `0b1010`, `0o755`) are lowercase - .suggestion = try making the prefix lowercase - -session_invalid_num_literal_suffix = invalid suffix `{$suffix}` for number literal - .label = invalid suffix `{$suffix}` - .help = the suffix must be one of the numeric types (`u32`, `isize`, `f32`, etc.) - -session_invalid_float_literal_width = invalid width `{$width}` for float literal - .help = valid widths are 32 and 64 - -session_invalid_float_literal_suffix = invalid suffix `{$suffix}` for float literal - .label = invalid suffix `{$suffix}` - .help = valid suffixes are `f32` and `f64` - -session_int_literal_too_large = integer literal is too large - .note = value exceeds limit of `{$limit}` - -session_invalid_int_literal_width = invalid width `{$width}` for integer literal - .help = valid widths are 8, 16, 32, 64 and 128 - -session_optimization_fuel_exhausted = optimization-fuel-exhausted: {$msg} diff --git a/compiler/rustc_session/messages.ftl b/compiler/rustc_session/messages.ftl new file mode 100644 index 00000000000..ff53f22d43f --- /dev/null +++ b/compiler/rustc_session/messages.ftl @@ -0,0 +1,95 @@ +session_incorrect_cgu_reuse_type = + CGU-reuse for `{$cgu_user_name}` is `{$actual_reuse}` but should be {$at_least -> + [one] {"at least "} + *[other] {""} + }`{$expected_reuse}` + +session_cgu_not_recorded = + CGU-reuse for `{$cgu_user_name}` is (mangled: `{$cgu_name}`) was not recorded + +session_feature_gate_error = {$explain} + +session_feature_diagnostic_for_issue = + see issue #{$n} for more information + +session_feature_diagnostic_help = + add `#![feature({$feature})]` to the crate attributes to enable + +session_not_circumvent_feature = `-Zunleash-the-miri-inside-of-you` may not be used to circumvent feature gates, except when testing error paths in the CTFE engine + +session_profile_use_file_does_not_exist = file `{$path}` passed to `-C profile-use` does not exist. + +session_linker_plugin_lto_windows_not_supported = linker plugin based LTO is not supported together with `-C prefer-dynamic` when targeting Windows-like targets + +session_profile_sample_use_file_does_not_exist = file `{$path}` passed to `-C profile-sample-use` does not exist. + +session_target_requires_unwind_tables = target requires unwind tables, they cannot be disabled with `-C force-unwind-tables=no` + +session_instrumentation_not_supported = {$us} instrumentation is not supported for this target + +session_sanitizer_not_supported = {$us} sanitizer is not supported for this target + +session_sanitizers_not_supported = {$us} sanitizers are not supported for this target + +session_cannot_mix_and_match_sanitizers = `-Zsanitizer={$first}` is incompatible with `-Zsanitizer={$second}` + +session_cannot_enable_crt_static_linux = sanitizer is incompatible with statically linked libc, disable it using `-C target-feature=-crt-static` + +session_sanitizer_cfi_enabled = `-Zsanitizer=cfi` requires `-Clto` + +session_unstable_virtual_function_elimination = `-Zvirtual-function-elimination` requires `-Clto` + +session_unsupported_dwarf_version = requested DWARF version {$dwarf_version} is greater than 5 + +session_target_stack_protector_not_supported = `-Z stack-protector={$stack_protector}` is not supported for target {$target_triple} and will be ignored + +session_branch_protection_requires_aarch64 = `-Zbranch-protection` is only supported on aarch64 + +session_split_debuginfo_unstable_platform = `-Csplit-debuginfo={$debuginfo}` is unstable on this platform + +session_file_is_not_writeable = output file {$file} is not writeable -- check its permissions + +session_crate_name_does_not_match = `--crate-name` and `#[crate_name]` are required to match, but `{$s}` != `{$name}` + +session_crate_name_invalid = crate names cannot start with a `-`, but `{$s}` has a leading hyphen + +session_crate_name_empty = crate name must not be empty + +session_invalid_character_in_create_name = invalid character `{$character}` in crate name: `{$crate_name}` + +session_expr_parentheses_needed = parentheses are required to parse this as an expression + +session_skipping_const_checks = skipping const checks +session_unleashed_feature_help_named = skipping check for `{$gate}` feature +session_unleashed_feature_help_unnamed = skipping check that does not even have a feature gate + +session_hexadecimal_float_literal_not_supported = hexadecimal float literal is not supported +session_octal_float_literal_not_supported = octal float literal is not supported +session_binary_float_literal_not_supported = binary float literal is not supported +session_not_supported = not supported + +session_invalid_literal_suffix = suffixes on {$kind} literals are invalid + .label = invalid suffix `{$suffix}` + +session_invalid_num_literal_base_prefix = invalid base prefix for number literal + .note = base prefixes (`0xff`, `0b1010`, `0o755`) are lowercase + .suggestion = try making the prefix lowercase + +session_invalid_num_literal_suffix = invalid suffix `{$suffix}` for number literal + .label = invalid suffix `{$suffix}` + .help = the suffix must be one of the numeric types (`u32`, `isize`, `f32`, etc.) + +session_invalid_float_literal_width = invalid width `{$width}` for float literal + .help = valid widths are 32 and 64 + +session_invalid_float_literal_suffix = invalid suffix `{$suffix}` for float literal + .label = invalid suffix `{$suffix}` + .help = valid suffixes are `f32` and `f64` + +session_int_literal_too_large = integer literal is too large + .note = value exceeds limit of `{$limit}` + +session_invalid_int_literal_width = invalid width `{$width}` for integer literal + .help = valid widths are 8, 16, 32, 64 and 128 + +session_optimization_fuel_exhausted = optimization-fuel-exhausted: {$msg} diff --git a/compiler/rustc_session/src/lib.rs b/compiler/rustc_session/src/lib.rs index e1f1a5f6d2e..74aef785163 100644 --- a/compiler/rustc_session/src/lib.rs +++ b/compiler/rustc_session/src/lib.rs @@ -42,7 +42,7 @@ pub mod output; pub use getopts; -fluent_messages! { "../locales/en-US.ftl" } +fluent_messages! { "../messages.ftl" } /// Requirements for a `StableHashingContext` to be used in this crate. /// This is a hack to allow using the `HashStable_Generic` derive macro diff --git a/compiler/rustc_symbol_mangling/locales/en-US.ftl b/compiler/rustc_symbol_mangling/locales/en-US.ftl deleted file mode 100644 index b7d48280f46..00000000000 --- a/compiler/rustc_symbol_mangling/locales/en-US.ftl +++ /dev/null @@ -1 +0,0 @@ -symbol_mangling_test_output = {$kind}({$content}) diff --git a/compiler/rustc_symbol_mangling/messages.ftl b/compiler/rustc_symbol_mangling/messages.ftl new file mode 100644 index 00000000000..b7d48280f46 --- /dev/null +++ b/compiler/rustc_symbol_mangling/messages.ftl @@ -0,0 +1 @@ +symbol_mangling_test_output = {$kind}({$content}) diff --git a/compiler/rustc_symbol_mangling/src/lib.rs b/compiler/rustc_symbol_mangling/src/lib.rs index d9ce7373483..c2fd3304f2b 100644 --- a/compiler/rustc_symbol_mangling/src/lib.rs +++ b/compiler/rustc_symbol_mangling/src/lib.rs @@ -119,7 +119,7 @@ pub mod errors; pub mod test; pub mod typeid; -fluent_messages! { "../locales/en-US.ftl" } +fluent_messages! { "../messages.ftl" } /// This function computes the symbol name for the given `instance` and the /// given instantiating crate. That is, if you know that instance X is diff --git a/compiler/rustc_trait_selection/locales/en-US.ftl b/compiler/rustc_trait_selection/locales/en-US.ftl deleted file mode 100644 index 14eb4a5502d..00000000000 --- a/compiler/rustc_trait_selection/locales/en-US.ftl +++ /dev/null @@ -1,22 +0,0 @@ -trait_selection_dump_vtable_entries = vtable entries for `{$trait_ref}`: {$entries} - -trait_selection_unable_to_construct_constant_value = unable to construct a constant value for the unevaluated constant {$unevaluated} - -trait_selection_empty_on_clause_in_rustc_on_unimplemented = empty `on`-clause in `#[rustc_on_unimplemented]` - .label = empty on-clause here - -trait_selection_invalid_on_clause_in_rustc_on_unimplemented = invalid `on`-clause in `#[rustc_on_unimplemented]` - .label = invalid on-clause here - -trait_selection_no_value_in_rustc_on_unimplemented = this attribute must have a valid value - .label = expected value here - .note = eg `#[rustc_on_unimplemented(message="foo")]` - -trait_selection_negative_positive_conflict = found both positive and negative implementation of trait `{$trait_desc}`{$self_desc -> - [none] {""} - *[default] {" "}for type `{$self_desc}` - }: - .negative_implementation_here = negative implementation here - .negative_implementation_in_crate = negative implementation in crate `{$negative_impl_cname}` - .positive_implementation_here = positive implementation here - .positive_implementation_in_crate = positive implementation in crate `{$positive_impl_cname}` diff --git a/compiler/rustc_trait_selection/messages.ftl b/compiler/rustc_trait_selection/messages.ftl new file mode 100644 index 00000000000..14eb4a5502d --- /dev/null +++ b/compiler/rustc_trait_selection/messages.ftl @@ -0,0 +1,22 @@ +trait_selection_dump_vtable_entries = vtable entries for `{$trait_ref}`: {$entries} + +trait_selection_unable_to_construct_constant_value = unable to construct a constant value for the unevaluated constant {$unevaluated} + +trait_selection_empty_on_clause_in_rustc_on_unimplemented = empty `on`-clause in `#[rustc_on_unimplemented]` + .label = empty on-clause here + +trait_selection_invalid_on_clause_in_rustc_on_unimplemented = invalid `on`-clause in `#[rustc_on_unimplemented]` + .label = invalid on-clause here + +trait_selection_no_value_in_rustc_on_unimplemented = this attribute must have a valid value + .label = expected value here + .note = eg `#[rustc_on_unimplemented(message="foo")]` + +trait_selection_negative_positive_conflict = found both positive and negative implementation of trait `{$trait_desc}`{$self_desc -> + [none] {""} + *[default] {" "}for type `{$self_desc}` + }: + .negative_implementation_here = negative implementation here + .negative_implementation_in_crate = negative implementation in crate `{$negative_impl_cname}` + .positive_implementation_here = positive implementation here + .positive_implementation_in_crate = positive implementation in crate `{$positive_impl_cname}` diff --git a/compiler/rustc_trait_selection/src/lib.rs b/compiler/rustc_trait_selection/src/lib.rs index 548b42cef43..f866cb016e2 100644 --- a/compiler/rustc_trait_selection/src/lib.rs +++ b/compiler/rustc_trait_selection/src/lib.rs @@ -44,4 +44,4 @@ pub mod infer; pub mod solve; pub mod traits; -fluent_messages! { "../locales/en-US.ftl" } +fluent_messages! { "../messages.ftl" } diff --git a/compiler/rustc_ty_utils/locales/en-US.ftl b/compiler/rustc_ty_utils/locales/en-US.ftl deleted file mode 100644 index abe65a0e3fe..00000000000 --- a/compiler/rustc_ty_utils/locales/en-US.ftl +++ /dev/null @@ -1,47 +0,0 @@ -ty_utils_needs_drop_overflow = overflow while checking whether `{$query_ty}` requires drop - -ty_utils_generic_constant_too_complex = overly complex generic constant - .help = consider moving this anonymous constant into a `const` function - .maybe_supported = this operation may be supported in the future - -ty_utils_borrow_not_supported = borrowing is not supported in generic constants - -ty_utils_address_and_deref_not_supported = dereferencing or taking the address is not supported in generic constants - -ty_utils_array_not_supported = array construction is not supported in generic constants - -ty_utils_block_not_supported = blocks are not supported in generic constants - -ty_utils_never_to_any_not_supported = converting nevers to any is not supported in generic constants - -ty_utils_tuple_not_supported = tuple construction is not supported in generic constants - -ty_utils_index_not_supported = indexing is not supported in generic constants - -ty_utils_field_not_supported = field access is not supported in generic constants - -ty_utils_const_block_not_supported = const blocks are not supported in generic constants - -ty_utils_adt_not_supported = struct/enum construction is not supported in generic constants - -ty_utils_pointer_not_supported = pointer casts are not allowed in generic constants - -ty_utils_yield_not_supported = generator control flow is not allowed in generic constants - -ty_utils_loop_not_supported = loops and loop control flow are not supported in generic constants - -ty_utils_box_not_supported = allocations are not allowed in generic constants - -ty_utils_binary_not_supported = unsupported binary operation in generic constants - -ty_utils_logical_op_not_supported = unsupported operation in generic constants, short-circuiting operations would imply control flow - -ty_utils_assign_not_supported = assignment is not supported in generic constants - -ty_utils_closure_and_return_not_supported = closures and function keywords are not supported in generic constants - -ty_utils_control_flow_not_supported = control flow is not supported in generic constants - -ty_utils_inline_asm_not_supported = assembly is not supported in generic constants - -ty_utils_operation_not_supported = unsupported operation in generic constants diff --git a/compiler/rustc_ty_utils/messages.ftl b/compiler/rustc_ty_utils/messages.ftl new file mode 100644 index 00000000000..abe65a0e3fe --- /dev/null +++ b/compiler/rustc_ty_utils/messages.ftl @@ -0,0 +1,47 @@ +ty_utils_needs_drop_overflow = overflow while checking whether `{$query_ty}` requires drop + +ty_utils_generic_constant_too_complex = overly complex generic constant + .help = consider moving this anonymous constant into a `const` function + .maybe_supported = this operation may be supported in the future + +ty_utils_borrow_not_supported = borrowing is not supported in generic constants + +ty_utils_address_and_deref_not_supported = dereferencing or taking the address is not supported in generic constants + +ty_utils_array_not_supported = array construction is not supported in generic constants + +ty_utils_block_not_supported = blocks are not supported in generic constants + +ty_utils_never_to_any_not_supported = converting nevers to any is not supported in generic constants + +ty_utils_tuple_not_supported = tuple construction is not supported in generic constants + +ty_utils_index_not_supported = indexing is not supported in generic constants + +ty_utils_field_not_supported = field access is not supported in generic constants + +ty_utils_const_block_not_supported = const blocks are not supported in generic constants + +ty_utils_adt_not_supported = struct/enum construction is not supported in generic constants + +ty_utils_pointer_not_supported = pointer casts are not allowed in generic constants + +ty_utils_yield_not_supported = generator control flow is not allowed in generic constants + +ty_utils_loop_not_supported = loops and loop control flow are not supported in generic constants + +ty_utils_box_not_supported = allocations are not allowed in generic constants + +ty_utils_binary_not_supported = unsupported binary operation in generic constants + +ty_utils_logical_op_not_supported = unsupported operation in generic constants, short-circuiting operations would imply control flow + +ty_utils_assign_not_supported = assignment is not supported in generic constants + +ty_utils_closure_and_return_not_supported = closures and function keywords are not supported in generic constants + +ty_utils_control_flow_not_supported = control flow is not supported in generic constants + +ty_utils_inline_asm_not_supported = assembly is not supported in generic constants + +ty_utils_operation_not_supported = unsupported operation in generic constants diff --git a/compiler/rustc_ty_utils/src/lib.rs b/compiler/rustc_ty_utils/src/lib.rs index 35f468aa952..3865a8f3223 100644 --- a/compiler/rustc_ty_utils/src/lib.rs +++ b/compiler/rustc_ty_utils/src/lib.rs @@ -33,7 +33,7 @@ pub mod representability; mod structural_match; mod ty; -fluent_messages! { "../locales/en-US.ftl" } +fluent_messages! { "../messages.ftl" } pub fn provide(providers: &mut Providers) { abi::provide(providers); -- cgit 1.4.1-3-g733a5