Skip to content

Commit 18c0055

Browse files
authored
Merge pull request #1499 from ehuss/fix-ci
Fix tests and update to 2021
2 parents 7b4dbc5 + e3f7d46 commit 18c0055

File tree

6 files changed

+16
-5
lines changed

6 files changed

+16
-5
lines changed

.github/workflows/rbe.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
- name: Install Rust
1515
run: |
1616
rustup set profile minimal
17-
rustup toolchain install stable -c rust-docs
17+
rustup toolchain install nightly -c rust-docs
1818
rustup default nightly
1919
2020
- name: Install mdbook
@@ -35,6 +35,12 @@ jobs:
3535
- name: Build HTML
3636
run: mdbook build
3737

38+
- name: Check for broken links
39+
run: |
40+
curl -sSLo linkcheck.sh \
41+
https://raw.githubusercontent.com/rust-lang/rust/master/src/tools/linkchecker/linkcheck.sh
42+
sh linkcheck.sh --all rust-by-example
43+
3844
- name: Upload Artifact
3945
uses: actions/upload-artifact@v1
4046
with:

book.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,6 @@ enable = true
1212

1313
[output.html]
1414
git-repository-url = "https://github.com/rust-lang/rust-by-example"
15+
16+
[rust]
17+
edition = "2021"

src/error/result/enter_question_mark.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ The `?` operator is now recommended, but you may still find `try!` when looking
4343
at older code. The same `multiply` function from the previous example
4444
would look like this using `try!`:
4545

46-
```rust,editable
46+
```rust,editable,edition2015
4747
// To compile and run this example without errors, while using Cargo, change the value
4848
// of the `edition` field, in the `[package]` section of the `Cargo.toml` file, to "2015".
4949

src/fn/closures/closure_examples/iter_any.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ fn main() {
3535
// `iter()` for arrays yields `&i32`.
3636
println!("2 in array1: {}", array1.iter() .any(|&x| x == 2));
3737
// `into_iter()` for arrays unusually yields `&i32`.
38-
println!("2 in array2: {}", array2.into_iter().any(|&x| x == 2));
38+
println!("2 in array2: {}", array2.iter().any(|&x| x == 2));
3939
}
4040
```
4141

src/generics/assoc_items/types.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ trait Contains {
1313
type B;
1414

1515
// Updated syntax to refer to these new types generically.
16-
fn contains(&self, &Self::A, &Self::B) -> bool;
16+
fn contains(&self, _: &Self::A, _: &Self::B) -> bool;
1717
}
1818
```
1919

src/unsafe/asm.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,9 @@ assert_eq!(x, 4 * 6);
285285

286286
## Symbol operands and ABI clobbers
287287

288-
By default, `asm!` assumes that any register not specified as an output will have its contents preserved by the assembly code. The [`clobber_abi`](#abi-clobbers) argument to `asm!` tells the compiler to automatically insert the necessary clobber operands according to the given calling convention ABI: any register which is not fully preserved in that ABI will be treated as clobbered. Multiple `clobber_abi` arguments may be provided and all clobbers from all specified ABIs will be inserted.
288+
By default, `asm!` assumes that any register not specified as an output will have its contents preserved by the assembly code. The [`clobber_abi`] argument to `asm!` tells the compiler to automatically insert the necessary clobber operands according to the given calling convention ABI: any register which is not fully preserved in that ABI will be treated as clobbered. Multiple `clobber_abi` arguments may be provided and all clobbers from all specified ABIs will be inserted.
289+
290+
[`clobber_abi`]: ../../reference/inline-assembly.html#abi-clobbers
289291

290292
```rust
291293
use std::arch::asm;

0 commit comments

Comments
 (0)