From 58c46b12ff13bf1053fda49edf20c99bbb2975ab Mon Sep 17 00:00:00 2001 From: Ed Page Date: Mon, 10 Mar 2025 15:01:44 -0500 Subject: [PATCH 1/2] docs(ref): Move target-edition to last --- src/doc/src/reference/cargo-targets.md | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/doc/src/reference/cargo-targets.md b/src/doc/src/reference/cargo-targets.md index 8a4ed59e54b..1e8ee7cc4d5 100644 --- a/src/doc/src/reference/cargo-targets.md +++ b/src/doc/src/reference/cargo-targets.md @@ -268,14 +268,6 @@ to run tests and benchmarks. Tests have the [`cfg(test)` conditional expression][cfg-test] enabled whether or not the harness is enabled. -### The `edition` field - -The `edition` field defines the [Rust edition] the target will use. If not -specified, it defaults to the [`edition` field][package-edition] for the -`[package]`. This field should usually not be set, and is only intended for -advanced scenarios such as incrementally transitioning a large package to a -new edition. - ### The `crate-type` field The `crate-type` field defines the [crate types] that will be generated by the @@ -313,6 +305,13 @@ name = "my-pg-tool" required-features = ["postgres", "tools"] ``` +### The `edition` field + +The `edition` field defines the [Rust edition] the target will use. If not +specified, it defaults to the [`edition` field][package-edition] for the +`[package]`. This field should usually not be set, and is only intended for +advanced scenarios such as incrementally transitioning a large package to a +new edition. ## Target auto-discovery From 5ff2960960b1e2fc69f0a45119928e6a9d26fef5 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Mon, 10 Mar 2025 15:03:03 -0500 Subject: [PATCH 2/2] docs(ref): Note that target-edition is deprecated Leaving off any talk of it being removed until we know the edition. This is the first step in implementing rust-lang/rfcs#3772 (tracking issue #15283) --- src/doc/src/reference/cargo-targets.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/doc/src/reference/cargo-targets.md b/src/doc/src/reference/cargo-targets.md index 1e8ee7cc4d5..160988ca9f0 100644 --- a/src/doc/src/reference/cargo-targets.md +++ b/src/doc/src/reference/cargo-targets.md @@ -186,7 +186,6 @@ bench = true # Is benchmarked by default. doc = true # Is documented by default. proc-macro = false # Set to `true` for a proc-macro library. harness = true # Use libtest harness. -edition = "2015" # The edition of the target. crate-type = ["lib"] # The crate types to generate. required-features = [] # Features required to build this target (N/A for lib). ``` @@ -309,9 +308,9 @@ required-features = ["postgres", "tools"] The `edition` field defines the [Rust edition] the target will use. If not specified, it defaults to the [`edition` field][package-edition] for the -`[package]`. This field should usually not be set, and is only intended for -advanced scenarios such as incrementally transitioning a large package to a -new edition. +`[package]`. + +> **Note:** This field is deprecated and will be removed in a future Edition ## Target auto-discovery