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
let rustdoc_suggestion = "This is a known bug where multiple crates with the same name use\n\
536
-
the same path; see <https://github.com/rust-lang/cargo/issues/6313>.";
530
+
let suggestion = [
531
+
Level::NOTE.message("this may become a hard error in the future; see <https://github.com/rust-lang/cargo/issues/6313>"),
532
+
Level::HELP.message("consider changing their names to be unique or compiling them separately")
533
+
];
534
+
let rustdoc_suggestion = [
535
+
Level::NOTE.message("this is a known bug where multiple crates with the same name use the same path; see <https://github.com/rust-lang/cargo/issues/6313>")
536
+
];
537
537
let report_collision = |unit:&Unit,
538
538
other_unit:&Unit,
539
539
path:&PathBuf,
540
-
suggestion:&str|
540
+
messages:&[Message<'_>]|
541
541
-> CargoResult<()>{
542
542
if unit.target.name() == other_unit.target.name(){
543
-
self.bcx.gctx.shell().warn(format!(
544
-
"output filename collision.\n\
545
-
{}\
546
-
The targets should have unique names.\n\
547
-
{}",
548
-
describe_collision(unit, other_unit, path),
549
-
suggestion
550
-
))
543
+
self.bcx.gctx.shell().print_report(
544
+
&[Level::WARNING
545
+
.secondary_title(format!("output filename collision at {}", path.display()))
Copy file name to clipboardExpand all lines: tests/testsuite/collisions.rs
+27-36Lines changed: 27 additions & 36 deletions
Original file line number
Diff line number
Diff line change
@@ -55,12 +55,11 @@ fn collision_dylib() {
55
55
p.cargo("build -j=1")
56
56
.with_stderr_data(&format!("\
57
57
...
58
-
[WARNING] output filename collision.
59
-
The lib target `a` in package `b v1.0.0 ([ROOT]/foo/b)` has the same output filename as the lib target `a` in package `a v1.0.0 ([ROOT]/foo/a)`.
60
-
Colliding filename is: [ROOT]/foo/target/debug/deps/{}a{}
61
-
The targets should have unique names.
62
-
Consider changing their names to be unique or compiling them separately.
63
-
This may become a hard error in the future; see <https://github.com/rust-lang/cargo/issues/6313>.
58
+
[WARNING] output filename collision at [ROOT]/foo/target/debug/deps/{}a{}
59
+
|
60
+
= [NOTE] the lib target `a` in package `b v1.0.0 ([ROOT]/foo/b)` has the same output filename as the lib target `a` in package `a v1.0.0 ([ROOT]/foo/a)`
61
+
= [NOTE] this may become a hard error in the future; see <https://github.com/rust-lang/cargo/issues/6313>
62
+
= [HELP] consider changing their names to be unique or compiling them separately
The example target `ex1` in package `b v1.0.0 ([ROOT]/foo/b)` has the same output filename as the example target `ex1` in package `a v1.0.0 ([ROOT]/foo/a)`.
93
-
Colliding filename is: [ROOT]/foo/target/debug/examples/ex1[EXE]
94
-
The targets should have unique names.
95
-
Consider changing their names to be unique or compiling them separately.
96
-
This may become a hard error in the future; see <https://github.com/rust-lang/cargo/issues/6313>.
90
+
[WARNING] output filename collision at [ROOT]/foo/target/debug/examples/ex1[EXE]
91
+
|
92
+
= [NOTE] the example target `ex1` in package `b v1.0.0 ([ROOT]/foo/b)` has the same output filename as the example target `ex1` in package `a v1.0.0 ([ROOT]/foo/a)`
93
+
= [NOTE] this may become a hard error in the future; see <https://github.com/rust-lang/cargo/issues/6313>
94
+
= [HELP] consider changing their names to be unique or compiling them separately
The example target `foo` in package `foo v1.0.0 ([ROOT]/foo)` has the same output filename as the bin target `foo` in package `foo v1.0.0 ([ROOT]/foo)`.
124
-
Colliding filename is: [ROOT]/foo/out/foo[EXE]
125
-
The exported filenames should be unique.
126
-
Consider changing their names to be unique or compiling them separately.
127
-
This may become a hard error in the future; see <https://github.com/rust-lang/cargo/issues/6313>.
120
+
[WARNING] `--artifact-dir` filename collision at [ROOT]/foo/out/foo[EXE]
121
+
|
122
+
= [NOTE] the example target `foo` in package `foo v1.0.0 ([ROOT]/foo)` has the same output filename as the bin target `foo` in package `foo v1.0.0 ([ROOT]/foo)`
123
+
= [NOTE] this may become a hard error in the future; see <https://github.com/rust-lang/cargo/issues/6313>
124
+
= [HELP] consider changing their names to be unique or compiling them separately
128
125
...
129
126
130
127
"#]])
@@ -165,12 +162,10 @@ fn collision_doc() {
165
162
p.cargo("doc -j=1")
166
163
.with_stderr_data(str![[r#"
167
164
...
168
-
[WARNING] output filename collision.
169
-
The lib target `foo` in package `foo2 v0.1.0 ([ROOT]/foo/foo2)` has the same output filename as the lib target `foo` in package `foo v0.1.0 ([ROOT]/foo)`.
170
-
Colliding filename is: [ROOT]/foo/target/doc/foo/index.html
171
-
The targets should have unique names.
172
-
This is a known bug where multiple crates with the same name use
173
-
the same path; see <https://github.com/rust-lang/cargo/issues/6313>.
165
+
[WARNING] output filename collision at [ROOT]/foo/target/doc/foo/index.html
166
+
|
167
+
= [NOTE] the lib target `foo` in package `foo2 v0.1.0 ([ROOT]/foo/foo2)` has the same output filename as the lib target `foo` in package `foo v0.1.0 ([ROOT]/foo)`
168
+
= [NOTE] this is a known bug where multiple crates with the same name use the same path; see <https://github.com/rust-lang/cargo/issues/6313>
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 ([ROOT]/foo/foo-macro)`.
581
-
Colliding filename is: [ROOT]/foo/target/doc/foo_macro/index.html
582
-
The targets should have unique names.
583
-
This is a known bug where multiple crates with the same name use
584
-
the same path; see <https://github.com/rust-lang/cargo/issues/6313>.
572
+
[WARNING] output filename collision at [ROOT]/foo/target/doc/foo_macro/index.html
573
+
|
574
+
= [NOTE] 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 ([ROOT]/foo/foo-macro)`
575
+
= [NOTE] this is a known bug where multiple crates with the same name use the same path; see <https://github.com/rust-lang/cargo/issues/6313>
The bin target `foo_lib` in package `foo v0.1.0 ([ROOT]/foo/foo)` has the same output filename as the lib target `foo_lib` in package `bar v0.1.0 ([ROOT]/foo/bar)`.
302
-
Colliding filename is: [ROOT]/foo/target/doc/foo_lib/index.html
303
-
The targets should have unique names.
304
-
This is a known bug where multiple crates with the same name use
305
-
the same path; see <https://github.com/rust-lang/cargo/issues/6313>.
300
+
[WARNING] output filename collision at [ROOT]/foo/target/doc/foo_lib/index.html
301
+
|
302
+
= [NOTE] this is a known bug where multiple crates with the same name use the same path; see <https://github.com/rust-lang/cargo/issues/6313>
303
+
= [NOTE] the bin target `foo_lib` in package `foo v0.1.0 ([ROOT]/foo/foo)` has the same output filename as the lib target `foo_lib` in package `bar v0.1.0 ([ROOT]/foo/bar)`
306
304
[DOCUMENTING] bar v0.1.0 ([ROOT]/foo/bar)
307
305
[DOCUMENTING] foo v0.1.0 ([ROOT]/foo/foo)
308
306
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
// The checking/documenting lines are sometimes swapped since they run
514
512
// concurrently.
515
513
.with_stderr_data(str![[r#"
516
-
[WARNING] output filename collision.
517
-
The bin target `foo` in package `foo v0.0.1 ([ROOT]/foo)` has the same output filename as the lib target `foo` in package `foo v0.0.1 ([ROOT]/foo)`.
518
-
Colliding filename is: [ROOT]/foo/target/doc/foo/index.html
519
-
The targets should have unique names.
520
-
This is a known bug where multiple crates with the same name use
521
-
the same path; see <https://github.com/rust-lang/cargo/issues/6313>.
514
+
[WARNING] output filename collision at [ROOT]/foo/target/doc/foo/index.html
515
+
|
516
+
= [NOTE] the bin target `foo` in package `foo v0.0.1 ([ROOT]/foo)` has the same output filename as the lib target `foo` in package `foo v0.0.1 ([ROOT]/foo)`
517
+
= [NOTE] this is a known bug where multiple crates with the same name use the same path; see <https://github.com/rust-lang/cargo/issues/6313>
522
518
[CHECKING] foo v0.0.1 ([ROOT]/foo)
523
519
[DOCUMENTING] foo v0.0.1 ([ROOT]/foo)
524
520
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
// The checking/documenting lines are sometimes swapped since they run
558
554
// concurrently.
559
555
.with_stderr_data(str![[r#"
560
-
[WARNING] output filename collision.
561
-
The bin target `foo` in package `foo v0.0.1 ([ROOT]/foo)` has the same output filename as the lib target `foo` in package `foo v0.0.1 ([ROOT]/foo)`.
562
-
Colliding filename is: [ROOT]/foo/target/doc/foo/index.html
563
-
The targets should have unique names.
564
-
This is a known bug where multiple crates with the same name use
565
-
the same path; see <https://github.com/rust-lang/cargo/issues/6313>.
556
+
[WARNING] output filename collision at [ROOT]/foo/target/doc/foo/index.html
557
+
|
558
+
= [NOTE] the bin target `foo` in package `foo v0.0.1 ([ROOT]/foo)` has the same output filename as the lib target `foo` in package `foo v0.0.1 ([ROOT]/foo)`
559
+
= [NOTE] this is a known bug where multiple crates with the same name use the same path; see <https://github.com/rust-lang/cargo/issues/6313>
566
560
[CHECKING] foo v0.0.1 ([ROOT]/foo)
567
561
[DOCUMENTING] foo v0.0.1 ([ROOT]/foo)
568
562
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
0 commit comments