about summary refs log tree commit diff
path: root/compiler/rustc_lint/messages.ftl
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-02-13 00:31:53 +0000
committerbors <bors@rust-lang.org>2024-02-13 00:31:53 +0000
commit0a5b998c57a8681acc13206b5917340b053b3a30 (patch)
treed673efacffd4baf86b67a6d9e2e511a1d2db8888 /compiler/rustc_lint/messages.ftl
parent74c3f5a146860c94ff4d179fc3bfa34f879adf41 (diff)
parent8a87cdacb15d4856e60388d456449158e3f542b6 (diff)
downloadrust-0a5b998c57a8681acc13206b5917340b053b3a30.tar.gz
rust-0a5b998c57a8681acc13206b5917340b053b3a30.zip
Auto merge of #120991 - matthiaskrgr:rollup-f8kw2st, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #118983 (Warn on references casting to bigger memory layout)
 - #119451 (Gate PR CI on clippy correctness lints)
 - #120273 (compiletest: few naive improvements)
 - #120950 (Fix async closures in CTFE)
 - #120958 (Dejargonize `subst`)
 - #120965 (Add lahfsahf and prfchw target feature)
 - #120970 (add another test for promoteds-in-static)
 - #120979 (Update books)

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_lint/messages.ftl')
-rw-r--r--compiler/rustc_lint/messages.ftl5
1 files changed, 5 insertions, 0 deletions
diff --git a/compiler/rustc_lint/messages.ftl b/compiler/rustc_lint/messages.ftl
index 5652a34103b..785895e0ab8 100644
--- a/compiler/rustc_lint/messages.ftl
+++ b/compiler/rustc_lint/messages.ftl
@@ -319,6 +319,11 @@ lint_invalid_nan_comparisons_lt_le_gt_ge = incorrect NaN comparison, NaN is not
 lint_invalid_reference_casting_assign_to_ref = assigning to `&T` is undefined behavior, consider using an `UnsafeCell`
     .label = casting happend here
 
+lint_invalid_reference_casting_bigger_layout = casting references to a bigger memory layout than the backing allocation is undefined behavior, even if the reference is unused
+    .label = casting happend here
+    .alloc = backing allocation comes from here
+    .layout = casting from `{$from_ty}` ({$from_size} bytes) to `{$to_ty}` ({$to_size} bytes)
+
 lint_invalid_reference_casting_borrow_as_mut = casting `&T` to `&mut T` is undefined behavior, even if the reference is unused, consider instead using an `UnsafeCell`
     .label = casting happend here