Skip to content

Commit

Permalink
Specify #128771 changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Veykril committed Nov 4, 2024
1 parent e3b2308 commit 41de15c
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
43 changes: 43 additions & 0 deletions src/attributes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ Built-in Attributes
| TestContent
| TrackCallerContent
| TypeLengthLimitContent
| UnsafeContent
| UsedContent
| WindowsSubsystemContent
Expand Down Expand Up @@ -226,6 +227,9 @@ The following :t:`[built-in attribute]s` are :dt:`[diagnostics attribute]s`:
* :dp:`fls_NrTL2FruARAv`
:t:`Attribute` ``expect``.

* :dp:`fls_4d2ArC50kNWL`
:t:`Attribute` ``unsafe``.

:dp:`fls_3fxhz0olhbcy`
The following :t:`[built-in attribute]s` are :dt:`[documentation attribute]s`:

Expand Down Expand Up @@ -1358,6 +1362,45 @@ related :t:`type`.
second_field: i8
}
.. _fls_19LnTi3WabFd:

Attribute ``unsafe``
^^^^^^^^^^^^^^^^^^^^

.. rubric:: Syntax

.. syntax::

UnsafeContent ::=
$$unsafe$$ $$($$ BuiltinAttributeContent $$)$$

.. rubric:: Legality Rules

:dp:`fls_5pjo3nGOxbVw`
:t:`Attribute` :c:`unsafe` shall apply to what the contained :t:`attribute` applies to.

:dp:`fls_gpxlWbQUNsj8`
:t:`Attribute` :c:`unsafe` behaves like the contained :t:`attribute`.

:dp:`fls_PhrfxSBvXTPV`
The contained :t:`attribute` shall be one of:

* :dp:`fls_pCSew95bKJJ5`
:t:`attribute` :c:`no_mangle`,

:dp:`fls_NRLgmOXxuljQ`
:t:`attribute` :c:`export_name`, or

:dp:`fls_ykpxNByUDyHG`
:t:`attribute` :c:`link_section`,

.. rubric:: Examples

.. code-block:: rust
#[unsafe(no_mangle)]
pub fn clear_name() {}
.. _fls_7skf24auayqy:

Attribute ``used``
Expand Down
2 changes: 2 additions & 0 deletions src/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ Language changes in Rust 1.82.0

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

* New section: :ref:`fls_19LnTi3WabFd`

* `Document NaN bit patterns guarantees <https://github.com/rust-lang/rust/pull/129559>`_

* New paragraph: :p:`fls_nuFAwLHOdQBx`
Expand Down

0 comments on commit 41de15c

Please sign in to comment.