Skip to content

Commit d8c992a

Browse files
committed
feat(rationale): Cover why one edition changes another
1 parent 13702bb commit d8c992a

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

text/3772-build-target-edition.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,25 @@ A non-`None` edition will be considered deprecated
164164
# Rationale and alternatives
165165
[rationale-and-alternatives]: #rationale-and-alternatives
166166

167+
## One Edition field controlling another
168+
169+
The exact semantics of `package.edition` vs `<build-target>.edition` have not been well defined when it comes to the manifest format itself.
170+
171+
`package.edition`'s [documentation](https://doc.rust-lang.org/cargo/reference/manifest.html#the-edition-field) says:
172+
173+
> [it] affects which Rust Edition your package is compiled with
174+
175+
while `<build-target>.edition` [documentation](https://doc.rust-lang.org/cargo/reference/cargo-targets.html#the-edition-field) says:
176+
177+
> [it] defines the Rust edition the target will use
178+
179+
For Edition 2024, support for `<build-target>.proc_macro` and `<build-target>.crate_type`
180+
was removed based on `package.edition` and not `<build-target>.edition`.
181+
182+
By having `package.edition` affect `<build-target>.edition`,
183+
we are effectively saying that `package.edition` affects the manifest format
184+
while `<build-target>.edition` affects only affects the source code of the build-target.
185+
167186
# Prior art
168187
[prior-art]: #prior-art
169188

0 commit comments

Comments
 (0)