Skip to content

Commit 5d50c37

Browse files
committed
Merge commit '3e9dc46' into 2024-edition
2 parents a3a9f9c + 3e9dc46 commit 5d50c37

File tree

2,538 files changed

+149598
-16930
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,538 files changed

+149598
-16930
lines changed
File renamed without changes.

.git-blame-ignore-revs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Ran dprint fmt on the repo
2+
3a30e4c1fbe641afc066b3af9eb01dcdf5ed8b24
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
---
5+
6+
- I have searched open and closed issues and pull requests for duplicates, using these search terms:
7+
-
8+
-
9+
-
10+
- I have checked the latest `main` branch to see if this has already been fixed, in this file:
11+
-
12+
13+
URL to the section(s) of the book with this problem:
14+
15+
Description of the problem:
16+
17+
Suggested fix:

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 0 additions & 20 deletions
This file was deleted.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
name: New translation
3+
about: Let us know of a new language translation you're working on
4+
---
5+
6+
Language your translation is for:
7+
URL to the repo where you're working:

.github/ISSUE_TEMPLATE/章節審核.md

Lines changed: 0 additions & 20 deletions
This file was deleted.

.github/workflows/main.yml

Lines changed: 97 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,104 @@
1-
name: Rust Book
2-
3-
on:
4-
push:
5-
branches:
6-
- zh_tw
1+
name: CI
2+
on: [push, pull_request]
73

84
jobs:
9-
deploy:
5+
test:
6+
name: Run tests
107
runs-on: ubuntu-latest
118
steps:
12-
- name: Checkout
13-
uses: actions/checkout@v2
14-
9+
- uses: actions/checkout@master
10+
- name: Update rustup
11+
run: rustup self update
12+
- name: Install Rust
13+
run: |
14+
rustup set profile minimal
15+
rustup toolchain install 1.85 -c rust-docs
16+
rustup default 1.85
1517
- name: Install mdbook
1618
run: |
17-
mkdir mdbook
18-
curl -Lf https://github.com/rust-lang/mdBook/releases/download/v0.4.21/mdbook-v0.4.21-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=./mdbook
19-
echo `pwd`/mdbook >> $GITHUB_PATH
20-
21-
- name: Generate book
22-
run: mdbook build
19+
mkdir bin
20+
curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.4.45/mdbook-v0.4.45-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=bin
21+
echo "$(pwd)/bin" >> "${GITHUB_PATH}"
22+
- name: Report versions
23+
run: |
24+
rustup --version
25+
rustc -Vv
26+
mdbook --version
2327
24-
# HTML publication as Github Page
25-
- name: Publish HTML
26-
uses: peaceiris/actions-gh-pages@v3
27-
with:
28-
github_token: ${{ secrets.GITHUB_TOKEN }}
29-
publish_dir: ./book
28+
# mdBook does not currently have particularly good support for “external”
29+
# crates. To make the test suite work correctly with `trpl`, we must first
30+
# build `trpl` itself (`mdbook` will not do it), and then explicitly pass
31+
# its `deps` path as a library search path for `mdbook test`. That will make
32+
# sure all the crates can be resolved when running the tests.
33+
- name: Build `trpl` crate
34+
run: |
35+
cd packages/trpl
36+
cargo build
37+
- name: Run tests
38+
run:
39+
mdbook test --library-path packages/trpl/target/debug/deps
40+
package_tests:
41+
name: Run package tests
42+
runs-on: ubuntu-latest
43+
steps:
44+
- uses: actions/checkout@master
45+
- name: Update rustup
46+
run: rustup self update
47+
- name: Install Rust
48+
run: |
49+
rustup set profile minimal
50+
rustup toolchain install 1.85 -c rust-docs
51+
rustup default 1.85
52+
- name: Run `tools` package tests
53+
run: |
54+
cargo test
55+
- name: Run `mdbook-trpl` package tests
56+
working-directory: packages/mdbook-trpl
57+
run: |
58+
cargo test
59+
lint:
60+
name: Run lints
61+
runs-on: ubuntu-latest
62+
steps:
63+
- uses: actions/checkout@master
64+
- name: Update rustup
65+
run: rustup self update
66+
- name: Install Rust
67+
run: |
68+
rustup set profile minimal
69+
rustup toolchain install nightly -c rust-docs
70+
rustup override set nightly
71+
- name: Install mdbook
72+
run: |
73+
mkdir bin
74+
curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.4.45/mdbook-v0.4.45-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=bin
75+
echo "$(pwd)/bin" >> "${GITHUB_PATH}"
76+
- name: Install mdbook-trpl binaries
77+
run: cargo install --path packages/mdbook-trpl
78+
- name: Install aspell
79+
run: sudo apt-get install aspell
80+
- name: Install shellcheck
81+
run: sudo apt-get install shellcheck
82+
- name: Report versions
83+
run: |
84+
rustup --version
85+
rustc -Vv
86+
mdbook --version
87+
aspell --version
88+
shellcheck --version
89+
- name: Shellcheck
90+
run: find . -name '*.sh' -print0 | xargs -0 shellcheck
91+
- name: Spellcheck
92+
run: bash ci/spellcheck.sh list
93+
- name: Lint for local file paths
94+
run: |
95+
mdbook build
96+
cargo run --bin lfp src
97+
- name: Validate references
98+
run: bash ci/validate.sh
99+
- name: Check for broken links
100+
run: |
101+
curl -sSLo linkcheck.sh \
102+
https://raw.githubusercontent.com/rust-lang/rust/master/src/tools/linkchecker/linkcheck.sh
103+
# Cannot use --all here because of the generated redirect pages aren't available.
104+
sh linkcheck.sh book

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,6 @@ book/
55
target
66
tmp
77

8+
.nova
9+
.vscode
10+
.zed

2018-edition/book.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[book]
2+
title = "The Rust Programming Language"
3+
author = "Steve Klabnik and Carol Nichols, with Contributions from the Rust Community"
4+
5+
[output.html]
6+
additional-css = ["ferris.css"]
7+
additional-js = ["ferris.js"]

2018-edition/dot/trpl04-01.dot

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
digraph {
2+
rankdir=LR;
3+
overlap=false;
4+
dpi=300.0;
5+
node [shape="plaintext"];
6+
7+
table0[label=<<TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0">
8+
<TR><TD COLSPAN="2" SIDES="B">s1</TD></TR>
9+
<TR><TD>name</TD><TD>value</TD></TR>
10+
<TR><TD>ptr</TD><TD PORT="pointer"></TD></TR>
11+
<TR><TD>len</TD><TD>5</TD></TR>
12+
<TR><TD>capacity</TD><TD>5</TD></TR>
13+
</TABLE>>];
14+
table1[label=<<TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0">
15+
<TR><TD>index</TD><TD>value</TD></TR>
16+
<TR><TD PORT="pointee">0</TD><TD>h</TD></TR>
17+
<TR><TD>1</TD><TD>e</TD></TR>
18+
<TR><TD>2</TD><TD>l</TD></TR>
19+
<TR><TD>3</TD><TD>l</TD></TR>
20+
<TR><TD>4</TD><TD>o</TD></TR>
21+
</TABLE>>];
22+
23+
edge[tailclip="false"];
24+
table0:pointer:c -> table1:pointee;
25+
}
26+

0 commit comments

Comments
 (0)