Update repr-rust.md

pull/464/head
nomicon-kr 10 months ago committed by GitHub
parent 677e8d84e4
commit 24d0f4677e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -126,9 +126,7 @@ struct FooRepr {
하나의 `()`을 가진 형(예를 들어 `None`)과 (중첩될 수도 있는) 널이 될 수 없는 포인터를 가진 형(예를 들어 `Some(&T)`)이 있는 열거형은 태그가 필요하지 않습니다. 널 포인터는 안전하게 `()` 형(`None`)으로 해석할 수 있거든요. 하나의 `()`을 가진 형(예를 들어 `None`)과 (중첩될 수도 있는) 널이 될 수 없는 포인터를 가진 형(예를 들어 `Some(&T)`)이 있는 열거형은 태그가 필요하지 않습니다. 널 포인터는 안전하게 `()` 형(`None`)으로 해석할 수 있거든요.
최종적인 결과는, 예를 들어, 이랗게 됩니다: `size_of::<Option<&T>>() == size_of::<&T>()` 최종적인 결과는, 예를 들어, 이랗게 됩니다: `size_of::<Option<&T>>() == size_of::<&T>()`
러스트에는 널이 될 수 없는 타입이나, 이를 포함하는 타입들이 많이 있는데, `Box<T>`, `Vec<T>`, `String`, `&T`, 그리고 `&mut T` 같은 것들입니다. 러스트에는 널이 될 수 없는 타입이나, 이를 포함하는 타입들이 많이 있는데, `Box<T>`, `Vec<T>`, `String`, `&T`, 그리고 `&mut T` 같은 것들입니다. Similarly, one can imagine
Similarly, one can imagine
nested enums pooling their tags into a single discriminant, as they are by nested enums pooling their tags into a single discriminant, as they are by
definition known to have a limited range of valid values. In principle enums could definition known to have a limited range of valid values. In principle enums could
use fairly elaborate algorithms to store bits throughout nested types with use fairly elaborate algorithms to store bits throughout nested types with

Loading…
Cancel
Save