2022-09-28 09:21:33 +00:00
hir_analysis_unrecognized_atomic_operation =
2022-03-31 07:35:17 +00:00
unrecognized atomic operation function: `{$op}`
.label = unrecognized atomic operation
2022-09-28 09:21:33 +00:00
hir_analysis_wrong_number_of_generic_arguments_to_intrinsic =
2022-03-31 07:35:17 +00:00
intrinsic has wrong number of {$descr} parameters: found {$found}, expected {$expected}
.label = expected {$expected} {$descr} {$expected ->
[one] parameter
*[other] parameters
}
2022-09-28 09:21:33 +00:00
hir_analysis_unrecognized_intrinsic_function =
2022-03-31 07:35:17 +00:00
unrecognized intrinsic function: `{$name}`
.label = unrecognized intrinsic
2022-09-28 09:21:33 +00:00
hir_analysis_lifetimes_or_bounds_mismatch_on_trait =
2022-03-31 07:35:17 +00:00
lifetime parameters or bounds on {$item_kind} `{$ident}` do not match the trait declaration
.label = lifetimes do not match {$item_kind} in trait
2022-08-10 07:42:10 +00:00
.generics_label = lifetimes in impl do not match this {$item_kind} in trait
2022-11-28 08:03:57 +00:00
.where_label = this `where` clause might not match the one in the trait
.bounds_label = this bound might be missing in the impl
2022-03-31 07:35:17 +00:00
2022-11-03 00:45:08 +00:00
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
2022-09-28 09:21:33 +00:00
hir_analysis_drop_impl_on_wrong_item =
2022-07-21 22:00:15 +00:00
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
2022-03-31 07:35:17 +00:00
2022-09-28 09:21:33 +00:00
hir_analysis_field_already_declared =
2022-03-31 07:35:17 +00:00
field `{$field_name}` is already declared
.label = field already declared
2022-08-10 07:42:10 +00:00
.previous_decl_label = `{$field_name}` first declared here
2022-03-31 07:35:17 +00:00
2022-10-13 09:13:02 +00:00
hir_analysis_expected_used_symbol = expected `used`, `used(compiler)` or `used(linker)`
2022-03-31 07:35:17 +00:00
2022-09-28 09:21:33 +00:00
hir_analysis_ambiguous_lifetime_bound =
2022-03-31 07:35:17 +00:00
ambiguous lifetime bound, explicit lifetime bound required
2022-09-28 09:21:33 +00:00
hir_analysis_assoc_type_binding_not_allowed =
2022-03-31 07:35:17 +00:00
associated type bindings are not allowed here
.label = associated type not allowed here
2023-03-09 07:42:45 +00:00
hir_analysis_parenthesized_fn_trait_expansion =
parenthesized trait syntax expands to `{$expanded_type}`
2022-09-28 09:21:33 +00:00
hir_analysis_typeof_reserved_keyword_used =
2022-03-31 07:35:17 +00:00
`typeof` is a reserved keyword but unimplemented
2022-04-07 18:46:53 +00:00
.suggestion = consider replacing `typeof(...)` with an actual type
2022-03-31 07:35:17 +00:00
.label = reserved keyword
2022-09-28 09:21:33 +00:00
hir_analysis_value_of_associated_struct_already_specified =
2022-03-31 07:35:17 +00:00
the value of the associated type `{$item_name}` (from trait `{$def_path}`) is already specified
.label = re-bound here
2022-08-10 07:42:10 +00:00
.previous_bound_label = `{$item_name}` bound here first
2022-03-31 07:35:17 +00:00
2022-09-28 09:21:33 +00:00
hir_analysis_unconstrained_opaque_type = unconstrained opaque type
2022-10-22 03:09:49 +00:00
.note = `{$name}` must be used in combination with a concrete type within the same {$what}
2022-05-06 02:46:12 +00:00
2022-10-13 09:13:02 +00:00
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
2022-09-28 09:21:33 +00:00
hir_analysis_missing_type_params =
2022-05-07 06:32:01 +00:00
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
}
2022-08-10 07:42:10 +00:00
.no_suggestion_label = missing {$parameterCount ->
2022-05-07 06:32:01 +00:00
[one] reference
*[other] references
} to {$parameters}
.note = because of the default `Self` reference, type parameters must be specified on object types
2022-05-07 06:50:01 +00:00
2022-10-13 09:13:02 +00:00
hir_analysis_copy_impl_on_type_with_dtor =
2023-03-07 23:55:51 +00:00
the trait `Copy` cannot be implemented for this type; the type has a destructor
2022-10-13 09:13:02 +00:00
.label = `Copy` not allowed on types with destructors
2022-08-17 09:47:44 +00:00
2022-10-13 09:13:02 +00:00
hir_analysis_multiple_relaxed_default_bounds =
type parameter has more than one relaxed default bound, only one is supported
2022-08-17 09:47:44 +00:00
2022-10-13 09:13:02 +00:00
hir_analysis_copy_impl_on_non_adt =
2023-03-07 23:55:51 +00:00
the trait `Copy` cannot be implemented for this type
2022-10-13 09:13:02 +00:00
.label = type is not a structure or enumeration
2022-08-18 12:14:21 +00:00
2022-10-25 18:28:04 +00:00
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
2022-10-27 20:48:41 +00:00
2022-10-27 21:29:16 +00:00
hir_analysis_self_in_impl_self =
2022-10-27 21:18:26 +00:00
`Self` is not valid in the self type of an impl block
2022-10-27 21:29:16 +00:00
.note = replace `Self` with a different type
Move linkage type check to HIR analysis and fix semantics issues.
This ensures that the error is printed even for unused variables,
as well as unifying the handling between the LLVM and GCC backends.
This also fixes unusual behavior around exported Rust-defined variables
with linkage attributes. With the previous behavior, it appears to be
impossible to define such a variable such that it can actually be imported
and used by another crate. This is because on the importing side, the
variable is required to be a pointer, but on the exporting side, the
type checker rejects static variables of pointer type because they do
not implement `Sync`. Even if it were possible to import such a type, it
appears that code generation on the importing side would add an unexpected
additional level of pointer indirection, which would break type safety.
This highlighted that the semantics of linkage on Rust-defined variables
is different to linkage on foreign items. As such, we now model the
difference with two different codegen attributes: linkage for Rust-defined
variables, and import_linkage for foreign items.
This change gives semantics to the test
src/test/ui/linkage-attr/auxiliary/def_illtyped_external.rs which was
previously expected to fail to compile. Therefore, convert it into a
test that is expected to successfully compile.
The update to the GCC backend is speculative and untested.
2022-11-24 02:13:30 +00:00
hir_analysis_linkage_type =
2022-11-24 02:15:50 +00:00
invalid type for variable with `#[linkage]` attribute
2022-12-27 00:39:36 +00:00
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}`)
2023-02-21 20:27:16 +00:00
2023-02-22 23:50:38 +00:00
hir_analysis_where_clause_on_main = `main` function is not allowed to have a `where` clause
.label = `main` cannot have a `where` clause
2023-02-21 20:27:16 +00:00
hir_analysis_track_caller_on_main = `main` function is not allowed to be `#[track_caller]`
2023-02-25 22:01:44 +00:00
.suggestion = remove this annotation
2023-02-24 20:23:30 +00:00
2023-03-02 11:37:32 +00:00
hir_analysis_target_feature_on_main = `main` function is not allowed to have `#[target_feature]`
2023-02-24 20:23:30 +00:00
hir_analysis_start_not_track_caller = `start` is not allowed to be `#[track_caller]`
.label = `start` is not allowed to be `#[track_caller]`
2023-03-02 13:26:12 +00:00
hir_analysis_start_not_target_feature = `start` is not allowed to have `#[target_feature]`
.label = `start` is not allowed to have `#[target_feature]`
2023-02-24 20:23:30 +00:00
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
2023-02-28 05:59:54 +00:00
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
2023-02-25 17:26:48 +00:00
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}`
2023-03-07 22:26:52 +00:00
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<...>`
2023-03-11 04:10:09 +00:00
hir_analysis_return_type_notation_on_non_rpitit =
return type notation used on function that is not `async` and does not return `impl Trait`
.note = function returns `{$ty}`, which is not compatible with associated type return bounds
.label = this function must be `async` or return `impl Trait`
hir_analysis_return_type_notation_equality_bound =
return type notation is not allowed to use type equality
hir_analysis_return_type_notation_missing_method =
cannot find associated function `{$assoc_name}` in trait `{$trait_name}`
2023-04-06 23:04:42 +00:00
hir_analysis_placeholder_not_allowed_item_signatures = the placeholder `_` is not allowed within types on item signatures for {$kind}
.label = not allowed in type signatures
hir_analysis_associated_type_trait_uninferred_generic_params = cannot use the associated type of a trait with uninferred generic parameters
.suggestion = use a fully qualified path with inferred lifetimes
hir_analysis_associated_type_trait_uninferred_generic_params_multipart_suggestion = use a fully qualified path with explicit lifetimes
hir_analysis_enum_discriminant_overflowed = enum discriminant overflowed
.label = overflowed on value after {$discr}
.note = explicitly set `{$item_name} = {$wrapped_discr}` if that is desired outcome
hir_analysis_paren_sugar_attribute = the `#[rustc_paren_sugar]` attribute is a temporary means of controlling which traits can use parenthetical notation
.help = add `#![feature(unboxed_closures)]` to the crate attributes to use it
hir_analysis_must_implement_one_of_attribute = the `#[rustc_must_implement_one_of]` attribute must be used with at least 2 args
hir_analysis_must_be_name_of_associated_function = must be a name of an associated function
hir_analysis_function_not_have_default_implementation = function doesn't have a default implementation
.note = required by this annotation
hir_analysis_must_implement_not_function = not a function
hir_analysis_must_implement_not_function_span_note = required by this annotation
hir_analysis_must_implement_not_function_note = all `#[rustc_must_implement_one_of]` arguments must be associated function names
hir_analysis_function_not_found_in_trait = function not found in this trait
hir_analysis_functions_names_duplicated = functions names are duplicated
.note = all `#[rustc_must_implement_one_of]` arguments must be unique
hir_analysis_simd_ffi_highly_experimental = use of SIMD type{$snip} in FFI is highly experimental and may result in invalid code
.help = add `#![feature(simd_ffi)]` to the crate attributes to enable
2023-04-14 15:02:41 +00:00
hir_analysis_impl_not_marked_default = `{$ident}` specializes an item from a parent `impl`, but that item is not marked `default`
.label = cannot specialize default item `{$ident}`
.ok_label = parent `impl` is here
.note = to specialize, `{$ident}` in the parent `impl` must be marked `default`
hir_analysis_impl_not_marked_default_err = `{$ident}` specializes an item from a parent `impl`, but that item is not marked `default`
.note = parent implementation is in crate `{$cname}`
hir_analysis_missing_trait_item = not all trait items implemented, missing: `{$missing_items_msg}`
.label = missing `{$missing_items_msg}` in implementation
hir_analysis_missing_trait_item_suggestion = implement the missing item: `{$snippet}`
hir_analysis_missing_trait_item_label = `{$item}` from trait
hir_analysis_missing_one_of_trait_item = not all trait items implemented, missing one of: `{$missing_items_msg}`
.label = missing one of `{$missing_items_msg}` in implementation
.note = required because of this annotation
hir_analysis_missing_trait_item_unstable = not all trait items implemented, missing: `{$missing_item_name}`
.note = default implementation of `{$missing_item_name}` is unstable
.some_note = use of unstable library feature '{$feature}': {$r}
.none_note = use of unstable library feature '{$feature}'
hir_analysis_transparent_enum_variant = transparent enum needs exactly one variant, but has {$number}
.label = needs exactly one variant, but has {$number}
.many_label = too many variants in `{$path}`
.multi_label = variant here
hir_analysis_transparent_non_zero_sized_enum = the variant of a transparent {$desc} needs at most one non-zero-sized field, but has {$field_count}
.label = needs at most one non-zero-sized field, but has {$field_count}
.labels = this field is non-zero-sized
hir_analysis_transparent_non_zero_sized = transparent {$desc} needs at most one non-zero-sized field, but has {$field_count}
.label = needs at most one non-zero-sized field, but has {$field_count}
.labels = this field is non-zero-sized
2023-04-10 15:04:14 +00:00
hir_analysis_too_large_static = extern static is too large for the current architecture
hir_analysis_specialization_trait = implementing `rustc_specialization_trait` traits is unstable
.help = add `#![feature(min_specialization)]` to the crate attributes to enable
hir_analysis_closure_implicit_hrtb = implicit types in closure signatures are forbidden when `for<...>` is present
.label = `for<...>` is here
hir_analysis_const_specialize = cannot specialize on const impl with non-const impl
hir_analysis_static_specialize = cannot specialize on `'static` lifetime
hir_analysis_missing_tilde_const = missing `~const` qualifier for specialization