Rust: Allocation::bytes should be private

Created on 24 Jul 2019  路  2Comments  路  Source: rust-lang/rust

The bytes field of an Allocation is a very subtle one -- the values in there often do not mean what one might intuitively think. First of all the doc comment should probably be improved, but secondly I think we need to make this field private. See https://github.com/rust-lang/rust/pull/62655#discussion_r306753992 for a very subtle bug that happened because it was not private.

Cc @oli-obk @eddyb

T-compiler

Most helpful comment

unrelocated_raw_maybe_initialized_bytes_dont_touch

All 2 comments

Might also help to rename it to something like unrelocated_bytes.

unrelocated_raw_maybe_initialized_bytes_dont_touch

Was this page helpful?
0 / 5 - 0 ratings