Repository: smithy-lang/smithy-rs (language: rust)

Issue:
add #[forbid(unsafe)] to generated code



Discussion / hints:

Fix patch:
diff --git a/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/generators/LibRsGenerator.kt b/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/generators/LibRsGenerator.kt
index 85fc05ee98..24beaa51d8 100644
--- a/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/generators/LibRsGenerator.kt
+++ b/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/generators/LibRsGenerator.kt
@@ -51,6 +51,7 @@ class LibRsGenerator(
     fun render(writer: RustWriter) {
         writer.first {
             customizations.forEach { it.section(LibRsSection.Attributes)(this) }
+            rust("##![forbid(unsafe_code)]")
             if (requireDocs) {
                 rust("##![warn(missing_docs)]")
             }


Test patch: