diff --git a/rust/aspects.bzl b/rust/aspects.bzl index 42a28c07c9..95d76c5073 100644 --- a/rust/aspects.bzl +++ b/rust/aspects.bzl @@ -35,7 +35,7 @@ RustProtoInfo = provider( ) def label_to_crate_name(ctx, label, toolchain): - return str(label).rsplit(":", 1)[1].replace("-", "_") + return label.name.replace("-", "_") def proto_rust_toolchain_label(is_upb): if is_upb: