Skip to content

[macros] Support shrinking value transmutes #2570

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

joshlf
Copy link
Member

@joshlf joshlf commented Jun 6, 2025

In transmute!, support an #![allow(shrink)] attribute which is
invoked as follows:

transmute!(#![allow(shrink)] src);

When this attribute is provided, transmute! will permit shrinking
transmutes, in which the destination value may be smaller than the
source value.


This PR is on branch transmute-ref-dst.

@joshlf joshlf force-pushed the I10874e2bc703fb6b7fcdea050b8971de869a850a branch from 6d1c83d to e8ec635 Compare June 9, 2025 17:13
@joshlf joshlf force-pushed the I46b18b4b1d10507b7e1d2e01b09dc4960cfcdce1 branch from 90c0f6c to abd185a Compare June 9, 2025 17:13
@joshlf joshlf force-pushed the I10874e2bc703fb6b7fcdea050b8971de869a850a branch from e8ec635 to 706fcd7 Compare June 9, 2025 17:39
@joshlf joshlf force-pushed the I46b18b4b1d10507b7e1d2e01b09dc4960cfcdce1 branch from abd185a to 8791f83 Compare June 9, 2025 17:39
@joshlf joshlf force-pushed the I10874e2bc703fb6b7fcdea050b8971de869a850a branch from 706fcd7 to 44126b5 Compare June 9, 2025 17:44
@joshlf joshlf force-pushed the I46b18b4b1d10507b7e1d2e01b09dc4960cfcdce1 branch 2 times, most recently from 081ba1d to 0ecd08b Compare June 9, 2025 18:12
@joshlf joshlf force-pushed the I10874e2bc703fb6b7fcdea050b8971de869a850a branch from 44126b5 to 260e2e3 Compare June 9, 2025 18:12
@joshlf joshlf force-pushed the I46b18b4b1d10507b7e1d2e01b09dc4960cfcdce1 branch from 0ecd08b to d25d4fc Compare June 9, 2025 18:15
@joshlf joshlf force-pushed the I10874e2bc703fb6b7fcdea050b8971de869a850a branch from 184dbb5 to 18a049a Compare June 9, 2025 18:22
@joshlf joshlf force-pushed the I46b18b4b1d10507b7e1d2e01b09dc4960cfcdce1 branch from d25d4fc to 3517fc2 Compare June 9, 2025 18:22
@joshlf joshlf force-pushed the I10874e2bc703fb6b7fcdea050b8971de869a850a branch from 18a049a to cd0c968 Compare June 9, 2025 18:43
@joshlf joshlf force-pushed the I46b18b4b1d10507b7e1d2e01b09dc4960cfcdce1 branch from 3517fc2 to 43c69f1 Compare June 9, 2025 18:43
@joshlf joshlf force-pushed the I10874e2bc703fb6b7fcdea050b8971de869a850a branch from cd0c968 to 10e1604 Compare June 9, 2025 19:11
@joshlf joshlf force-pushed the I46b18b4b1d10507b7e1d2e01b09dc4960cfcdce1 branch from 43c69f1 to 370763d Compare June 9, 2025 19:11
@joshlf joshlf force-pushed the I10874e2bc703fb6b7fcdea050b8971de869a850a branch from 10e1604 to d494109 Compare June 9, 2025 19:12
@joshlf joshlf force-pushed the I46b18b4b1d10507b7e1d2e01b09dc4960cfcdce1 branch from 370763d to f625d09 Compare June 9, 2025 19:12
@joshlf joshlf merged commit 0dc4ac5 into I10874e2bc703fb6b7fcdea050b8971de869a850a Jun 9, 2025
@joshlf joshlf force-pushed the I10874e2bc703fb6b7fcdea050b8971de869a850a branch from d494109 to 67b20da Compare June 9, 2025 19:18
@joshlf joshlf deleted the I46b18b4b1d10507b7e1d2e01b09dc4960cfcdce1 branch June 9, 2025 19:18
@joshlf joshlf force-pushed the I46b18b4b1d10507b7e1d2e01b09dc4960cfcdce1 branch from f625d09 to 0dc4ac5 Compare June 9, 2025 19:18
@joshlf joshlf restored the I46b18b4b1d10507b7e1d2e01b09dc4960cfcdce1 branch June 9, 2025 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant