<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/protecting-the-rust-standard-library-from-accidental-breakage-6185skjif" -->

---
title: Protecting the Rust standard library from accidental...
description: The Rust standard library now runs cargo-semver-checks in CI to catch accidental breakage of stable APIs, following a history of incidents where unstable...
canonical: https://daily.dev/posts/protecting-the-rust-standard-library-from-accidental-breakage-6185skjif
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Protecting the Rust standard library from accidental breakage | daily.dev
og:description: The Rust standard library now runs cargo-semver-checks in CI to catch accidental breakage of stable APIs, following a history of incidents where unstable...
og:url: https://daily.dev/posts/protecting-the-rust-standard-library-from-accidental-breakage-6185skjif
og:image: https://api.daily.dev/og/posts/6185skjIf.png
og:image:alt: Protecting the Rust standard library from accidental breakage
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Protecting the Rust standard library from accidental breakage

**[Predrag Gruevski](https://daily.dev/sources/predrag)** · 10 min read · 35 upvotes · 2 comments

## Summary

The Rust standard library now runs cargo-semver-checks in CI to catch accidental breakage of stable APIs, following a history of incidents where unstable methods or soundness fixes accidentally broke stable code (async-std in 2020, BuildHasher's dyn-safety in 2021, ChunksMut's Send/Sync in 2022, and a tokio Windows breakage in Rust 1.94 that required a 1.94.1 point release). The work required teaching cargo-semver-checks to understand Rust's stability attributes (#[stable], #[unstable], const-stability, default-body stability) and exposing that data through new rustdoc JSON fields, reusing existing #[doc(hidden)] handling infrastructure so hundreds of existing lints work correctly without modification. The effort grew out of hallway conversations at RustWeek 2026 and the Rust All Hands, took months and 15,000+ lines of code, and remaining work includes better UX for reporting stability breakage and covering more platforms.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://predr.ag/blog/protecting-the-rust-stdlib-from-breakage>

## Questions this post answers

### Why did tokio's test suite fail to compile on Windows in Rust 1.94?

A standard library trait gained new unstable methods that inadvertently broke tokio's test suite compilation on Windows in Rust 1.94. The breakage was significant enough that a fix shipped in the Rust 1.94.1 point release rather than waiting for the next stable release cycle.

_Rust upgraders tracking point-release fixes like this can follow stdlib stability work on daily.dev._

### How does cargo-semver-checks handle unstable Rust standard library APIs without flagging their changes as breaking?

Items marked #[unstable] are treated as non-public API, exactly like #[doc(hidden)] items, so their changes never trigger breakage warnings. The same logic extends to const-unstable items (treated as non-const) and unstable trait method defaults (treated as not provided), letting hundreds of existing lints work correctly without rewrites.

_Developers weighing semver tooling for their own crates can dig into these stability-modeling tricks on daily.dev._

### What kinds of stability metadata did rustdoc JSON need to expose to support semver checking of the Rust standard library?

Rustdoc JSON needed three new fields: an Item::stability field for whether an item is stable or unstable, an Item::const_stability field for whether const usage is stable, and default_unstable fields on Function, AssocConst, and AssocType to capture whether a trait's default implementation is stable. Together these let tooling distinguish genuine public API breakage from changes to unstable surface area.

_Anyone building on rustdoc JSON internals can track this kind of stability metadata work via daily.dev._

## Community discussion

Top comments from developers on daily.dev.

**@agustinbarrientos** · 2 upvotes

> Will Windows join the CI matrix after that tokio regression?

**@trevorsuna** · 0 upvotes

> Encoding Rust’s stability attributes into the semver check turns a subtle social contract into a CI invariant. The impressive part is reusing hundreds of existing lints once rustdoc exposed the right metadata; that should make protection much broader without duplicating rules.

## Similar posts on daily.dev

- [Announcing Rust 1.97.0](https://daily.dev/posts/announcing-rust-1-97-0-fqxhq3pfj) · Rust · 22 upvotes · 0 comments
- [Recent Rust Changes](https://daily.dev/posts/recent-rust-changes-iaytt6tvw) · Nick Cameron · 9 upvotes · 0 comments
- [Supply chain nightmare: How Rust will be attacked and what we can do to mitigate the inevitable](https://daily.dev/posts/supply-chain-nightmare-how-rust-will-be-attacked-and-what-we-can-do-to-mitigate-the-inevitable-xdchrtlnw) · Hacker News · 0 upvotes · 1 comments

---

Tags: [#rust](https://daily.dev/tags/rust), [#semantic-versioning](https://daily.dev/tags/semantic-versioning)

[View this post on daily.dev](https://daily.dev/posts/protecting-the-rust-standard-library-from-accidental-breakage-6185skjif)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Protecting the Rust standard library from accidental breakage","url":"https://daily.dev/posts/protecting-the-rust-standard-library-from-accidental-breakage-6185skjif","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/protecting-the-rust-standard-library-from-accidental-breakage-6185skjif"},"datePublished":"2026-08-16T13:49:21.053Z","dateModified":"2026-10-15T02:22:42.243Z","description":"The Rust standard library now runs cargo-semver-checks in CI to catch accidental breakage of stable APIs, following a history of incidents where unstable...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/ed73b274deb303f22aaa100461f0ab4c?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/ed73b274deb303f22aaa100461f0ab4c?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Predrag Gruevski","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Predrag Gruevski","logo":"https://media.daily.dev/image/upload/s--zyVDLYwG--/f_auto,q_auto/v1780213710/logos/predrag?_a=BAMAMiWQ0","url":"https://daily.dev/sources/predrag"},"commentCount":2,"discussionUrl":"https://daily.dev/posts/protecting-the-rust-standard-library-from-accidental-breakage-6185skjif","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":35},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":2}],"keywords":"rust,semantic-versioning","timeRequired":"PT10M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Predrag Gruevski","item":"https://daily.dev/sources/predrag"},{"@type":"ListItem","position":3,"name":"Protecting the Rust standard library from accidental breakage"}]}
{"@context":"https://schema.org","@type":"WebPage","@id":"https://daily.dev/posts/protecting-the-rust-standard-library-from-accidental-breakage-6185skjif","comment":[{"@type":"Comment","text":"Will Windows join the CI matrix after that tokio regression?","datePublished":"2026-08-16T19:46:09.622Z","url":"https://daily.dev/posts/6185skjIf#c-VYFYxPLOp","author":{"@type":"Person","name":"Agustin Barrientos","url":"https://daily.dev/agustinbarrientos","image":"https://media.daily.dev/image/upload/s--5ayxQnqn--/f_auto/v1788281802/avatars/avatar_wQYYVe5Tbj0NJ7C7qPoa8?_a=BAMAMicg0"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":2}},{"@type":"Comment","text":"Encoding Rust’s stability attributes into the semver check turns a subtle social contract into a CI invariant. The impressive part is reusing hundreds of existing lints once rustdoc exposed the right metadata; that should make protection much broader without duplicating rules.","datePublished":"2026-08-17T02:38:09.610Z","url":"https://daily.dev/posts/6185skjIf#c-GVeaEVHYI","author":{"@type":"Person","name":"Trevor Suna","url":"https://daily.dev/trevorsuna","image":"https://media.daily.dev/image/upload/s--dZ7gXxpp--/f_auto/v1784081551/avatars/avatar_EMoP47rpuw8DNjhp6R1b6?_a=BAMAMicg0"}}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/protecting-the-rust-standard-library-from-accidental-breakage-6185skjif#faq","mainEntity":[{"@type":"Question","name":"Why did tokio's test suite fail to compile on Windows in Rust 1.94?","acceptedAnswer":{"@type":"Answer","text":"A standard library trait gained new unstable methods that inadvertently broke tokio's test suite compilation on Windows in Rust 1.94. The breakage was significant enough that a fix shipped in the Rust 1.94.1 point release rather than waiting for the next stable release cycle. Rust upgraders tracking point-release fixes like this can follow stdlib stability work on daily.dev."}},{"@type":"Question","name":"How does cargo-semver-checks handle unstable Rust standard library APIs without flagging their changes as breaking?","acceptedAnswer":{"@type":"Answer","text":"Items marked #[unstable] are treated as non-public API, exactly like #[doc(hidden)] items, so their changes never trigger breakage warnings. The same logic extends to const-unstable items (treated as non-const) and unstable trait method defaults (treated as not provided), letting hundreds of existing lints work correctly without rewrites. Developers weighing semver tooling for their own crates can dig into these stability-modeling tricks on daily.dev."}},{"@type":"Question","name":"What kinds of stability metadata did rustdoc JSON need to expose to support semver checking of the Rust standard library?","acceptedAnswer":{"@type":"Answer","text":"Rustdoc JSON needed three new fields: an Item::stability field for whether an item is stable or unstable, an Item::const_stability field for whether const usage is stable, and default_unstable fields on Function, AssocConst, and AssocType to capture whether a trait's default implementation is stable. Together these let tooling distinguish genuine public API breakage from changes to unstable surface area. Anyone building on rustdoc JSON internals can track this kind of stability metadata work via daily.dev."}}]}
```

