<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/rust-adding-default-cargo-features-without-breaking-semantic-versioning-slint-blog-oxc813vwq" -->

---
title: Rust: Adding default cargo features without breaking...
description: When moving existing Rust crate functionality behind a new feature flag, users who set `default-features = false` won't automatically get the new feature,...
canonical: https://daily.dev/posts/rust-adding-default-cargo-features-without-breaking-semantic-versioning-slint-blog-oxc813vwq
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Rust: Adding default cargo features without breaking Semantic Versioning — Slint Blog | daily.dev
og:description: When moving existing Rust crate functionality behind a new feature flag, users who set `default-features = false` won't automatically get the new feature,...
og:url: https://daily.dev/posts/rust-adding-default-cargo-features-without-breaking-semantic-versioning-slint-blog-oxc813vwq
og:image: https://api.daily.dev/og/posts/OXC813VWQ.png
og:image:alt: Rust: Adding default cargo features without breaking Semantic Versioning — Slint Blog
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.

# Rust: Adding default cargo features without breaking Semantic Versioning — Slint Blog

**[Slint](https://daily.dev/sources/slint)** · 5 min read · 0 upvotes · 0 comments

## Summary

When moving existing Rust crate functionality behind a new feature flag, users who set `default-features = false` won't automatically get the new feature, potentially breaking their builds. The Slint team's solution is to add a mandatory versioned `compat` feature (e.g., `compat-0-2-0`) that is enabled by default and enforced via a `compile_error!` macro. When a new default feature is introduced in a later minor version, it is added both to `default` and to the `compat` feature, ensuring downstream crates that previously opted out of defaults still receive the new functionality. This avoids the maintenance burden of bumping the major version while preserving semantic versioning guarantees.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://slint.dev/blog/rust-adding-default-cargo-feature.html>

## Similar posts on daily.dev

- [Protecting the Rust standard library from accidental breakage](https://daily.dev/posts/protecting-the-rust-standard-library-from-accidental-breakage-6185skjif) · Predrag Gruevski · 35 upvotes · 2 comments
- [Announcing Rust 1.97.0](https://daily.dev/posts/announcing-rust-1-97-0-fqxhq3pfj) · Rust · 22 upvotes · 0 comments
- [A Vision for Cargo](https://daily.dev/posts/a-vision-for-cargo-9f2kssnoj) · Lobsters · 1 upvotes · 0 comments

---

Tags: [#rust](https://daily.dev/tags/rust)

[View this post on daily.dev](https://daily.dev/posts/rust-adding-default-cargo-features-without-breaking-semantic-versioning-slint-blog-oxc813vwq)

```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":"Rust: Adding default cargo features without breaking Semantic Versioning — Slint Blog","url":"https://daily.dev/posts/rust-adding-default-cargo-features-without-breaking-semantic-versioning-slint-blog-oxc813vwq","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/rust-adding-default-cargo-features-without-breaking-semantic-versioning-slint-blog-oxc813vwq"},"datePublished":"2026-07-12T07:19:48.501Z","dateModified":"2026-07-12T07:20:22.035Z","description":"When moving existing Rust crate functionality behind a new feature flag, users who set `default-features = false` won't automatically get the new feature,...","image":"https://media.daily.dev/image/upload/s--P4t4XyoV--/f_auto/v1722860399/public/Placeholder%2001","thumbnailUrl":"https://media.daily.dev/image/upload/s--P4t4XyoV--/f_auto/v1722860399/public/Placeholder%2001","isAccessibleForFree":true,"articleSection":"Slint","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":"Slint","logo":"https://media.daily.dev/image/upload/s--kMN8T1sT--/c_limit,w_256/f_auto,q_auto/v1783840780/logos/slint?_a=BAMAMicg0","url":"https://daily.dev/sources/slint"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/rust-adding-default-cargo-features-without-breaking-semantic-versioning-slint-blog-oxc813vwq","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"rust","timeRequired":"PT5M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Slint","item":"https://daily.dev/sources/slint"},{"@type":"ListItem","position":3,"name":"Rust: Adding default cargo features without breaking Semantic Versioning — Slint Blog"}]}
```

