r/rust • • 3d ago

🧠 educational Miscompilation in Rust 1.97

I reported a miscompilation in Rust 1.97 back in July. In this presentation, I went through the details of the bug and the investigation as it unfolded in the Zulip chat with the Rust team, and shared my takeaways and conclusions.

https://youtu.be/-dNsUB7QRk4

Edit: link to the Zulip chat #t-compiler > Miscompilation in 1.97.0 with new Option::None discrimi... @ 💬

70 Upvotes

13 comments sorted by

66

u/hedgehog1024 3d ago

I once again have to remind that the part of URL including and after ?si is a YouTube share ID which serves only the purpose of helping YouTube track who shared the video and thus can be harmlessly removed.

16

u/kakipipi23 3d ago

Cool, didn't know. Removed

22

u/Im_Justin_Cider 3d ago

It’s nasty, and only I’m surprised that yt isn’t more subtle about it, they could easily encode that information into the URL

9

u/LB-- 3d ago

Yeah, Reddit already does so with share URLs that don't have the actual post ID anymore.

11

u/Mean-Huckleberry5563 3d ago

Watched this earlier, the Zulip back-and-forth was wild to see laid out like that. That moment where the root cause clicked must've been so satisfying after all the dead ends.

6

u/kakipipi23 3d ago

In retrospect it was indeed exciting enough for me to talk about it, but back then I just wanted to merge my pr, you can imagine the frustration from seeing a segfault in ci lol

4

u/noop_noob 3d ago

Here's the zulip thread, if you wanna read it yourself. #t-compiler > Miscompilation in 1.97.0 with new Option::None discrimi... @ 💬

3

u/kakipipi23 3d ago

Added the link to the post too, thanks

-2

u/a_jasmin 3d ago

Should rustup implement a toolchain cooldown period the same way as cargo now has dependency cooldown?

9

u/kakipipi23 3d ago

Nah I don't think so. Rust have a constant release cycle, just pull in the new version whenever you feel like it, it's not nearly as messy as managing dependencies in general

15

u/ROBOTRON31415 3d ago

There’s effectively already such a period: Rust versions stay in beta for a little over a month (before they become stable) after they split off from nightly.

5

u/lenscas 3d ago

No?

The cooldown is mostly to protect against malicious code being introduced in a crate.

If that happen to rustc we/you have bigger things to worry about regardless.

Also, iirc this miscommunication actually affected quite a few previous versions as well but it just started to happen more on this version due to some other changes. So a cooldown period wouldn't have helped regardless.

If you still want a cooldown period, you can configure which tool chain version your project uses and then only update that every so often, staying however far behind as you want.