Skip to content

Commit 78b63d1

Browse files
RalfJungmark-i-m
authored andcommitted
mention stable-in-unstable issue
1 parent ba26418 commit 78b63d1

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/stability.md

+7
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@ You can make specific sub-items stable by using the `#[stable]` attribute on the
1616
The stability scheme works similarly to how `pub` works. You can have public functions of
1717
nonpublic modules and you can have stable functions in unstable modules or vice versa.
1818

19+
Note, however, that due to a [rustc bug], stable items inside unstable modules
20+
*are* available to stable code in that location! So, for example, stable code
21+
can import `core::intrinsics::transmute` even though `intrinsics` is an unstable
22+
module. Thus, this kind of nesting should be avoided when possible.
23+
24+
[rustc bug]: https://github.com/rust-lang/rust/issues/15702
25+
1926
# stable
2027

2128
The `#[stable(feature = "foo", "since = "1.420.69")]` attribute explicitly marks an item as

0 commit comments

Comments
 (0)