File tree Expand file tree Collapse file tree 2 files changed +45
-0
lines changed Expand file tree Collapse file tree 2 files changed +45
-0
lines changed Original file line number Diff line number Diff line change @@ -157,6 +157,7 @@ Built-in Attributes
157
157
| TestContent
158
158
| TrackCallerContent
159
159
| TypeLengthLimitContent
160
+ | UnsafeContent
160
161
| UsedContent
161
162
| WindowsSubsystemContent
162
163
@@ -226,6 +227,9 @@ The following :t:`[built-in attribute]s` are :dt:`[diagnostics attribute]s`:
226
227
* :dp: `fls_NrTL2FruARAv `
227
228
:t: `Attribute ` ``expect ``.
228
229
230
+ * :dp: `fls_4d2ArC50kNWL `
231
+ :t: `Attribute ` ``unsafe ``.
232
+
229
233
:dp: `fls_3fxhz0olhbcy `
230
234
The following :t: `[built-in attribute]s ` are :dt: `[documentation attribute]s `:
231
235
@@ -1358,6 +1362,45 @@ related :t:`type`.
1358
1362
second_field: i8
1359
1363
}
1360
1364
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
+
1361
1404
.. _fls_7skf24auayqy :
1362
1405
1363
1406
Attribute ``used ``
Original file line number Diff line number Diff line change @@ -74,6 +74,8 @@ Language changes in Rust 1.82.0
74
74
75
75
* `Stabilize explicit opt-in to unsafe attributes <https://github.com/rust-lang/rust/pull/128771 >`_
76
76
77
+ * New section: :ref: `fls_19LnTi3WabFd `
78
+
77
79
* `Document NaN bit patterns guarantees <https://github.com/rust-lang/rust/pull/129559 >`_
78
80
79
81
* New paragraph: :p: `fls_nuFAwLHOdQBx `
You can’t perform that action at this time.
0 commit comments