Skip to content

Commit a6ab54b

Browse files
committedAug 1, 2022
Change comment to mention vtable
1 parent eb1b384 commit a6ab54b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed
 

‎compiler/rustc_middle/src/ty/layout.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -3559,11 +3559,11 @@ where
35593559
// which acts much like a [u8].
35603560
//
35613561
// We *do* need to panic for &dyn Trait, even though the layout of dyn Trait is
3562-
// size 0 align 1, because &dyn Trait holds a reference to a non-zero sized type,
3563-
// which also must be aligned.
3562+
// size 0 align 1, because &dyn Trait holds a reference to the vtable, which
3563+
// must be aligned and dereferenceable.
35643564
//
3565-
// This even applies to *const dyn Trait, which holds a reference and therefore
3566-
// must be valid, so 1-initialization is not okay there.
3565+
// This even applies to *const dyn Trait, which holds a reference to the vtable
3566+
// and therefore must be valid, so 1-initialization is not okay there.
35673567
//
35683568
// If this bypass didn't exist, old versions of `hyper` with no semver compatible
35693569
// fix (0.11, 0.12, 0.13) would panic, as they make uninit &[u8] and &str.

0 commit comments

Comments
 (0)
Please sign in to comment.