Skip to content

Fix tests and update to 2021 #1499

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .github/workflows/rbe.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Install Rust
run: |
rustup set profile minimal
rustup toolchain install stable -c rust-docs
rustup toolchain install nightly -c rust-docs
rustup default nightly

- name: Install mdbook
Expand All @@ -35,6 +35,12 @@ jobs:
- name: Build HTML
run: mdbook build

- name: Check for broken links
run: |
curl -sSLo linkcheck.sh \
https://raw.githubusercontent.com/rust-lang/rust/master/src/tools/linkchecker/linkcheck.sh
sh linkcheck.sh --all rust-by-example

- name: Upload Artifact
uses: actions/upload-artifact@v1
with:
Expand Down
3 changes: 3 additions & 0 deletions book.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@ enable = true

[output.html]
git-repository-url = "https://github.com/rust-lang/rust-by-example"

[rust]
edition = "2021"
2 changes: 1 addition & 1 deletion src/error/result/enter_question_mark.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ The `?` operator is now recommended, but you may still find `try!` when looking
at older code. The same `multiply` function from the previous example
would look like this using `try!`:

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

Expand Down
2 changes: 1 addition & 1 deletion src/fn/closures/closure_examples/iter_any.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ fn main() {
// `iter()` for arrays yields `&i32`.
println!("2 in array1: {}", array1.iter() .any(|&x| x == 2));
// `into_iter()` for arrays unusually yields `&i32`.
println!("2 in array2: {}", array2.into_iter().any(|&x| x == 2));
println!("2 in array2: {}", array2.iter().any(|&x| x == 2));
}
```

Expand Down
2 changes: 1 addition & 1 deletion src/generics/assoc_items/types.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ trait Contains {
type B;

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

Expand Down
4 changes: 3 additions & 1 deletion src/unsafe/asm.md
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,9 @@ assert_eq!(x, 4 * 6);

## Symbol operands and ABI clobbers

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.
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.

[`clobber_abi`]: ../../reference/inline-assembly.html#abi-clobbers

```rust
use std::arch::asm;
Expand Down