Skip to content

Commit cacf1c4

Browse files
committed
Add note about generated code.
1 parent 2187a65 commit cacf1c4

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/editions/advanced-migrations.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,11 @@ If your documentation tests use syntax that is not supported in the new edition,
121121
In rare cases, you can manually set the edition for each test.
122122
For example, you can use the [`edition2018` annotation][rustdoc-annotation] on the triple backticks to tell `rustdoc` which edition to use.
123123

124+
## Generated code
125+
126+
Another area where the automated fixes cannot apply is if you have a build script which generates Rust code at compile time (see [Code generation] for an example).
127+
In this situation, if you end up with code that doesn't work in the next edition, you will need to manually change the build script to generate code that is compatible.
128+
124129
## Writing idiomatic code in a new edition
125130

126131
Editions are not only about new features and removing old ones.
@@ -168,6 +173,7 @@ We're now more idiomatic, and we didn't have to fix our code manually!
168173
[Cargo package]: ../../cargo/reference/manifest.html#the-package-section
169174
[Cargo targets]: ../../cargo/reference/cargo-targets.html
170175
[Cargo workspace]: ../../cargo/reference/workspaces.html
176+
[Code generation]: ../../cargo/reference/build-script-examples.html#code-generation
171177
[conditional compilation]: ../../reference/conditional-compilation.html
172178
[documentation tests]: ../../rustdoc/documentation-tests.html
173179
[lint group]: ../../rustc/lints/groups.html

0 commit comments

Comments
 (0)