Uh oh!
There was an error while loading. Please reload this page.
CTFE Machine: do not expose Allocation - #85472
Conversation
rust-highfive
commented
May 19, 2021
Some changes occured to the CTFE / Miri engine cc @rust-lang/miri |
oli-obk
commented
May 19, 2021
It would be fairly easy to write a lint that ensures that there are no Allocations in public parts of memory.rs or in the Machine trait. Is this something you think could be useful? |
RalfJung
commented
May 19, 2021
I guess? Honestly I am not sure if it's worth it, it's also not that hard to audit this manually.^^ What I am much more worried about is code inside |
oli-obk
commented
May 19, 2021
OK, no lint then. About the raw functions. They could return a wrapper type that requires you to properly do checks before getting access to things. Not sure if that is possible in all cases, but we could always have the checks return token types that the actual access consumes, paired with long-named constructors for these token types so you can |
oli-obk
commented
May 19, 2021
Anyway, this PR is good @bors r+ rollup |
bors
commented
May 19, 2021
📌 Commit 50a9f00 has been approved by |
RalfJung
commented
May 19, 2021
We already have those wrapper types, they are called |
CTFE Machine: do not expose Allocation `Memory` is careful now to not expose direct access to `Allocation`, but this one slipped through. r? `@oli-obk`
Rollup of 8 pull requests Successful merges: - rust-lang#84717 (impl FromStr for proc_macro::Literal) - rust-lang#85169 (Add method-toggle to <details> for methods) - rust-lang#85287 (Expose `Concurrent` (private type in public i'face)) - rust-lang#85315 (adding time complexity for partition_in_place iter method) - rust-lang#85439 (Add diagnostic item to `CStr`) - rust-lang#85464 (Fix UB in documented example for `ptr::swap`) - rust-lang#85470 (Fix invalid CSS rules for a:hover) - rust-lang#85472 (CTFE Machine: do not expose Allocation) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
…-obk CTFE engine: small cleanups I noticed these while preparing a large PR, and figured I'd better send them ahead to not muddy the diff unnecessarily. - remove remaining use of Pointer in Allocation API (I missed those in rust-lang#85472) - remove unnecessary deallocate_local hack (this logic does not seem necessary any more) r? `@oli-obk`
Memoryis careful now to not expose direct access toAllocation, but this one slipped through.r? @oli-obk