diff options
| author | Michael Goulet <michael@errs.io> | 2025-05-25 15:05:22 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2025-05-25 15:57:48 +0000 |
| commit | 5370c5753f3f769d27832f81ceefd4141ba1ee0c (patch) | |
| tree | a274043429f8a7f039a6d1c512071237471cfbfb /compiler/rustc_lint/messages.ftl | |
| parent | a8ae2af9670635a9138429ccba1ffb76787afbb1 (diff) | |
| download | rust-5370c5753f3f769d27832f81ceefd4141ba1ee0c.tar.gz rust-5370c5753f3f769d27832f81ceefd4141ba1ee0c.zip | |
Make PTR_TO_INTEGER_TRANSMUTE_IN_CONSTS into a HIR lint
Diffstat (limited to 'compiler/rustc_lint/messages.ftl')
| -rw-r--r-- | compiler/rustc_lint/messages.ftl | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/compiler/rustc_lint/messages.ftl b/compiler/rustc_lint/messages.ftl index 7fdf26bf3af..9bef1c5b877 100644 --- a/compiler/rustc_lint/messages.ftl +++ b/compiler/rustc_lint/messages.ftl @@ -805,6 +805,11 @@ lint_type_ir_inherent_usage = do not use `rustc_type_ir::inherent` unless you're lint_type_ir_trait_usage = do not use `rustc_type_ir::Interner` or `rustc_type_ir::InferCtxtLike` unless you're inside of the trait solver .note = the method or struct you're looking for is likely defined somewhere else downstream in the compiler +lint_undefined_transmute = pointers cannot be transmuted to integers during const eval + .note = at compile-time, pointers do not have an integer value + .note2 = avoiding this restriction via `union` or raw pointers leads to compile-time undefined behavior + .help = for more information, see https://doc.rust-lang.org/std/mem/fn.transmute.html + lint_undropped_manually_drops = calls to `std::mem::drop` with `std::mem::ManuallyDrop` instead of the inner value does nothing .label = argument has type `{$arg_ty}` .suggestion = use `std::mem::ManuallyDrop::into_inner` to get the inner value |
