about summary refs log tree commit diff
path: root/src/doc
diff options
context:
space:
mode:
authorThe Miri Cronjob Bot <miri@cron.bot>2024-08-30 05:09:57 +0000
committerThe Miri Cronjob Bot <miri@cron.bot>2024-08-30 05:09:57 +0000
commit23f4eae905486ee02cecee1200fb8623a7ef376a (patch)
tree5ea72db01aae5b01c502d58a9d4f69cbfab321af /src/doc
parent0453d9bee8f7a6035d76baefce52b35db188387f (diff)
parent0d634185dfddefe09047881175f35c65d68dcff1 (diff)
downloadrust-23f4eae905486ee02cecee1200fb8623a7ef376a.tar.gz
rust-23f4eae905486ee02cecee1200fb8623a7ef376a.zip
Merge from rustc
Diffstat (limited to 'src/doc')
m---------src/doc/book0
m---------src/doc/edition-guide0
m---------src/doc/embedded-book0
m---------src/doc/nomicon0
m---------src/doc/reference0
m---------src/doc/rust-by-example0
m---------src/doc/rustc-dev-guide0
-rw-r--r--src/doc/rustc/src/check-cfg.md3
-rw-r--r--src/doc/unstable-book/src/compiler-flags/fmt-debug.md15
-rw-r--r--src/doc/unstable-book/src/compiler-flags/lint-llvm-ir.md7
-rw-r--r--src/doc/unstable-book/src/compiler-flags/sanitizer.md40
11 files changed, 57 insertions, 8 deletions
diff --git a/src/doc/book b/src/doc/book
-Subproject 04bc1396bb857f35b5dda1d773c9571e1f25330
+Subproject e7d217be2a75ef1753f0988d6ccaba4d7e37625
diff --git a/src/doc/edition-guide b/src/doc/edition-guide
-Subproject aeeb287d41a0332c210da122bea8e0e91844ab3
+Subproject eeba2cb9c37ab74118a4fb5e5233f7397e4a91f
diff --git a/src/doc/embedded-book b/src/doc/embedded-book
-Subproject 019f3928d8b939ec71b63722dcc2e4633015644
+Subproject ff5d61d56f11e1986bfa9652c6aff7731576c37
diff --git a/src/doc/nomicon b/src/doc/nomicon
-Subproject 6ecf95c5f2bfa0e6314dfe282bf775fd1405f7e
+Subproject 14649f15d232d509478206ee9ed5105641aa60d
diff --git a/src/doc/reference b/src/doc/reference
-Subproject 62cd0df95061ba0ac886333f5cd7f3012f149da
+Subproject 0668397076da350c404dadcf07b6cbc433ad374
diff --git a/src/doc/rust-by-example b/src/doc/rust-by-example
-Subproject 8f94061936e492159f4f6c09c0f917a7521893f
+Subproject 859786c5bc99301bbc22fc631a5c2b341860da0
diff --git a/src/doc/rustc-dev-guide b/src/doc/rustc-dev-guide
-Subproject 43d83780db545a1ed6d45773312fc578987e396
+Subproject fa928a6d19e1666d8d811dfe3fd35cdad3b4e45
diff --git a/src/doc/rustc/src/check-cfg.md b/src/doc/rustc/src/check-cfg.md
index dfc4871b924..992f14a79bf 100644
--- a/src/doc/rustc/src/check-cfg.md
+++ b/src/doc/rustc/src/check-cfg.md
@@ -99,7 +99,7 @@ the need to specify them manually.
 Well known names and values are implicitly added as long as at least one `--check-cfg` argument
 is present.
 
-As of `2024-05-06T`, the list of known names is as follows:
+As of `2024-08-20T`, the list of known names is as follows:
 
 <!--- See CheckCfg::fill_well_known in compiler/rustc_session/src/config.rs -->
 
@@ -107,6 +107,7 @@ As of `2024-05-06T`, the list of known names is as follows:
  - `debug_assertions`
  - `doc`
  - `doctest`
+ - `fmt_debug`
  - `miri`
  - `overflow_checks`
  - `panic`
diff --git a/src/doc/unstable-book/src/compiler-flags/fmt-debug.md b/src/doc/unstable-book/src/compiler-flags/fmt-debug.md
new file mode 100644
index 00000000000..bb8663dceae
--- /dev/null
+++ b/src/doc/unstable-book/src/compiler-flags/fmt-debug.md
@@ -0,0 +1,15 @@
+# `fmt-debug`
+
+The tracking issue for this feature is: [#129709](https://github.com/rust-lang/rust/issues/129709).
+
+------------------------
+
+Option `-Z fmt-debug=val` controls verbosity of derived `Debug` implementations
+and debug formatting in format strings (`{:?}`).
+
+* `full` — `#[derive(Debug)]` prints types recursively. This is the default behavior.
+
+* `shallow` — `#[derive(Debug)]` prints only the type name, or name of a variant of a fieldless enums. Details of the `Debug` implementation are not stable and may change in the future. Behavior of custom `fmt::Debug` implementations is not affected.
+
+* `none` — `#[derive(Debug)]` does not print anything at all. `{:?}` in formatting strings has no effect.
+  This option may reduce size of binaries, and remove occurrences of type names in the binary that are not removed by striping symbols. However, it may also cause `panic!` and `assert!` messages to be incomplete.
diff --git a/src/doc/unstable-book/src/compiler-flags/lint-llvm-ir.md b/src/doc/unstable-book/src/compiler-flags/lint-llvm-ir.md
new file mode 100644
index 00000000000..7b99c25a694
--- /dev/null
+++ b/src/doc/unstable-book/src/compiler-flags/lint-llvm-ir.md
@@ -0,0 +1,7 @@
+# `lint-llvm-ir`
+
+---------------------
+
+This flag will add `LintPass` to the start of the pipeline.
+You can use it to check for common errors in the LLVM IR generated by `rustc`.
+You can add `-Cllvm-args=-lint-abort-on-error` to abort the process if errors were found.
diff --git a/src/doc/unstable-book/src/compiler-flags/sanitizer.md b/src/doc/unstable-book/src/compiler-flags/sanitizer.md
index edc63a25ac1..24940f0d6fb 100644
--- a/src/doc/unstable-book/src/compiler-flags/sanitizer.md
+++ b/src/doc/unstable-book/src/compiler-flags/sanitizer.md
@@ -775,22 +775,47 @@ See the [Clang SafeStack documentation][clang-safestack] for more details.
 
 # ShadowCallStack
 
-ShadowCallStack provides backward edge control flow protection by storing a function's return address in a separately allocated 'shadow call stack' and loading the return address from that shadow call stack.
-
-ShadowCallStack requires a platform ABI which reserves `x18` as the instrumentation makes use of this register.
+ShadowCallStack provides backward edge control flow protection by storing a function's return address in a separately allocated 'shadow call stack'
+and loading the return address from that shadow call stack.
+AArch64 and RISC-V both have a platform register defined in their ABIs, which is `x18` and `x3`/`gp` respectively, that can optionally be reserved for this purpose.
+Software support from the operating system and runtime may be required depending on the target platform which is detailed in the remaining section.
+See the [Clang ShadowCallStack documentation][clang-scs] for more details.
 
 ShadowCallStack can be enabled with `-Zsanitizer=shadow-call-stack` option and is supported on the following targets:
 
-* `aarch64-linux-android`
+## AArch64 family
 
-A runtime must be provided by the application or operating system.
+ShadowCallStack requires the use of the ABI defined platform register, `x18`, which is required for code generation purposes.
+When `x18` is not reserved, and is instead used as a scratch register subsequently, enabling ShadowCallStack would lead to undefined behaviour
+due to corruption of return address or invalid memory access when the instrumentation restores return register to the link register `lr` from the
+already clobbered `x18` register.
+In other words, code that is calling into or called by functions instrumented with ShadowCallStack must reserve the `x18` register or preserve its value.
 
-See the [Clang ShadowCallStack documentation][clang-scs] for more details.
+### `aarch64-linux-android` and `aarch64-unknown-fuchsia`/`aarch64-fuchsia`
 
-* `aarch64-unknown-none`
+This target already reserves the `x18` register.
+A runtime must be provided by the application or operating system.
+If `bionic` is used on this target, the software support is provided.
+Otherwise, a runtime needs to prepare a memory region and points `x18` to the region which serves as the shadow call stack.
+
+### `aarch64-unknown-none`
 
 In addition to support from a runtime by the application or operating system, the `-Zfixed-x18` flag is also mandatory.
 
+## RISC-V 64 family
+
+ShadowCallStack uses either the `gp` register for software shadow stack, also known as `x3`, or the `ssp` register if [`Zicfiss`][riscv-zicfiss] extension is available.
+`gp`/`x3` is currently always reserved and available for ShadowCallStack instrumentation, and `ssp` in case of `Zicfiss` is only accessible through its dedicated shadow stack instructions.
+
+Support from the runtime and operating system is required when `gp`/`x3` is used for software shadow stack.
+A runtime must prepare a memory region and point `gp`/`x3` to the region before executing the code.
+
+The following targets support ShadowCallStack.
+
+* `riscv64imac-unknown-none-elf`
+* `riscv64gc-unknown-none-elf`
+* `riscv64gc-unknown-fuchsia`
+
 # ThreadSanitizer
 
 ThreadSanitizer is a data race detection tool. It is supported on the following
@@ -912,3 +937,4 @@ Sanitizers produce symbolized stacktraces when llvm-symbolizer binary is in `PAT
 [clang-tsan]: https://clang.llvm.org/docs/ThreadSanitizer.html
 [linux-kasan]: https://www.kernel.org/doc/html/latest/dev-tools/kasan.html
 [llvm-memtag]: https://llvm.org/docs/MemTagSanitizer.html
+[riscv-zicfiss]: https://github.com/riscv/riscv-cfi/blob/3f8e450c481ac303bd5643444f7a89672f24476e/src/cfi_backward.adoc