Skip to content

Commit 41de15c

Browse files
committed
Specify #128771 changes
1 parent e3b2308 commit 41de15c

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed

src/attributes.rst

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ Built-in Attributes
157157
| TestContent
158158
| TrackCallerContent
159159
| TypeLengthLimitContent
160+
| UnsafeContent
160161
| UsedContent
161162
| WindowsSubsystemContent
162163
@@ -226,6 +227,9 @@ The following :t:`[built-in attribute]s` are :dt:`[diagnostics attribute]s`:
226227
* :dp:`fls_NrTL2FruARAv`
227228
:t:`Attribute` ``expect``.
228229

230+
* :dp:`fls_4d2ArC50kNWL`
231+
:t:`Attribute` ``unsafe``.
232+
229233
:dp:`fls_3fxhz0olhbcy`
230234
The following :t:`[built-in attribute]s` are :dt:`[documentation attribute]s`:
231235

@@ -1358,6 +1362,45 @@ related :t:`type`.
13581362
second_field: i8
13591363
}
13601364
1365+
.. _fls_19LnTi3WabFd:
1366+
1367+
Attribute ``unsafe``
1368+
^^^^^^^^^^^^^^^^^^^^
1369+
1370+
.. rubric:: Syntax
1371+
1372+
.. syntax::
1373+
1374+
UnsafeContent ::=
1375+
$$unsafe$$ $$($$ BuiltinAttributeContent $$)$$
1376+
1377+
.. rubric:: Legality Rules
1378+
1379+
:dp:`fls_5pjo3nGOxbVw`
1380+
:t:`Attribute` :c:`unsafe` shall apply to what the contained :t:`attribute` applies to.
1381+
1382+
:dp:`fls_gpxlWbQUNsj8`
1383+
:t:`Attribute` :c:`unsafe` behaves like the contained :t:`attribute`.
1384+
1385+
:dp:`fls_PhrfxSBvXTPV`
1386+
The contained :t:`attribute` shall be one of:
1387+
1388+
* :dp:`fls_pCSew95bKJJ5`
1389+
:t:`attribute` :c:`no_mangle`,
1390+
1391+
:dp:`fls_NRLgmOXxuljQ`
1392+
:t:`attribute` :c:`export_name`, or
1393+
1394+
:dp:`fls_ykpxNByUDyHG`
1395+
:t:`attribute` :c:`link_section`,
1396+
1397+
.. rubric:: Examples
1398+
1399+
.. code-block:: rust
1400+
1401+
#[unsafe(no_mangle)]
1402+
pub fn clear_name() {}
1403+
13611404
.. _fls_7skf24auayqy:
13621405

13631406
Attribute ``used``

src/changelog.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ Language changes in Rust 1.82.0
7474

7575
* `Stabilize explicit opt-in to unsafe attributes <https://github.com/rust-lang/rust/pull/128771>`_
7676

77+
* New section: :ref:`fls_19LnTi3WabFd`
78+
7779
* `Document NaN bit patterns guarantees <https://github.com/rust-lang/rust/pull/129559>`_
7880

7981
* New paragraph: :p:`fls_nuFAwLHOdQBx`

0 commit comments

Comments
 (0)