conv.

All stories

Rust RFC 3323 'Restrictions' ready for nightly testing

Two new language features allow explicit control over trait implementation scope and field mutability in Rust.

Rust RFC 3323 'Restrictions' ready for nightly testing
blog.rust-lang.org

Conversation activity · last 34 hours peak 1/hr

Peak 1 item in one hour at Aug 10, 5 AM; 4 items over 34 hours Aug 10, 5 AM — 1 itemAug 10, 6 AM — no itemsAug 10, 7 AM — no itemsAug 10, 8 AM — no itemsAug 10, 9 AM — 1 itemAug 10, 10 AM — no itemsAug 10, 11 AM — no itemsAug 10, 12 PM — no itemsAug 10, 1 PM — 1 itemAug 10, 2 PM — no itemsAug 10, 3 PM — no itemsAug 10, 4 PM — no itemsAug 10, 5 PM — no itemsAug 10, 6 PM — no itemsAug 10, 7 PM — no itemsAug 10, 8 PM — no itemsAug 10, 9 PM — no itemsAug 10, 10 PM — no itemsAug 10, 11 PM — no itemsAug 11, 12 AM — no itemsAug 11, 1 AM — no itemsAug 11, 2 AM — 1 itemAug 11, 3 AM — no itemsAug 11, 4 AM — no itemsAug 11, 5 AM — no itemsAug 11, 6 AM — no itemsAug 11, 7 AM — no itemsAug 11, 8 AM — no itemsAug 11, 9 AM — no itemsAug 11, 10 AM — no itemsAug 11, 11 AM — no itemsAug 11, 12 PM — no itemsAug 11, 1 PM — no itemsAug 11, 2 PM — no items 1 item · 5 AM
Aug 11

Summary, timeline and people extracted by Claude from 4 items across 3 sources · 9h ago. Quotes are verbatim.

The Rust project has announced RFC 3323 "Restrictions" is ready for testing on nightly Rust, introducing two new features: impl_restriction allows developers to explicitly restrict trait implementation to specific scopes (replacing the sealed trait pattern), and mut_restriction enables read-only field access by restricting mutation to particular scopes. These features simplify code and provide clearer compiler error messages.

  • impl_restriction simplifies trait implementation control by replacing the sealed trait pattern with direct syntax like impl(crate) trait Foo.
  • mut_restriction allows fields to be read publicly while restricting mutations to specified scopes, offering better borrow checker tracking than getter methods.
  • Both features provide clearer compiler error messages when violations occur.
  • The features are now available for testing in nightly Rust via RFC 3323.

How it unfolded

  1. Reaction Broader social amplification

    The announcement continued to circulate through social media with automated feeds sharing the Lobsters discussion.

  2. Report Lobsters discussion

    The Rust RFC announcement was shared on Lobsters with the title 'Restricting trait implementability and field mutability'.

  3. Report Hacker News picks up announcement

    The RFC announcement appeared on Hacker News as a discussion item.

  4. Event RFC 3323 announced for testing

    The Rust project announced that RFC 3323 'Restrictions' is ready for testing on nightly Rust, introducing impl_restriction and mut_restriction features.

What people are saying verbatim

“We are excited to announce that RFC 3323 "Restrictions" is ready for testing on nightly Rust.”

Rust Project · Inside Rust blog ↗ · Aug 9

“The impl_restriction feature allows explicit restriction of the scope in which a trait may be implemented.”

Rust Project · Inside Rust blog ↗ · Aug 9

“Without this feature, this use case is typically handled using the sealed trait pattern, which is described in the Rust API Guidelines.”

Rust Project · Inside Rust blog ↗ · Aug 9

“The mut_restriction feature allows explicit restriction of the scope in which a field may be mutated.”

Rust Project · Inside Rust blog ↗ · Aug 9

“This provides an alternative to getter methods by allowing read-only access through direct field access.”

Rust Project · Inside Rust blog ↗ · Aug 9