From 315b2fb2bd2ec90feefeeaf6c5a01d87bc359909 Mon Sep 17 00:00:00 2001 From: funkill2 Date: Sun, 19 May 2024 04:00:04 +0300 Subject: [PATCH] update original --- rust-by-example/.github/workflows/rbe.yml | 21 +++++++++------------ rust-by-example/src/unsafe/asm.md | 2 +- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/rust-by-example/.github/workflows/rbe.yml b/rust-by-example/.github/workflows/rbe.yml index 7169ba8..0695b45 100644 --- a/rust-by-example/.github/workflows/rbe.yml +++ b/rust-by-example/.github/workflows/rbe.yml @@ -27,7 +27,7 @@ jobs: - name: Install mdbook run: | mkdir bin - curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.4.15/mdbook-v0.4.15-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=bin + curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.4.37/mdbook-v0.4.37-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=bin echo "$(pwd)/bin" >> ${GITHUB_PATH} - name: Install mdbook-i18n-helpers @@ -55,25 +55,22 @@ jobs: - name: Build all translations run: | for po_lang in ${{ env.LANGUAGES }}; do - POT_CREATION_DATE=$(grep --max-count 1 '^"POT-Creation-Date:' po/$po_lang.po | sed -E 's/".*: (.*)\\n"/\1/') - if [[ $POT_CREATION_DATE == "" ]]; then - POT_CREATION_DATE=now - fi - - echo "::group::Building $po_lang translation as of $POT_CREATION_DATE" - rm -r src/ - git restore --source "$(git rev-list -n 1 --before "$POT_CREATION_DATE" @)" src/ - + echo "::group::Building $po_lang translation" # Set language and adjust site URL. Clear the redirects # since they are in sync with the source files, not the # translation. MDBOOK_BOOK__LANGUAGE=$po_lang \ - MDBOOK_OUTPUT__HTML__SITE_URL=/rust-by-example/$po_lang/ \ - MDBOOK_OUTPUT__HTML__REDIRECT='{}' \ mdbook build -d book/$po_lang echo "::endgroup::" done + - name: Check all translations for broken links + run: | + for po_lang in ${{ env.LANGUAGES }}; do + MDBOOK_BOOK__LANGUAGE=$po_lang \ + sh linkcheck.sh --all rust-by-example + done + - name: Upload Artifact uses: actions/upload-artifact@v3 with: diff --git a/rust-by-example/src/unsafe/asm.md b/rust-by-example/src/unsafe/asm.md index 176b38a..5a63099 100644 --- a/rust-by-example/src/unsafe/asm.md +++ b/rust-by-example/src/unsafe/asm.md @@ -446,7 +446,7 @@ This example shows a few things: [local labels]: https://sourceware.org/binutils/docs/as/Symbol-Names.html#Local-Labels [an LLVM bug]: https://bugs.llvm.org/show_bug.cgi?id=36144 -## Options +## Options {#options} By default, an inline assembly block is treated the same way as an external FFI function call with a custom calling convention: it may read/write memory, have observable side effects, etc. However, in many cases it is desirable to give the compiler more information about what the assembly code is actually doing so that it can optimize better.