Cleanup: Fix up some diagnostics
This commit is contained in:
parent
791adf759c
commit
ae49dbe707
12 changed files with 57 additions and 47 deletions
|
@ -104,10 +104,10 @@ infer_compare_impl_item_obligation = ...so that the definition in impl matches t
|
|||
infer_consider_specifying_length = consider specifying the actual array length
|
||||
infer_data_flows = ...but data{$label_var1_exists ->
|
||||
[true] {" "}from `{$label_var1}`
|
||||
*[false] -> {""}
|
||||
*[false] {""}
|
||||
} flows{$label_var2_exists ->
|
||||
[true] {" "}into `{$label_var2}`
|
||||
*[false] -> {""}
|
||||
*[false] {""}
|
||||
} here
|
||||
|
||||
infer_data_lifetime_flow = ...but data with one lifetime flows into the other here
|
||||
|
|
|
@ -627,7 +627,7 @@ lint_pattern_in_foreign = patterns aren't allowed in foreign function declaratio
|
|||
.label = pattern not allowed in foreign function
|
||||
|
||||
lint_private_extern_crate_reexport =
|
||||
extern crate `{$ident}` is private, and cannot be re-exported (error E0365), consider declaring with `pub`
|
||||
extern crate `{$ident}` is private, and cannot be re-exported, consider declaring with `pub`
|
||||
|
||||
lint_proc_macro_back_compat = using an old version of `{$crate_name}`
|
||||
.note = older versions of the `{$crate_name}` crate will stop compiling in future versions of Rust; please update to `{$crate_name}` v{$fixed_version}, or switch to one of the `{$crate_name}` alternatives
|
||||
|
|
|
@ -2227,7 +2227,7 @@ pub struct MacroUseDeprecated;
|
|||
pub struct UnusedMacroUse;
|
||||
|
||||
#[derive(LintDiagnostic)]
|
||||
#[diag(lint_private_extern_crate_reexport)]
|
||||
#[diag(lint_private_extern_crate_reexport, code = E0365)]
|
||||
pub struct PrivateExternCrateReexport {
|
||||
pub ident: Ident,
|
||||
}
|
||||
|
|
|
@ -335,12 +335,12 @@ mir_build_unsafe_fn_safe_body = an unsafe function restricts its caller, but its
|
|||
mir_build_unsafe_not_inherited = items do not inherit unsafety from separate enclosing items
|
||||
|
||||
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)
|
||||
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_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)
|
||||
call to function `{$function}` with `#[target_feature]` is unsafe and requires unsafe block
|
||||
.help = in order for the call to be safe, the context requires the following additional target {$missing_target_features_count ->
|
||||
[1] feature
|
||||
*[count] features
|
||||
|
@ -355,48 +355,47 @@ mir_build_unsafe_op_in_unsafe_fn_call_to_fn_with_requires_unsafe =
|
|||
.label = call to function with `#[target_feature]`
|
||||
|
||||
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)
|
||||
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_unsafe_op_in_unsafe_fn_call_to_unsafe_fn_requires_unsafe_nameless =
|
||||
call to unsafe function is unsafe and requires unsafe block (error E0133)
|
||||
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_unsafe_op_in_unsafe_fn_deref_raw_pointer_requires_unsafe =
|
||||
dereference of raw pointer is unsafe and requires unsafe block (error E0133)
|
||||
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_unsafe_op_in_unsafe_fn_extern_static_requires_unsafe =
|
||||
use of extern static is unsafe and requires unsafe block (error E0133)
|
||||
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_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)
|
||||
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_unsafe_op_in_unsafe_fn_inline_assembly_requires_unsafe =
|
||||
use of inline assembly is unsafe and requires unsafe block (error E0133)
|
||||
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_unsafe_op_in_unsafe_fn_mutable_static_requires_unsafe =
|
||||
use of mutable static is unsafe and requires unsafe block (error E0133)
|
||||
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_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)
|
||||
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_unsafe_op_in_unsafe_fn_union_field_requires_unsafe =
|
||||
access to union field is unsafe and requires unsafe block (error E0133)
|
||||
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
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ pub struct UnconditionalRecursion {
|
|||
}
|
||||
|
||||
#[derive(LintDiagnostic)]
|
||||
#[diag(mir_build_unsafe_op_in_unsafe_fn_call_to_unsafe_fn_requires_unsafe)]
|
||||
#[diag(mir_build_unsafe_op_in_unsafe_fn_call_to_unsafe_fn_requires_unsafe, code = E0133)]
|
||||
#[note]
|
||||
pub struct UnsafeOpInUnsafeFnCallToUnsafeFunctionRequiresUnsafe {
|
||||
#[label]
|
||||
|
@ -32,7 +32,7 @@ pub struct UnsafeOpInUnsafeFnCallToUnsafeFunctionRequiresUnsafe {
|
|||
}
|
||||
|
||||
#[derive(LintDiagnostic)]
|
||||
#[diag(mir_build_unsafe_op_in_unsafe_fn_call_to_unsafe_fn_requires_unsafe_nameless)]
|
||||
#[diag(mir_build_unsafe_op_in_unsafe_fn_call_to_unsafe_fn_requires_unsafe_nameless, code = E0133)]
|
||||
#[note]
|
||||
pub struct UnsafeOpInUnsafeFnCallToUnsafeFunctionRequiresUnsafeNameless {
|
||||
#[label]
|
||||
|
@ -42,7 +42,7 @@ pub struct UnsafeOpInUnsafeFnCallToUnsafeFunctionRequiresUnsafeNameless {
|
|||
}
|
||||
|
||||
#[derive(LintDiagnostic)]
|
||||
#[diag(mir_build_unsafe_op_in_unsafe_fn_inline_assembly_requires_unsafe)]
|
||||
#[diag(mir_build_unsafe_op_in_unsafe_fn_inline_assembly_requires_unsafe, code = E0133)]
|
||||
#[note]
|
||||
pub struct UnsafeOpInUnsafeFnUseOfInlineAssemblyRequiresUnsafe {
|
||||
#[label]
|
||||
|
@ -52,7 +52,7 @@ pub struct UnsafeOpInUnsafeFnUseOfInlineAssemblyRequiresUnsafe {
|
|||
}
|
||||
|
||||
#[derive(LintDiagnostic)]
|
||||
#[diag(mir_build_unsafe_op_in_unsafe_fn_initializing_type_with_requires_unsafe)]
|
||||
#[diag(mir_build_unsafe_op_in_unsafe_fn_initializing_type_with_requires_unsafe, code = E0133)]
|
||||
#[note]
|
||||
pub struct UnsafeOpInUnsafeFnInitializingTypeWithRequiresUnsafe {
|
||||
#[label]
|
||||
|
@ -62,7 +62,7 @@ pub struct UnsafeOpInUnsafeFnInitializingTypeWithRequiresUnsafe {
|
|||
}
|
||||
|
||||
#[derive(LintDiagnostic)]
|
||||
#[diag(mir_build_unsafe_op_in_unsafe_fn_mutable_static_requires_unsafe)]
|
||||
#[diag(mir_build_unsafe_op_in_unsafe_fn_mutable_static_requires_unsafe, code = E0133)]
|
||||
#[note]
|
||||
pub struct UnsafeOpInUnsafeFnUseOfMutableStaticRequiresUnsafe {
|
||||
#[label]
|
||||
|
@ -72,7 +72,7 @@ pub struct UnsafeOpInUnsafeFnUseOfMutableStaticRequiresUnsafe {
|
|||
}
|
||||
|
||||
#[derive(LintDiagnostic)]
|
||||
#[diag(mir_build_unsafe_op_in_unsafe_fn_extern_static_requires_unsafe)]
|
||||
#[diag(mir_build_unsafe_op_in_unsafe_fn_extern_static_requires_unsafe, code = E0133)]
|
||||
#[note]
|
||||
pub struct UnsafeOpInUnsafeFnUseOfExternStaticRequiresUnsafe {
|
||||
#[label]
|
||||
|
@ -82,7 +82,7 @@ pub struct UnsafeOpInUnsafeFnUseOfExternStaticRequiresUnsafe {
|
|||
}
|
||||
|
||||
#[derive(LintDiagnostic)]
|
||||
#[diag(mir_build_unsafe_op_in_unsafe_fn_deref_raw_pointer_requires_unsafe)]
|
||||
#[diag(mir_build_unsafe_op_in_unsafe_fn_deref_raw_pointer_requires_unsafe, code = E0133)]
|
||||
#[note]
|
||||
pub struct UnsafeOpInUnsafeFnDerefOfRawPointerRequiresUnsafe {
|
||||
#[label]
|
||||
|
@ -92,7 +92,7 @@ pub struct UnsafeOpInUnsafeFnDerefOfRawPointerRequiresUnsafe {
|
|||
}
|
||||
|
||||
#[derive(LintDiagnostic)]
|
||||
#[diag(mir_build_unsafe_op_in_unsafe_fn_union_field_requires_unsafe)]
|
||||
#[diag(mir_build_unsafe_op_in_unsafe_fn_union_field_requires_unsafe, code = E0133)]
|
||||
#[note]
|
||||
pub struct UnsafeOpInUnsafeFnAccessToUnionFieldRequiresUnsafe {
|
||||
#[label]
|
||||
|
@ -102,7 +102,10 @@ pub struct UnsafeOpInUnsafeFnAccessToUnionFieldRequiresUnsafe {
|
|||
}
|
||||
|
||||
#[derive(LintDiagnostic)]
|
||||
#[diag(mir_build_unsafe_op_in_unsafe_fn_mutation_of_layout_constrained_field_requires_unsafe)]
|
||||
#[diag(
|
||||
mir_build_unsafe_op_in_unsafe_fn_mutation_of_layout_constrained_field_requires_unsafe,
|
||||
code = E0133
|
||||
)]
|
||||
#[note]
|
||||
pub struct UnsafeOpInUnsafeFnMutationOfLayoutConstrainedFieldRequiresUnsafe {
|
||||
#[label]
|
||||
|
@ -112,7 +115,10 @@ pub struct UnsafeOpInUnsafeFnMutationOfLayoutConstrainedFieldRequiresUnsafe {
|
|||
}
|
||||
|
||||
#[derive(LintDiagnostic)]
|
||||
#[diag(mir_build_unsafe_op_in_unsafe_fn_borrow_of_layout_constrained_field_requires_unsafe)]
|
||||
#[diag(
|
||||
mir_build_unsafe_op_in_unsafe_fn_borrow_of_layout_constrained_field_requires_unsafe,
|
||||
code = E0133,
|
||||
)]
|
||||
pub struct UnsafeOpInUnsafeFnBorrowOfLayoutConstrainedFieldRequiresUnsafe {
|
||||
#[label]
|
||||
pub span: Span,
|
||||
|
@ -121,7 +127,7 @@ pub struct UnsafeOpInUnsafeFnBorrowOfLayoutConstrainedFieldRequiresUnsafe {
|
|||
}
|
||||
|
||||
#[derive(LintDiagnostic)]
|
||||
#[diag(mir_build_unsafe_op_in_unsafe_fn_call_to_fn_with_requires_unsafe)]
|
||||
#[diag(mir_build_unsafe_op_in_unsafe_fn_call_to_fn_with_requires_unsafe, code = E0133)]
|
||||
#[help]
|
||||
pub struct UnsafeOpInUnsafeFnCallToFunctionWithRequiresUnsafe {
|
||||
#[label]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue