about summary refs log tree commit diff
path: root/src/doc
diff options
context:
space:
mode:
authorJamie Cunliffe <Jamie.Cunliffe@arm.com>2021-12-01 15:56:59 +0000
committerJamie Cunliffe <Jamie.Cunliffe@arm.com>2021-12-01 15:56:59 +0000
commit984ca4689dbceea29bbfcf54c4743b45fccf7ad1 (patch)
tree50e979ae7eed117e44f6bce9a82003fe0270f51c /src/doc
parent837cc1687f7c0d35a4e90a2f6bee377b5a2ecfd5 (diff)
downloadrust-984ca4689dbceea29bbfcf54c4743b45fccf7ad1.tar.gz
rust-984ca4689dbceea29bbfcf54c4743b45fccf7ad1.zip
Review comments
- Changed the separator from '+' to ','.
- Moved the branch protection options from -C to -Z.
- Additional test for incorrect branch-protection option.
- Remove LLVM < 12 code.
- Style fixes.

Co-authored-by: James McGregor <james.mcgregor2@arm.com>
Diffstat (limited to 'src/doc')
-rw-r--r--src/doc/rustc/src/codegen-options/index.md23
-rw-r--r--src/doc/unstable-book/src/compiler-flags/branch-protection.md18
2 files changed, 18 insertions, 23 deletions
diff --git a/src/doc/rustc/src/codegen-options/index.md b/src/doc/rustc/src/codegen-options/index.md
index 484242d86fe..0201b88417a 100644
--- a/src/doc/rustc/src/codegen-options/index.md
+++ b/src/doc/rustc/src/codegen-options/index.md
@@ -7,29 +7,6 @@ a version of this list for your exact compiler by running `rustc -C help`.
 
 This option is deprecated and does nothing.
 
-## branch-protection
-
-This option lets you enable branch authentication instructions on AArch64.
-This option is ignored for non-AArch64 architectures.
-It takes some combination of the following values, separated by a `+`.
-
-- `pac-ret` - Enable pointer authentication for non-leaf functions.
-- `leaf` - Enable pointer authentication for all functions, including leaf functions.
-- `b-key` - Sign return addresses with key B, instead of the default key A.
-- `bti` - Enable branch target identification.
-
-`leaf` and `b-key` are only valid if `pac-ret` was previously specified.
-For example, `-C branch-protection=bti+pac-ret+leaf` is valid, but
-`-C branch-protection=bti+leaf+pac-ret` is not.
-
-Repeated values are ignored.
-For example, `-C branch-protection=pac-ret+leaf+pac-ret` is equivalent to
-`-C branch-protection=pac-ret+leaf`.
-
-Rust's standard library does not ship with BTI or pointer authentication enabled by default. \
-In Cargo projects the standard library can be recompiled with pointer authentication using the nightly
-[build-std](https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#build-std) feature.
-
 ## code-model
 
 This option lets you choose which code model to use. \
diff --git a/src/doc/unstable-book/src/compiler-flags/branch-protection.md b/src/doc/unstable-book/src/compiler-flags/branch-protection.md
new file mode 100644
index 00000000000..85403748e1d
--- /dev/null
+++ b/src/doc/unstable-book/src/compiler-flags/branch-protection.md
@@ -0,0 +1,18 @@
+# `branch-protection`
+
+This option lets you enable branch authentication instructions on AArch64.
+This option is ignored for non-AArch64 architectures.
+It takes some combination of the following values, separated by a `,`.
+
+- `pac-ret` - Enable pointer authentication for non-leaf functions.
+- `leaf` - Enable pointer authentication for all functions, including leaf functions.
+- `b-key` - Sign return addresses with key B, instead of the default key A.
+- `bti` - Enable branch target identification.
+
+`leaf` and `b-key` are only valid if `pac-ret` was previously specified.
+For example, `-Z branch-protection=bti,pac-ret,leaf` is valid, but
+`-Z branch-protection=bti,leaf,pac-ret` is not.
+
+Rust's standard library does not ship with BTI or pointer authentication enabled by default.
+In Cargo projects the standard library can be recompiled with pointer authentication using the nightly
+[build-std](https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#build-std) feature.