File:Crust of Rust- The Drop Check.webm
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
Summary
[edit]DescriptionCrust of Rust- The Drop Check.webm |
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]- 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/Time | Thumbnail | Dimensions | User | Comment | |
---|---|---|---|---|---|
current | 21:11, 29 September 2024 | 1 h 18 min 21 s, 640 × 360 (121.59 MB) | Momiji-Penguin (talk | contribs) | Imported media from https://www.youtube.com/watch?v=TJOFSMpJdzg |
You cannot overwrite this file.
File usage on Commons
The following page uses this file:
Transcode status
Update transcode statusMetadata
This file contains additional information such as Exif metadata which may have been added by the digital camera, scanner, or software program used to create or digitize it. If the file has been modified from its original state, some details such as the timestamp may not fully reflect those of the original file. The timestamp is only as accurate as the clock in the camera, and it may be completely wrong.
Software used | Lavf60.16.100 |
---|