Skip to content

Commit 5b5f201

Browse files
update
1 parent 1c24991 commit 5b5f201

File tree

1 file changed

+22
-0
lines changed
  • codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/generators

1 file changed

+22
-0
lines changed

codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/generators/LibRsGenerator.kt

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ sealed class ModuleDocSection {
2222
data class ServiceDocs(val documentationTraitValue: String?) : ModuleDocSection()
2323
object CrateOrganization : ModuleDocSection()
2424
object Examples : ModuleDocSection()
25+
object UnstableFeature : ModuleDocSection()
2526
}
2627

2728
sealed class LibRsSection(name: String) : Section(name) {
@@ -62,6 +63,27 @@ class LibRsGenerator(
6263
containerDocs(escape(defaultServiceDocs ?: settings.moduleName))
6364
}
6465

66+
// Unstable Feature
67+
docSection(ModuleDocSection.UnstableFeature).also { docs ->
68+
if (docs.isNotEmpty()) {
69+
containerDocs("\n## Unstable Features")
70+
val awsSdkUnstable = """
71+
Some highly experimental features requires passing `aws_sdk_unstable` to RUSTFLAGS.
72+
e.g.
73+
```bash
74+
export RUSTFLAGS="--cfg aws_sdk_unstable"
75+
cargo build --features serde-serialize
76+
```
77+
78+
If you enable unstable features without enabling `RUSTFLAGS="--cfg aws_sdk_unstable"`, compilation will fail with a message detailing the reason.
79+
""".trimIndent()
80+
containerDocs(awsSdkUnstable)
81+
docs.forEach { writeTo ->
82+
writeTo(this)
83+
}
84+
}
85+
}
86+
6587
// Crate Organization
6688
docSection(ModuleDocSection.CrateOrganization).also { docs ->
6789
if (docs.isNotEmpty()) {

0 commit comments

Comments
 (0)