Attempting to transmute between two of the same associated type results in an error. #49793
Labels
A-associated-items
Area: Associated items (types, constants & functions)
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
While attempting to store a set of values that differ in type but not layout together in a collection, I discovered that the following code, strangely, results in E0512 ("transmute called with types of different sizes").
Here is the exact error message produced:
Either I'm missing something extremely subtle and non-intuitive here, or this a bug or blindspot of the compiler. If it is anything but an easily fixable bug, I would suggest that a special error message be added for this case in the meantime, as the current one is rather confusing.
Output of
rustc --version --verbose
:The text was updated successfully, but these errors were encountered: