Skip to content

Commit d14dba1

Browse files
committed
Auto merge of #28782 - steveklabnik:rollup, r=steveklabnik
- Successful merges: #28753, #28760, #28764, #28770, #28771, #28772 - Failed merges:
2 parents 1c788d0 + f8c8c8c commit d14dba1

File tree

4 files changed

+33
-26
lines changed

4 files changed

+33
-26
lines changed

src/doc/reference.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,13 @@ An identifier is any nonempty Unicode[^non_ascii_idents] string of the following
7676
[^non_ascii_idents]: Non-ASCII characters in identifiers are currently feature
7777
gated. This is expected to improve soon.
7878

79-
- The first character has property `XID_start`
80-
- The remaining characters have property `XID_continue`
79+
Either
80+
* The first character has property `XID_start`
81+
* The remaining characters have property `XID_continue`
82+
Or
83+
* The first character is `_`
84+
* The identifier is more than one character, `_` alone is not an identifier
85+
* The remaining characters have property `XID_continue`
8186

8287
that does _not_ occur in the set of [keywords][keywords].
8388

@@ -3937,11 +3942,11 @@ initialized; this is enforced by the compiler.
39373942
The Rust compiler supports various methods to link crates together both
39383943
statically and dynamically. This section will explore the various methods to
39393944
link Rust crates together, and more information about native libraries can be
3940-
found in the [ffi section of the book][ffi].
3945+
found in the [FFI section of the book][ffi].
39413946

39423947
In one session of compilation, the compiler can generate multiple artifacts
39433948
through the usage of either command line flags or the `crate_type` attribute.
3944-
If one or more command line flag is specified, all `crate_type` attributes will
3949+
If one or more command line flags are specified, all `crate_type` attributes will
39453950
be ignored in favor of only building the artifacts specified by command line.
39463951

39473952
* `--crate-type=bin`, `#[crate_type = "bin"]` - A runnable executable will be
@@ -3987,7 +3992,7 @@ Note that these outputs are stackable in the sense that if multiple are
39873992
specified, then the compiler will produce each form of output at once without
39883993
having to recompile. However, this only applies for outputs specified by the
39893994
same method. If only `crate_type` attributes are specified, then they will all
3990-
be built, but if one or more `--crate-type` command line flag is specified,
3995+
be built, but if one or more `--crate-type` command line flags are specified,
39913996
then only those outputs will be built.
39923997

39933998
With all these different kinds of outputs, if crate A depends on crate B, then

src/doc/trpl/no-stdlib.md

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,6 @@ By default, `std` is linked to every Rust crate. In some contexts,
44
this is undesirable, and can be avoided with the `#![no_std]`
55
attribute attached to the crate.
66

7-
```ignore
8-
// a minimal library
9-
#![crate_type="lib"]
10-
#![feature(no_std)]
11-
#![no_std]
12-
# // fn main() {} tricked you, rustdoc!
13-
```
14-
157
Obviously there's more to life than just libraries: one can use
168
`#[no_std]` with an executable, controlling the entry point is
179
possible in two ways: the `#[start]` attribute, or overriding the
@@ -21,7 +13,10 @@ The function marked `#[start]` is passed the command line parameters
2113
in the same format as C:
2214

2315
```rust
24-
#![feature(lang_items, start, no_std, libc)]
16+
# #![feature(libc)]
17+
#![feature(lang_items)]
18+
#![feature(start)]
19+
#![feature(no_std)]
2520
#![no_std]
2621

2722
// Pull in the system libc library for what crt0.o likely requires
@@ -47,11 +42,13 @@ with `#![no_main]` and then create the appropriate symbol with the
4742
correct ABI and the correct name, which requires overriding the
4843
compiler's name mangling too:
4944

50-
```ignore
45+
```rust
46+
# #![feature(libc)]
5147
#![feature(no_std)]
48+
#![feature(lang_items)]
49+
#![feature(start)]
5250
#![no_std]
5351
#![no_main]
54-
#![feature(lang_items, start)]
5552

5653
extern crate libc;
5754

@@ -92,19 +89,24 @@ instead.
9289

9390
The core library has very few dependencies and is much more portable than the
9491
standard library itself. Additionally, the core library has most of the
95-
necessary functionality for writing idiomatic and effective Rust code.
92+
necessary functionality for writing idiomatic and effective Rust code. When
93+
using `#![no_std]`, Rust will automatically inject the `core` crate, just like
94+
we do for `std` when we’re using it.
9695

9796
As an example, here is a program that will calculate the dot product of two
9897
vectors provided from C, using idiomatic Rust practices.
9998

100-
```ignore
101-
#![feature(lang_items, start, no_std, core, libc)]
99+
```rust
100+
# #![feature(libc)]
101+
#![feature(lang_items)]
102+
#![feature(start)]
103+
#![feature(no_std)]
104+
#![feature(core)]
105+
#![feature(core_slice_ext)]
106+
#![feature(raw)]
102107
#![no_std]
103108

104-
# extern crate libc;
105-
extern crate core;
106-
107-
use core::prelude::*;
109+
extern crate libc;
108110

109111
use core::mem;
110112

src/doc/trpl/the-stack-and-the-heap.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ and just consider the local variables we’re allocating. So in this case, when
4141
This is automatically handled for you, as you can see; we didn’t have to write
4242
any special Rust code or anything.
4343

44-
When the function is over, its stack frame gets deallocated. This happens
45-
automatically, we didn’t have to do anything special here.
44+
When the function exits, its stack frame gets deallocated. This happens
45+
automatically as well.
4646

4747
That’s all there is for this simple program. The key thing to understand here
4848
is that stack allocation is very, very fast. Since we know all the local

src/libcore/cmp.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ impl PartialOrd for Ordering {
218218
///
219219
/// The comparison must satisfy, for all `a`, `b` and `c`:
220220
///
221-
/// - antisymmetry: if `a < b` then `!(a > b)` and vice versa; and
221+
/// - antisymmetry: if `a < b` then `!(a > b)`, as well as `a > b` implying `!(a < b)`; and
222222
/// - transitivity: `a < b` and `b < c` implies `a < c`. The same must hold for both `==` and `>`.
223223
///
224224
/// Note that these requirements mean that the trait itself must be implemented symmetrically and

0 commit comments

Comments
 (0)