X-Git-Url: https://git.ralfj.de/web.git/blobdiff_plain/81d020bc303e970d1eaebf302bb829dafeb6e2ce..8843f41333a5a6b341f4c7623dd54fc7d012dd43:/ralf/_posts/2017-08-11-types-as-contracts-evaluation.md?ds=sidebyside diff --git a/ralf/_posts/2017-08-11-types-as-contracts-evaluation.md b/ralf/_posts/2017-08-11-types-as-contracts-evaluation.md index e06ccc0..226d48f 100644 --- a/ralf/_posts/2017-08-11-types-as-contracts-evaluation.md +++ b/ralf/_posts/2017-08-11-types-as-contracts-evaluation.md @@ -1,6 +1,7 @@ --- title: "Types as Contracts: Implementation and Evaluation" categories: internship rust +forum: https://internals.rust-lang.org/t/https-www-ralfj-de-blog-2017-08-11-types-as-contracts-evaluation-html/5753 --- Some weeks ago, I described [Types as Contracts]({{ site.baseurl }}{% post_url 2017-07-17-types-as-contracts %}) as an approach for how to go about defining Rust's aliasing-related [undefined behavior]({{ site.baseurl }}{% post_url 2017-07-14-undefined-behavior %}). @@ -77,7 +78,7 @@ However, it turns out that `mem::uninitialized` is causing other problems as wel This is the most interesting case I found. The `Arc` destructor ends up calling `Arc::drop_slow`, which is implemented as follows: {% highlight rust %} - unsafe fn drop_slow(&mut self) { +unsafe fn drop_slow(&mut self) { let ptr = self.ptr.as_ptr(); // Destroy the data at this time, even though we may not free the box