File:Crust of Rust- The Drop Check.webm

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

Crust_of_Rust-_The_Drop_Check.webm (WebM audio/video file, VP9/Opus, length 1 h 18 min 21 s, 640 × 360 pixels, 217 kbps overall, file size: 121.59 MB)

Captions

Captions

Add a one-line explanation of what this file represents

Summary

[edit]
Description
English: In this episode of Crust of Rust, we go over the "drop check" — another niche part of Rust that most people don't have to think about, but which rears its moderately attractive head occasionally when you use generic types in semi-weird ways. In particular, we explore how to implement a Norwegian version of Box (which is really just Box with a different name), and find that the straightforward implementation is not quite as flexible as the standard Box is due to the drop check. When we fix it, we then make it _too_ flexible, and open ourselves the type up to undefined behavior. Which, in turn, we use the drop check to fix. Towards the end, we go through a particularly interesting example at the intersection of the drop check and variance in the form of (ab)using std::iter::Empty.

0:00:00 Introduction 0:01:39 Boks: A Norwegian Box 0:04:22 Freeing a Boks 0:05:56 Dereferencing a Boks 0:09:40 Boks is too restrictive 0:26:52 Boks is not restrictive enough 0:35:35 PhantomData and may_dangle 0:36:32 What if Oisann didn't touch T? 0:37:30 Can I write PhantomData myself? 0:38:10 Boks isn't covariant! 0:43:49 Boks isn't covariant (in code)! 0:48:10 PhantomData T without holding a T 0:51:08 std::iter::Empty and variance 1:07:34 Why the Empty example compiles 1:13:40 Recap: what are all the bits? 1:15:47 Unnecessary Complexity?

You can read more about subtyping and variance in the Rustonomicon @ https://doc.rust-lang.org/nomicon/dropck.html.

Live version with chat: https://www.youtube.com/watch?v=Das3XSWo1GU
Date
Source YouTube: Crust of Rust: The Drop Check – View/save archived versions on archive.org and archive.today
Author Jon Gjengset

Licensing

[edit]
This video, screenshot or audio excerpt was originally uploaded on YouTube under a CC license.
Their website states: "YouTube allows users to mark their videos with a Creative Commons CC BY license."
To the uploader: You must provide a link (URL) to the original file and the authorship information if available.
w:en:Creative Commons
attribution
This file is licensed under the Creative Commons Attribution 3.0 Unported license.
Attribution: Jon Gjengset
You are free:
  • to share – to copy, distribute and transmit the work
  • to remix – to adapt the work
Under the following conditions:
  • attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
This file, which was originally posted to an external website, has not yet been reviewed by an administrator or reviewer to confirm that the above license is valid. See Category:License review needed for further instructions.

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current21:11, 29 September 20241 h 18 min 21 s, 640 × 360 (121.59 MB)Momiji-Penguin (talk | contribs)Imported media from https://www.youtube.com/watch?v=TJOFSMpJdzg

The following page uses this file:

Transcode status

Update transcode status
Format Bitrate Download Status Encode time
VP9 360P 199 kbps Completed 04:07, 30 September 2024 28 min 49 s
VP9 240P 143 kbps Completed 04:06, 30 September 2024 28 min 8 s
WebM 360P 521 kbps Completed 04:08, 30 September 2024 28 min 23 s
QuickTime 144p (MJPEG) 1.13 Mbps Completed 06:16, 21 October 2024 4 min 14 s

Metadata