Implementing Rust's Vec From Scratch

Share
Ryan Levick
Published at : 03 Dec 2021
12506 views
410
2

In this stream, we implement a limited version of Rust's Vec type from scratch. In doing so, we learn a lot about unsafe Rust. This stream is geared towards those with at least intermediate experience in Rust, but beginners should also learn more about how Rust's memory model works.

Note: This is just a learning exercise! The standard library's Vec is great, and you should just use that.

The resource on covariance I mention in the stream can be found here: https://github.com/sunshowers/lifetime-variance-example
ImplementingRust'sScratch

SHOCKED - Simply the BEST RTR RC Trail Truck! 4S 1/8 Scale TANK 300 - Traction Hobby | RC ADVENTURES

SHOCKED - Simply the BEST RTR RC Trail Truck! 4S 1/8 Scale TANK 300 - Traction Hobby | RC ADVENTURES

Why China Is In Africa - If You Don’t Know, Now You Know | The Daily Show

Why China Is In Africa - If You Don’t Know, Now You Know | The Daily Show

I *STOLE* (he may have let me😉) my brothers iPod and customised it (first time!)

I *STOLE* (he may have let me😉) my brothers iPod and customised it (first time!)

2010 Mazda Mazdaspeed3: Regular Car Reviews

2010 Mazda Mazdaspeed3: Regular Car Reviews

ONE PLAYER STEVEN GERRARD SHOULD SIGN FROM EACH PREMIER LEAGUE CLUB! | #WNTT

ONE PLAYER STEVEN GERRARD SHOULD SIGN FROM EACH PREMIER LEAGUE CLUB! | #WNTT

Frequently used annotations in VDM

Frequently used annotations in VDM

Nite Jewel - "One Second of Love" (Official Video)

Nite Jewel - "One Second of Love" (Official Video)

Monolithic Hardwood Furniture Sofa Design Mr.Van Come Back || Extremely Wonderful Woodworking Skills

Monolithic Hardwood Furniture Sofa Design Mr.Van Come Back || Extremely Wonderful Woodworking Skills

1998 Dodge Neon Highline: Regular Car Reviews

1998 Dodge Neon Highline: Regular Car Reviews

FIRST TO FINISH CARDBOARD ART SCHOOL WINS || DIY Origami Paper Hacks! Challenge By 123 GO! TRENDS

FIRST TO FINISH CARDBOARD ART SCHOOL WINS || DIY Origami Paper Hacks! Challenge By 123 GO! TRENDS

Top 3 Gold & Silver Stocks - Jeff Clark

Top 3 Gold & Silver Stocks - Jeff Clark

Patterns and sequences of Lesson 10 part 2   Lessons to strengthen the ability to handle problems

Patterns and sequences of Lesson 10 part 2 Lessons to strengthen the ability to handle problems

Lola x Justin - Reverse It (Music Video)

Lola x Justin - Reverse It (Music Video)

Meditate Better | Swami Sarvapriyananda

Meditate Better | Swami Sarvapriyananda

Vans Skateboarding Presents: Nice To See You | Skate | VANS

Vans Skateboarding Presents: Nice To See You | Skate | VANS

How To Promote UNLIMITED Affiliate Products on CLASSIFIED ADS And Make Longterm Passive Income

How To Promote UNLIMITED Affiliate Products on CLASSIFIED ADS And Make Longterm Passive Income

Alesso - Years ft. Matthew Koma

Alesso - Years ft. Matthew Koma

The Principle documentary

The Principle documentary

What Makes A "Best Anime of 2021" List and What's on Mine

What Makes A "Best Anime of 2021" List and What's on Mine

VLOG | Prepare dinner with me! 🍝😋 ‎وجدو العشا معايا

VLOG | Prepare dinner with me! 🍝😋 ‎وجدو العشا معايا

I'm Not Breaking Up With You Goosebumps (Animorphs Is Just a Friend)

I'm Not Breaking Up With You Goosebumps (Animorphs Is Just a Friend)

#Healthy #StrawberryShake recipe | Good for kids & Beneficial for youngsters | #Arshiskitchen

#Healthy #StrawberryShake recipe | Good for kids & Beneficial for youngsters | #Arshiskitchen

how to magnify screen in android #tricks

how to magnify screen in android #tricks

5 Insane Watches You Won't Believe Exist | Watchfinder & Co.

5 Insane Watches You Won't Believe Exist | Watchfinder & Co.

AR3NA - Επεισόδιο 1 & 2

AR3NA - Επεισόδιο 1 & 2

Modern Useful Tool #Shorts 129

Modern Useful Tool #Shorts 129

ΔΑΣΚΑΛΟΣ MAKAVELI : EURO2020 ΚΑΙΡΑΤ ΑΛΜΑΤΙ ΚΑΙ AVIATOR

ΔΑΣΚΑΛΟΣ MAKAVELI : EURO2020 ΚΑΙΡΑΤ ΑΛΜΑΤΙ ΚΑΙ AVIATOR

a *realistic* what i eat in a day + my workouts

a *realistic* what i eat in a day + my workouts

Pakistan Win The Match | Indian Media Reaction | Akshay Kumar insult | Bushra BiBi Daughter Wedding

Pakistan Win The Match | Indian Media Reaction | Akshay Kumar insult | Bushra BiBi Daughter Wedding

GOATBALL - Minecraft Em busca da casa automática #330

GOATBALL - Minecraft Em busca da casa automática #330

This Farmhouse Gets An Incredible $180,000 Renovation Makeover! | Farmhouse Fixer

This Farmhouse Gets An Incredible $180,000 Renovation Makeover! | Farmhouse Fixer

[EP1] STAY AWAY FROM ME ~HIStory- || BL MALAYSIA SERIES

[EP1] STAY AWAY FROM ME ~HIStory- || BL MALAYSIA SERIES

After We Fell | Official Trailer | Voltage Pictures

After We Fell | Official Trailer | Voltage Pictures

Discovery

Discovery

ADLEY made a MAGiC PET!!  Kids mix a Magical Potion to create a new friend! our baby mixie is born!

ADLEY made a MAGiC PET!! Kids mix a Magical Potion to create a new friend! our baby mixie is born!

Ten Little Buses Song + More Nursery Rhymes & Kids Songs - CoComelon

Ten Little Buses Song + More Nursery Rhymes & Kids Songs - CoComelon

A Gaggle of Noblemen

A Gaggle of Noblemen

AJR - Adventure Is Out There (Official Audio)

AJR - Adventure Is Out There (Official Audio)

লাওস বনাম বাংলাদেশের অর্থনীতি (২০২১) | Laos vs Bangladesh Economic Comparison 2021 |

লাওস বনাম বাংলাদেশের অর্থনীতি (২০২১) | Laos vs Bangladesh Economic Comparison 2021 |

TikToker Accidentally Reveals The Origin Of Karens

TikToker Accidentally Reveals The Origin Of Karens

AMP by Virtuzone | Get AED 60,000 Worth of Benefits

AMP by Virtuzone | Get AED 60,000 Worth of Benefits

Analyze the meaning of essays on the topic of the country   Professor Bahram

Analyze the meaning of essays on the topic of the country Professor Bahram

【屋久島】サンカラ ホテル&スパ屋久島 レストラン「okas」&「ayana」食べ比べ(135)

【屋久島】サンカラ ホテル&スパ屋久島 レストラン「okas」&「ayana」食べ比べ(135)

Need a house? This was built in 7 days.

Need a house? This was built in 7 days.

Bus Song | Different Types of Buses + More Nursery Rhymes & Kids Songs | Learn with Little Baby Bum

Bus Song | Different Types of Buses + More Nursery Rhymes & Kids Songs | Learn with Little Baby Bum

The Unique Shadow | LAVA - ເພງ ລາວາ ສາຍຕາເຈົ້າຮ້ອນແຮງຄືລາວາ | Official MV

The Unique Shadow | LAVA - ເພງ ລາວາ ສາຍຕາເຈົ້າຮ້ອນແຮງຄືລາວາ | Official MV

Planiform's V-Rail system - monorail system for garments on hangers

Planiform's V-Rail system - monorail system for garments on hangers

Daddy tsoulfas θα πούλαγε την ψυχή του για χρήμα,φήμη και γκόμενες

Daddy tsoulfas θα πούλαγε την ψυχή του για χρήμα,φήμη και γκόμενες

How are they feeling now | Do you know how they feel | Emotion Case Simulation | Feeling and Emotion

How are they feeling now | Do you know how they feel | Emotion Case Simulation | Feeling and Emotion