You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Auto merge of #12783 - dvdhrm:pr/libname2, r=ehuss
cargo: prevent dashes in lib.name
The TOML parser of Cargo currently refuses `lib.name` entries that contain dashes. Unfortunately, it uses the package-name as default if no explicit `lib.name` entry is specified. This package-name, however, can contain dashes.
Cargo documentation states that the package name is converted first, yet this was never implemented by the code-base.
Fix this inconsistency and convert the package name to a suitable crate-name first.
This fixes#12780. It is an alternative to #12640.
Copy file name to clipboardExpand all lines: tests/testsuite/collisions.rs
+1-1
Original file line number
Diff line number
Diff line change
@@ -550,7 +550,7 @@ fn collision_with_root() {
550
550
[DOWNLOADING] crates ...
551
551
[DOWNLOADED] foo-macro v1.0.0 [..]
552
552
warning: output filename collision.
553
-
The lib target `foo-macro` in package `foo-macro v1.0.0` has the same output filename as the lib target `foo-macro` in package `foo-macro v1.0.0 [..]`.
553
+
The lib target `foo_macro` in package `foo-macro v1.0.0` has the same output filename as the lib target `foo_macro` in package `foo-macro v1.0.0 [..]`.
554
554
Colliding filename is: [CWD]/target/doc/foo_macro/index.html
555
555
The targets should have unique names.
556
556
This is a known bug where multiple crates with the same name use
0 commit comments