about summary refs log tree commit diff
path: root/library/std/src/sys/unix/stack_overflow.rs
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2022-02-17 06:30:03 +0100
committerGitHub <noreply@github.com>2022-02-17 06:30:03 +0100
commit91f70a8fdf3f39895d72d0b117722cff141015cf (patch)
treeccaaa34f4d90c69405044438597124a1a7861b42 /library/std/src/sys/unix/stack_overflow.rs
parenta1a750b5adce06fc77b22ee32eecd7c83ad2d090 (diff)
parent6d2cdbec3ef6e5460753986372ed898a1b3bc553 (diff)
downloadrust-91f70a8fdf3f39895d72d0b117722cff141015cf.tar.gz
rust-91f70a8fdf3f39895d72d0b117722cff141015cf.zip
Rollup merge of #94031 - danielhenrymantilla:diagnostics/union-drop-suggest-copy-bound-alternative, r=davidtwco
[diagnostics] Add mentions to `Copy` types being valid for `union` fields

This came up from some user on Discord which was using a `T : PrimitiveInt` generic type, and they wanted to use in a `union`. Rather than adding a `Copy` bound, they started pondering about the `ManuallyDrop<T>` road, and how to correctly use `unsafe` to perform the drops.

<img width="648" alt="Screen Shot 2022-02-15 at 22 28 34" src="https://user-images.githubusercontent.com/9920355/154152496-8f9be74b-ad59-4724-8f9e-48b446774e06.png">

  - [Discord link](https://discord.com/channels/442252698964721669/443150878111694848/943092778534072320)

So, it seemed like the error message for types with potential drop glue on `union` fields could be improved to also mention the `Copy` alternative, since in many cases where `union`s are concerned, people are dealing with PODs / `Copy` types anyways 🙂

___

``@rustbot`` modify labels: +A-diagnostics +D-terse
Diffstat (limited to 'library/std/src/sys/unix/stack_overflow.rs')
0 files changed, 0 insertions, 0 deletions