Rollup merge of #144676 - tiif:dev_guide_unstable_bound, r=BoxyUwU

Add documentation for unstable_feature_bound

There is more detail and explanation in https://hackmd.io/``````@tiif/Byd3mq7Ige``````

Original PR that implemented this: rust-lang/rust#140399

r? ``````@BoxyUwU`````` to nominate for types team discussion
This commit is contained in:
Jakub Beránek 2025-08-06 15:55:43 +02:00 committed by GitHub
commit 21e488c00a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -181,4 +181,7 @@ the `deprecated_in_future` lint is triggered which is default `allow`, but most
of the standard library raises it to a warning with
`#![warn(deprecated_in_future)]`.
## unstable_feature_bound
The `#[unstable_feature_bound(foo)]` attribute can be used together with `#[unstable]` attribute to mark an `impl` of stable type and stable trait as unstable. In std/core, an item annotated with `#[unstable_feature_bound(foo)]` can only be used by another item that is also annotated with `#[unstable_feature_bound(foo)]`. Outside of std/core, using an item with `#[unstable_feature_bound(foo)]` requires the feature to be enabled with `#![feature(foo)]` attribute on the crate. Currently, only `impl`s and free functions can be annotated with `#[unstable_feature_bound]`.
[blog]: https://www.ralfj.de/blog/2018/07/19/const.html