diff --git a/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/endpoint/generators/EndpointResolverGenerator.kt b/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/endpoint/generators/EndpointResolverGenerator.kt index 385ab13240c99d7ab7eb7a04f708ec089ba44fa5..d4f3fe32f0421d2cd71b8b62738d993e6918f87e 100644 --- a/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/endpoint/generators/EndpointResolverGenerator.kt +++ b/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/endpoint/generators/EndpointResolverGenerator.kt @@ -221,7 +221,7 @@ internal class EndpointResolverGenerator(stdlib: List, ru private fun resolverFnBody(endpointRuleSet: EndpointRuleSet) = writable { endpointRuleSet.parameters.toList().forEach { - Attribute.AllowUnused.render(this) + Attribute.AllowUnusedVariables.render(this) rust("let ${it.memberName()} = &$ParamsName.${it.memberName()};") } generateRulesList(endpointRuleSet.rules)(this) @@ -291,7 +291,7 @@ internal class EndpointResolverGenerator(stdlib: List, ru fn.type() is Type.Option || // TODO(https://github.com/awslabs/smithy/pull/1504): ReterminusCore bug: substring should return `Option`: (fn as Function).name == "substring" -> { - Attribute.AllowUnused.render(this) + Attribute.AllowUnusedVariables.render(this) rustTemplate( "if let Some($resultName) = #{target:W} { #{next:W} }", "target" to target, diff --git a/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/rustlang/RustType.kt b/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/rustlang/RustType.kt index c39af9da0c53bb8a65e594eff0d2d063fba700f3..56ff3d7ef58ba3026a4c136ebb1c5675e6ae19d8 100644 --- a/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/rustlang/RustType.kt +++ b/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/rustlang/RustType.kt @@ -458,7 +458,6 @@ class Attribute(val inner: Writable) { val AllowDeprecated = Attribute(allow("deprecated")) val AllowIrrefutableLetPatterns = Attribute(allow("irrefutable_let_patterns")) val AllowUnreachableCode = Attribute(allow("unreachable_code")) - val AllowUnused = Attribute(allow("unused")) val AllowUnusedImports = Attribute(allow("unused_imports")) val AllowUnusedMut = Attribute(allow("unused_mut")) val AllowUnusedVariables = Attribute(allow("unused_variables")) diff --git a/codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/generators/ConstrainedBlobGenerator.kt b/codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/generators/ConstrainedBlobGenerator.kt index acaee289ae0e99fdea13689cd8499b68ff4e9574..0afeac0690cb04de7a65f5e84b8a3952681c8c6f 100644 --- a/codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/generators/ConstrainedBlobGenerator.kt +++ b/codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/generators/ConstrainedBlobGenerator.kt @@ -70,7 +70,7 @@ class ConstrainedBlobGenerator( constrainedTypeMetadata.render(writer) writer.rust("struct $name(pub(crate) $inner);") if (constrainedTypeVisibility == Visibility.PUBCRATE) { - Attribute.AllowUnused.render(writer) + Attribute.AllowDeadCode.render(writer) } writer.rust( """ diff --git a/codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/generators/ConstrainedCollectionGenerator.kt b/codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/generators/ConstrainedCollectionGenerator.kt index c31a215ddfc012fbe5b2a3134517a8ed510228da..8dc227e273cf698cc98b803e4f17ea2e20f7918f 100644 --- a/codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/generators/ConstrainedCollectionGenerator.kt +++ b/codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/generators/ConstrainedCollectionGenerator.kt @@ -95,7 +95,7 @@ class ConstrainedCollectionGenerator( *codegenScope, ) if (constrainedTypeVisibility == Visibility.PUBCRATE) { - Attribute.AllowUnused.render(writer) + Attribute.AllowDeadCode.render(writer) } writer.rustTemplate( diff --git a/codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/generators/ConstrainedMapGenerator.kt b/codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/generators/ConstrainedMapGenerator.kt index bf9dacdd60aa3d9184fb70ffcbfa3a3077104140..a8a891dc3aa50bb7955d4c17073522069e2f3e1d 100644 --- a/codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/generators/ConstrainedMapGenerator.kt +++ b/codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/generators/ConstrainedMapGenerator.kt @@ -80,7 +80,7 @@ class ConstrainedMapGenerator( constrainedTypeMetadata.render(writer) writer.rustTemplate("struct $name(pub(crate) $inner);", *codegenScope) if (constrainedTypeVisibility == Visibility.PUBCRATE) { - Attribute.AllowUnused.render(writer) + Attribute.AllowDeadCode.render(writer) } writer.rustTemplate( """ diff --git a/codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/generators/ConstrainedNumberGenerator.kt b/codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/generators/ConstrainedNumberGenerator.kt index 6e85ac5c8f77c64675d0a076061373c70f8b9f02..863f20af9b450a8ba423255a722b25cc2d86688d 100644 --- a/codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/generators/ConstrainedNumberGenerator.kt +++ b/codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/generators/ConstrainedNumberGenerator.kt @@ -100,7 +100,7 @@ class ConstrainedNumberGenerator( writer.rust("struct $name(pub(crate) $unconstrainedTypeName);") if (constrainedTypeVisibility == Visibility.PUBCRATE) { - Attribute.AllowUnused.render(writer) + Attribute.AllowDeadCode.render(writer) } writer.rustTemplate( """ diff --git a/codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/generators/ConstrainedStringGenerator.kt b/codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/generators/ConstrainedStringGenerator.kt index 2c7fcaa504310e69716b766a4b79933a007ea64f..8c2876f53f57b302a313f08854b96009d754a1e9 100644 --- a/codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/generators/ConstrainedStringGenerator.kt +++ b/codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/generators/ConstrainedStringGenerator.kt @@ -89,7 +89,7 @@ class ConstrainedStringGenerator( constrainedTypeMetadata.render(writer) writer.rust("struct $name(pub(crate) $inner);") if (constrainedTypeVisibility == Visibility.PUBCRATE) { - Attribute.AllowUnused.render(writer) + Attribute.AllowDeadCode.render(writer) } writer.rust( """