Rust Release Changelog - 1.95.0
14:43

Rust Release Changelog - 1.95.0

Rust Programming Language 16.04.2026 3 223 просмотров 162 лайков

Machine-readable: Markdown · JSON API · Site index

Поделиться Telegram VK Бот
Транскрипт Скачать .md
Анализ с AI
Описание видео
Hi, hello. Welcome to the first video in the Rust Release Changelog Series We are - Pete LeVasseur (https://bsky.app/profile/awkwardmap.bsky.social) - Tyler Mandry (https://bsky.app/profile/tylermandry.bsky.social) - Cameron Dershem (https://bsky.app/profile/pinkhatbeard.com) from the relatively new Rust Content Team. You may not have heard of us by now and that's a little on us. Our team was founded to help explore and publish more of what's happening within and from the prospective of the Rust Project itself. Recently we've observed many questions regarding things that we've taken for granted that everyone knew about Rust. This lead us to realize that most everyone on our team has been around since the early days when it was easy to keep up with everything in the Project, but as we grow, it's completely unreasonable to expect anyone to be able to 'catch up' with more than a decade of knowledge. Our hope is to use this series to both surface voices within the Project and to give the community more insight into how things work. We plan to release one video every 6 weeks coinciding with Rust's release cadence. We have a handful of topics we’re already planning to cover in future episodes, but please let us know anything you’d like to hear about. If you’re interested in presenting a topic or have a team or person you’d like to hear directly from, let us know! Leave a comment below or reach out anywhere we’re connected. Video Outline: 00:00 Introduction 02:20 Changelog Overview 05:26 Irrefutable_let_patterns 07:14 if let guards 13:57 Outro / Call for Feedback If you'd like to read more about the release, check these out: - https://blog.rust-lang.org/2026/04/16/Rust-1.95.0/ - https://releases.rs/docs/1.95.0/

Оглавление (5 сегментов)

Introduction

Hi guys. I bet you're wondering why I called you. Well, recently you know how I I host a meet up and recently I had a couple members of my meet up ask a bunch of questions that I kind of laughed about at first until I realized that it's not their fault that they don't know this stuff. It's that like I'm an old-timer. I've been around rust for a really long time. I take it for granted that I just know how rust releases work and like what beta means and what nightly means and like I I pay attention to RFCs so I kind of know what to expect with what's coming up. And I was thinking, you know, wouldn't it be kind of cool if we could share that some of that knowledge that we have gotten over the years with the community as a whole? So I thought we're on that rust content team that got newly formed last year and so I thought maybe we could as a content team that speaks from the language maybe we could actually do like a little video or a little call or something like that where we talk about this kind of stuff. What kind of topics are you thinking? Well, you know, I had a few and idea a few ideas. Like one is like how often is rust released? Released like we have like a thing called a rust release cadence but what does that even mean? I've seen some people talk about a rust the rust release train. And you know, choo sign me up. Um where like who decides what goes into a release? Um one of the things I like I saw recently mentioned with support tiers like I don't know what that means. Uh one of the funniest things I think is uh people getting so confused about when we have a patch release. You know, like the you know, 1. 92. 1 release. And people get really uh confused by that and they don't really understand it and I thought we could talk about how that happens and things that the maybe the community could do to help prevent those in the future. Uh Yeah and um one of the like how do I even know when a release comes out and like how do I know what's in the next release, you know?

Changelog Overview

Yeah, well, you know, like speaking of trains like luckily you don't have to wait for like a train to arrive like bolt delivery of your rust release. You can actually uh I've heard of this website. It's called releases. rs. And it has stuff on there about like upcoming releases and all this stuff. Uh let me see if I can share the screen and uh we can talk about it a little bit. Let's see here. Yeah, okay. Yeah, so like if you go to releases. rs you can see stuff that's coming up and past releases. Um So yeah, I mean we can hop around on here a little bit um and see what's what kind of jumps out at us. So I guess — there's a It looks like there's a release tomorrow even. Well, yeah, you're right. Wow, okay. Well, what fortuitous timing. — Indeed. Yeah, so like I guess uh yeah, there's a lot of different categories. There's like language stuff. So like maybe differences and changes in how the language can be used. Um compiler things. I don't really understand what would fit in that category. Maybe we talk about it another time. Platform stuff. It's mentioned of like tier two. Uh I think there's multiple tiers. Maybe we talk about that. Libraries. Yeah, I haven't dug into this category before. Stabilized APIs. Stay Yeah. I thought rust was supposed to be uh was pretty stable uh which is kind of cute but all right, yeah. I imagine that we should probably talk about this at some point but um yeah, there's a bunch of new things that are coming in here pretty detailed. And then const. Um yeah, I know that people want to use rust in const ways. Um I think there's stuff gradually happening here. And oh wow, compatibility notes. Well, pretty extensive. I don't know where that's coming from. I don't know, do you guys know anything about compatibility notes or Uh Pete, I think uh I don't want to you know, take up too much time uh this today. So I was thinking uh maybe we could table a lot of this stuff and we could actually find somebody that knows more about like what you know, stabilized APIs and platform tiers means. Uh are there any big changes coming up uh you know, in the newest release that might be maybe one of us might know more about that we could talk about? So the thing that I've heard a lot about like if let chains and now I see that there's stuff in here about like if let guards, match arms and irrefutable let patterns. So yeah, I mean it'd be cool to learn more about this. Yeah, I can talk about those. I like for these for a while actually. Um yeah, actually let me let me just share a playground so I can talk about it. Uh

Irrefutable_let_patterns

Cool, yeah. So um so yeah, there's two items where one of them was a irrefutable let patterns. That's a lint that already exists. It's like uh if I type let if let x equal foo um this actually does nothing in rust because uh if you're at an if let what you're supposed to write is like if let some or you some pattern. Um and other languages like swift where this actually means the same writing if let x means the same thing as if let some x in rust. So it's like it's there to like prevent you from uh accidentally writing the wrong thing. Let's say if you're used to writing swift syntax. Uh but um it actually prevents you from writing some really nice uh patterns that come up a lot especially if you're writing like a calling into like a C API or something like that. So what I've been wanting to write for a long time and sometimes I do this and I just override the lint cuz it's so annoying but um like let's say you're calling some function where you uh you get an error code back and then you want to uh compare the error code, right? You say oh if the error code is not zero then you know, I need to like log an error or something like that. Um and so this uh this change the lint actually just lets you write this now and now it's just idiomatic rust code. You can straight this. It doesn't warn you that oh technically you wrote if let uh something equals foo um as long as it's like a chain like this um it'll actually just let you write this without warning. So um I'm actually going to use this all over the place in my code. Um anytime I have to call an API like this.

if let guards

Um if let guards is another one I'm fairly excited about. At first when I first saw this feature I was like no one is ever going to need this. But then I actually looked through some of my code and um I found some places where I needed it. So I In my spare time I work on a window manager for Mac OS just cuz it's like my brain is broken in that way and uh there's some code that I found where I'm like uh I'm calling the this function um and you know, I want to like match on okay, did I get an okay result? Uh error? And if I got an error I wanted to log the error. It's like pretty straightforward, right? That's like the basic version of what I wanted it to do. Um and you know, match is like one of the most powerful features in rust, match expressions. So I mean it allows you to do pattern matching. Um the whole thing is an expression. It has all these fancy features like um you know, let's you do nested patterns. It gives you exhaustive destructuring. Um it's a really nice construct for like systems level programming cuz you can cover all of the cases and the compiler actually check for you that you covered all the cases, right? Um so in this case what I wanted to do was um I had this version but then I realized there are some cases that I log an error that are actually expected. So I wanted to have some like exception to the rule where it if it's an error and uh so certain other conditions are met uh I didn't want to log because that's actually going to log every single time. So like in this case it was uh there's some special window for the desktop. And what I wanted to write was something like um you know, error if I got an error but the element role is like scroll area um then I just uh I don't log, right? Um and unfortunately I couldn't use uh I couldn't use like a nested pattern cuz uh role returns a results. Um So I couldn't actually write this basically. This is the code that I wanted to write but I couldn't. Um so what I ended up having to do was uh because role returns a result and like the result type didn't it didn't implement partial eq. I had to write this was a like a year ago, right? I had to write this if let okay role equals element role and then like inside of the if let then I uh I compare the value of rule um and then I have an early return because like that's the only way to make this uh readable, but then this has to go into helper functions so that I can make the early return work. Um it was really quite painful. Um a year ago we stabilized if let chains, which are great. Um and we already saw an example of an if let chain earlier, but um so that allows you to remove one level of nesting here. Um So I think you'd format it like this. Yeah. Uh but you still have the early return. It's like not quite ideal uh with something that you don't want to write. Um there's other ways of writing this. You can have like another level um of nesting or you could have like an else branch or something, but yeah, it wasn't quite clean and this is still like more of a simplified version uh of what I wrote. Um In Rust 1. 95, which is actually you know, the the release that's coming out tomorrow. Um now you can just write the case that I wanted to write. Um except instead of an if guard, we have an if let guard. And then I can just straight up solve this. Um so we've removed one level of nesting. We have like a completely flat uh set of cases. Um and it's just like the if let composes very well with uh match guards uh which already exist. So before I felt like Rust was kind of punishing me for doing the right thing, being careful about handling all my error conditions correctly. Um but now I feel like it has my back. It better supports the kind of complicated logic that you find a lot of times in systems programming. And this is not just helpful for error handling. I saw the original RFC, it had an example of using this to parse terminal escape codes. So it's useful for parsers. It's useful in a lot of like just kind of weird complicated situations where you naturally would want to use one set of patterns, but then you have to uh reach for a different set and those two things don't compose. Again, it's an example of the language design principle that we talk about at composition, where if you have one feature, it should um work together with all the other kinds of features that uh where it makes sense. So we have if let, we have match guards, which are an if. Um yeah, we want we would like if let to work in all of the places where you can write if. And so um often times when we're stabilizing Rust features, we sort of uh we defer that. We kick the can down the road in the interest of getting something out there for people, like the most useful thing. Uh but then that leaves little gaps and you kind of you discover little paper cuts where you thought uh these two things would work together and they don't. So this is rounding out that feature. Um Uh so we have if let, we have let chains, and now I have if let chains and match guards, which totally rounds out the picture. And it makes Rust a better language for writing intricate logic that stands up to the complexity of production software systems. Whoa. Okay. Well, that's awesome that you uh coincidentally and conveniently had all of these examples ready to go and share with us on this spontaneous phone call that Cameron pulled us onto. Uh it's awesome. Uh thank you so much for sharing that and uh yeah. Um the I guess the fact that you're um you're on the line team and you are exposed to these things, it gives you kind of some insight that's really helpful to share in these cases. It's awesome. Uh So yeah, uh thanks for sharing all that. Yeah, and I think this was I'm really glad I called you

Outro / Call for Feedback

uh this week. And um but on that note, I do feel like I've taken up kind of enough of your time. Uh thank you both, but I definitely have uh don't want to overstay my welcome. Um but hey, how about I call you again in say 6 weeks? It's an oddly specific time frame, but yeah, sure. Uh ignore that. Uh in the meantime, if anyone comes up with a topic they'd like to hear about or maybe even speak about on a video like this, just let me know in the comments below. Yeah. All right, well, sign signing off then. So uh thanks, Cameron. Bye. See you next time. — later.

Другие видео автора — Rust Programming Language

Ctrl+V

Экстракт Знаний в Telegram

Экстракты и дистилляты из лучших YouTube-каналов — сразу после публикации.

Подписаться

Дайджест Экстрактов

Лучшие методички за неделю — каждый понедельник