Skip to content

setter method (set_meta) conflicts with built in set_meta for error metadata in generated client #4338

@nated0g

Description

@nated0g

When using rust-client-codegen, if you have a shape like:

structure Foo {
   meta: Bar
}

The struct member meta: Option<Bar> would conflict with the built in meta: ::aws_smithy_types::error::ErrorMetadata, and so it is correctly substituted as meta_value: Option<Bar>.

(reference:

)

however, the generated setter method on the builder does not get renamed, and so duplicate set_meta methods are added to the impl block.

(reference:

fun MemberShape.setterName() = "set_${this.memberName.toSnakeCase()}"
)

This leads to an invalid crate which will fail to compile with the following error:

error[E0592]: duplicate definitions with name `set_meta`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions