Skip to content

Commit bb8c034

Browse files
committed
Auto merge of #11676 - ehuss:unstable-codegen-fixup, r=weihanglo
Fix unstable chapter layout for codegen-backend The section for `codegen-backend` in the "Unstable features" chapter was placed in the wrong location (it was below the "stabilized features" list. Additionally, the `crate-type` feature was stabilized, but not removed from the unstable listing.
2 parents 36e1af6 + 36df689 commit bb8c034

File tree

1 file changed

+29
-31
lines changed

1 file changed

+29
-31
lines changed

src/doc/src/reference/unstable.md

+29-31
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ Each new feature described below should explain how to use it.
7878
* [build-std-features](#build-std-features) — Sets features to use with the standard library.
7979
* [binary-dep-depinfo](#binary-dep-depinfo) — Causes the dep-info file to track binary dependencies.
8080
* [panic-abort-tests](#panic-abort-tests) — Allows running tests with the "abort" panic strategy.
81-
* [crate-type](#crate-type) — Supports passing crate types to the compiler.
8281
* [keep-going](#keep-going) — Build as much as possible rather than aborting on the first error.
8382
* rustdoc
8483
* [`doctest-in-workspace`](#doctest-in-workspace) — Fixes workspace-relative paths when running doctests.
@@ -1231,6 +1230,35 @@ with a warning.
12311230
If you want to integrate with Cargo features, use `-Zcheck-cfg=features` instead of
12321231
trying to do it manually with this option.
12331232

1233+
### codegen-backend
1234+
1235+
The `codegen-backend` feature makes it possible to select the codegen backend used by rustc using a profile.
1236+
1237+
Example:
1238+
1239+
```toml
1240+
[package]
1241+
name = "foo"
1242+
1243+
[dependencies]
1244+
serde = "1.0.117"
1245+
1246+
[profile.dev.package.foo]
1247+
codegen-backend = "cranelift"
1248+
```
1249+
1250+
To set this in a profile in Cargo configuration, you need to use either
1251+
`-Z codegen-backend` or `[unstable]` table to enable it. For example,
1252+
1253+
```toml
1254+
# .cargo/config.toml
1255+
[unstable]
1256+
codegen-backend = true
1257+
1258+
[profile.dev.package.foo]
1259+
codegen-backend = "cranelift"
1260+
```
1261+
12341262
## Stabilized and removed features
12351263

12361264
### Compile progress
@@ -1349,36 +1377,6 @@ The `rust-version` field in `Cargo.toml` has been stabilized in the 1.56 release
13491377
See the [rust-version field](manifest.html#the-rust-version-field) for more
13501378
information on using the `rust-version` field and the `--ignore-rust-version` option.
13511379

1352-
### codegen-backend
1353-
1354-
The `codegen-backend` feature makes it possible to select the codegen backend used by rustc using a
1355-
profile.
1356-
1357-
Example:
1358-
1359-
```toml
1360-
[package]
1361-
name = "foo"
1362-
1363-
[dependencies]
1364-
serde = "1.0.117"
1365-
1366-
[profile.dev.package.foo]
1367-
codegen-backend = "cranelift"
1368-
```
1369-
1370-
To set this in a profile in Cargo configuration, you need to use either
1371-
`-Z codegen-backend` or `[unstable]` table to enable it. For example,
1372-
1373-
```toml
1374-
# .cargo/config.toml
1375-
[unstable]
1376-
codegen-backend = true
1377-
1378-
[profile.dev.package.foo]
1379-
codegen-backend = "cranelift"
1380-
```
1381-
13821380
### patch-in-config
13831381

13841382
The `-Z patch-in-config` flag, and the corresponding support for

0 commit comments

Comments
 (0)