Skip to content

Translate transmutes.md #37

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

Merged
merged 12 commits into from
Jun 23, 2020
Merged

Conversation

toku-sa-n
Copy link
Contributor

No description provided.

The first "transmute" refers to transmute function, not the actual
transmuting.
This description means that it is possible to copy the first part of the
value type `T`.
Copy link
Member

@imsut imsut left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

overall lgtm. let me know what you think about the two minor suggestions.

Comment on lines 18 to 19
いくら強調しようとも、強調しきれません。これは本当に、マジで、 Rust で出来る
最も恐ろしいアンセーフなことです。ここではガードレールは爪楊枝のようなものです。
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Just a quick idea to make "dental floss" analogy clearer:
ここではガードレールは爪楊枝のように脆いです。

Curious to know your thoughts.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍
It's easier to understand what the statement means.


`mem::transmute<T, U>` は型 `T` の値を受け取り、その値が型 `U` であると再解釈します。
唯一の制約は、 `T` と `U` が同じサイズを持つとされていることです。
この操作によって未定義動作が起こる方法には気が遠くなります。
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

この操作によって未定義動作が起こる方法を考えると、気が遠くなります。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@imsut imsut merged commit e7c83ee into rust-lang-ja:master Jun 23, 2020
@toku-sa-n toku-sa-n deleted the translate_transmutes branch June 23, 2020 14:39
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.

2 participants