about summary refs log tree commit diff
path: root/src/libstd/sys/windows/stack_overflow.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2015-08-04 22:55:31 +0000
committerbors <bors@rust-lang.org>2015-08-04 22:55:31 +0000
commitefdbc0ec7e9bd8d2dadbe78b003fd7facf2a7aae (patch)
treee695c4896a1505db71cf37d181d4e58a8962df26 /src/libstd/sys/windows/stack_overflow.rs
parent6afb8f58d18311109081cfaff2fa5a02948989c3 (diff)
parent21be09448b21c25570f28ddd597f3d30ccc6fabf (diff)
downloadrust-efdbc0ec7e9bd8d2dadbe78b003fd7facf2a7aae.tar.gz
rust-efdbc0ec7e9bd8d2dadbe78b003fd7facf2a7aae.zip
Auto merge of #27351 - pnkfelix:dst-size-and-align-issue-27023, r=nikomatsakis
Change the behavior of the glue code emitted for `size_and_align_of_dst`.

This thus changes the behavior of `std::mem::size_of_val` and `std::mem::align_of_val`.  It tries to move us towards a world where the following property holds:

Given type `T` implements `Trait` and a value `b: Box<T>`, where `std::mem::size_of::<T>()` returns `k`, then:

 * `std::mem::size_of_val(b)` returns `k`
 * `std::mem::size_of_val(b as Box<Trait>)` returns `k`

Note that one might legitimately question whether the above property *should* hold.  The property certainly does not hold today, as illustrated by #27023.

(A follow-up task is to make various tests that check that the above property holds for a wide variety of types ... I chose not to invest effort in writing such a test before we actually determine that the above property is desirable.)

nmatsakis and pnkfelix agree that this PR does not require an RFC.  cc @rust-lang/lang (since others may disagree).

(It also *might* break code, though it is hard for me to imagine that it could break code that wasn't already going to assert-fail when run in e.g. debug builds...)

Fix issue #27023

Also, this (or something like it) is a prerequisite for *fixing`make check` on `--enable-optimize --enable-debug` builds*
Diffstat (limited to 'src/libstd/sys/windows/stack_overflow.rs')
0 files changed, 0 insertions, 0 deletions