Auto merge of #86475 - crlf0710:miri_vtable_refactor, r=bjorn3

Change vtable memory representation to use tcx allocated allocations.

This fixes https://github.com/rust-lang/rust/issues/86324. However i suspect there's more to change before it can land.

r? `@bjorn3`
cc `@rust-lang/miri`
This commit is contained in:
bors 2021-06-29 15:52:21 +00:00
commit e98897e5dc
21 changed files with 151 additions and 250 deletions

View file

@ -10,7 +10,7 @@ LL | | };
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 8, align: 4) {
╾─alloc2──╼ ╾─alloc3──╼ │ ╾──╼╾──╼
╾─alloc2──╼ ╾─alloc5──╼ │ ╾──╼╾──╼
}
error: aborting due to previous error

View file

@ -10,7 +10,7 @@ LL | | };
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 16, align: 8) {
╾───────alloc2────────╼ ╾───────alloc3────────╼ │ ╾──────╼╾──────╼
╾───────alloc2────────╼ ╾───────alloc5────────╼ │ ╾──────╼╾──────╼
}
error: aborting due to previous error

View file

@ -6,7 +6,7 @@ LL | const G: Fat = unsafe { Transmute { t: FOO }.u };
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 16, align: 8) {
╾───────alloc2────────╼ ╾───────alloc3────────╼ │ ╾──────╼╾──────╼
╾───────alloc2────────╼ ╾───────alloc5────────╼ │ ╾──────╼╾──────╼
}
error: aborting due to previous error

View file

@ -19,7 +19,7 @@ LL | const SNEAKY: &dyn Sync = &Synced { x: UnsafeCell::new(42) };
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 8, align: 4) {
╾─alloc6──╼ ╾─alloc7──╼ │ ╾──╼╾──╼
╾─alloc6──╼ ╾─alloc8──╼ │ ╾──╼╾──╼
}
error[E0080]: it is undefined behavior to use this value

View file

@ -19,7 +19,7 @@ LL | const SNEAKY: &dyn Sync = &Synced { x: UnsafeCell::new(42) };
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 16, align: 8) {
╾───────alloc6────────╼ ╾───────alloc7────────╼ │ ╾──────╼╾──────╼
╾───────alloc6────────╼ ╾───────alloc8────────╼ │ ╾──────╼╾──────╼
}
error[E0080]: it is undefined behavior to use this value