Skip to content

Commit 6ee4999

Browse files
authored
Merge branch 'rust-lang:master' into c-unwind-documentation
2 parents 3dcfa4a + 9f0cc13 commit 6ee4999

33 files changed

+640
-383
lines changed

book.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,12 @@ author = "The Rust Project Developers"
66
[output.html]
77
additional-css = ["theme/reference.css"]
88
git-repository-url = "https://github.com/rust-lang/reference/"
9+
edit-url-template = "https://github.com/rust-lang/reference/edit/master/{path}"
910

1011
[output.html.redirect]
1112
"/expressions/enum-variant-expr.html" = "struct-expr.html"
13+
"/unsafe-blocks.html" = "unsafe-keyword.html"
14+
"/unsafe-functions.html" = "unsafe-keyword.html"
1215

1316
[rust]
1417
edition = "2021"

src/SUMMARY.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,7 @@
120120
- [Inline assembly](inline-assembly.md)
121121

122122
- [Unsafety](unsafety.md)
123-
- [Unsafe functions](unsafe-functions.md)
124-
- [Unsafe blocks](unsafe-blocks.md)
123+
- [The `unsafe` keyword](unsafe-keyword.md)
125124
- [Behavior considered undefined](behavior-considered-undefined.md)
126125
- [Behavior not considered unsafe](behavior-not-considered-unsafe.md)
127126

src/attributes.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,8 @@ The following is an index of all built-in attributes.
228228
- [`link`] — Specifies a native library to link with an `extern` block.
229229
- [`link_name`] — Specifies the name of the symbol for functions or statics
230230
in an `extern` block.
231+
- [`link_ordinal`] — Specifies the ordinal of the symbol for functions or
232+
statics in an `extern` block.
231233
- [`no_link`] — Prevents linking an extern crate.
232234
- [`repr`] — Controls type layout.
233235
- [`crate_type`] — Specifies the type of crate (library, executable, etc.).
@@ -297,6 +299,7 @@ The following is an index of all built-in attributes.
297299
[`ignore`]: attributes/testing.md#the-ignore-attribute
298300
[`inline`]: attributes/codegen.md#the-inline-attribute
299301
[`link_name`]: items/external-blocks.md#the-link_name-attribute
302+
[`link_ordinal`]: items/external-blocks.md#the-link_ordinal-attribute
300303
[`link_section`]: abi.md#the-link_section-attribute
301304
[`link`]: items/external-blocks.md#the-link-attribute
302305
[`macro_export`]: macros-by-example.md#path-based-scope

src/attributes/codegen.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ trait object whose methods are attributed.
347347
[target architecture]: ../conditional-compilation.md#target_arch
348348
[trait]: ../items/traits.md
349349
[undefined behavior]: ../behavior-considered-undefined.md
350-
[unsafe function]: ../unsafe-functions.md
350+
[unsafe function]: ../unsafe-keyword.md
351351
[rust-abi]: ../items/external-blocks.md#abi
352352
[`core::intrinsics::caller_location`]: ../../core/intrinsics/fn.caller_location.html
353353
[`core::panic::Location::caller`]: ../../core/panic/struct.Location.html#method.caller

src/attributes/derive.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,6 @@ impl<T: PartialEq> PartialEq for Foo<T> {
2424
fn eq(&self, other: &Foo<T>) -> bool {
2525
self.a == other.a && self.b == other.b
2626
}
27-
28-
fn ne(&self, other: &Foo<T>) -> bool {
29-
self.a != other.a || self.b != other.b
30-
}
3127
}
3228
```
3329

src/attributes/diagnostics.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ Tuple struct fields are ignored.
184184
Here is an example:
185185

186186
```rust
187-
#[deprecated(since = "5.2", note = "foo was rarely used. Users should instead use bar")]
187+
#[deprecated(since = "5.2.0", note = "foo was rarely used. Users should instead use bar")]
188188
pub fn foo() {}
189189

190190
pub fn bar() {}

src/attributes/testing.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,8 @@ functions are only compiled when in test mode. Test functions must be free,
1212
monomorphic functions that take no arguments, and the return type must implement the [`Termination`] trait, for example:
1313

1414
* `()`
15-
* `Result<(), E> where E: Debug`
15+
* `Result<T, E> where T: Termination, E: Debug`
1616
* `!`
17-
<!-- * Result<!, E> where E: Debug` -->
1817

1918
<!-- If the previous section needs updating (from "must take no arguments"
2019
onwards, also update it in the crates-and-source-files.md file -->

src/conditional-compilation.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,25 @@ Example values:
191191
* `"pc"`
192192
* `"unknown"`
193193

194+
### `target_has_atomic`
195+
196+
Key-value option set for each bit width that the target supports
197+
atomic loads, stores, and compare-and-swap operations.
198+
199+
When this cfg is present, all of the stable [`core::sync::atomic`] APIs are available for
200+
the relevant atomic width.
201+
202+
[`core::sync::atomic`]: ../core/sync/atomic/index.html
203+
204+
Possible values:
205+
206+
* `"8"`
207+
* `"16"`
208+
* `"32"`
209+
* `"64"`
210+
* `"128"`
211+
* `"ptr"`
212+
194213
### `test`
195214

196215
Enabled when compiling the test harness. Done with `rustc` by using the

src/crates-and-source-files.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,9 @@ fn main() -> impl std::process::Termination {
123123
>
124124
> * `()`
125125
> * [`!`]
126+
> * [`Infallible`]
126127
> * [`ExitCode`]
127-
> * `Result<(), E> where E: Debug`
128-
> * `Result<Infallible, E> where E: Debug`
129-
<!-- > * Result<!, E> where E: Debug` -->
128+
> * `Result<T, E> where T: Termination, E: Debug`
130129
131130
<!-- If the previous section needs updating (from "must take no arguments"
132131
onwards, also update it in the testing.md file -->
@@ -165,6 +164,7 @@ or `_` (U+005F) characters.
165164
[_shebang_]: https://en.wikipedia.org/wiki/Shebang_(Unix)
166165
[_utf8 byte order mark_]: https://en.wikipedia.org/wiki/Byte_order_mark#UTF-8
167166
[`ExitCode`]: ../std/process/struct.ExitCode.html
167+
[`Infallible`]: ../std/convert/enum.Infallible.html
168168
[`Termination`]: ../std/process/trait.Termination.html
169169
[attribute]: attributes.md
170170
[attributes]: attributes.md

src/destructors.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ smallest scope that contains the expression and is one of the following:
158158

159159
* The entire function body.
160160
* A statement.
161-
* The body of a [`if`], [`while`] or [`loop`] expression.
161+
* The body of an [`if`], [`while`] or [`loop`] expression.
162162
* The `else` block of an `if` expression.
163163
* The condition expression of an `if` or `while` expression, or a `match`
164164
guard.

0 commit comments

Comments
 (0)