Miri: make size/align_of_val work for dangling raw ptrs#80491
Miri: make size/align_of_val work for dangling raw ptrs#80491bors merged 2 commits intorust-lang:masterfrom
Conversation
|
Is this testable within this repo or do we need miri for it? r=me with a test if possible |
|
Good point, I added a test. @bors r=oli-obk |
|
📌 Commit f76bae9 has been approved by |
Rollup of 9 pull requests Successful merges: - rust-lang#78934 (refactor: removing library/alloc/src/vec/mod.rs ignore-tidy-filelength) - rust-lang#79479 (Add `Iterator::intersperse`) - rust-lang#80128 (Edit rustc_ast::ast::FieldPat docs) - rust-lang#80424 (Don't give an error when creating a file for the first time) - rust-lang#80458 (Some Promotion Refactoring) - rust-lang#80488 (Do not create dangling &T in Weak<T>::drop) - rust-lang#80491 (Miri: make size/align_of_val work for dangling raw ptrs) - rust-lang#80495 (Rename kw::Invalid -> kw::Empty) - rust-lang#80513 (Add regression test for rust-lang#80062) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
|
Is that a guarantee that we will want to make going forward? I tried to create a It's unclear whether this is a restriction that will stay, or not. If it doesn't, however, then As such, it seems that if we wish to keep our options open regarding the conversion from DST to trait, then we should enforce that |
The guarantee is what is documented for I think Miri also implements the rest of those docs correctly, but if there's a bug, please let me know. Note the last clause in the documentation:
Currently, this is impossible to reach (there are no other kinds of DST), but that is not a stable assumptions -- so if one has no clue what the unsized tail is, one has to use |
This is needed for #80365 (comment).
r? @oli-obk