File tree 2 files changed +33
-11
lines changed
2 files changed +33
-11
lines changed Original file line number Diff line number Diff line change @@ -183,11 +183,16 @@ fn read_nested_packages(
183
183
v. insert ( pkg) ;
184
184
}
185
185
Entry :: Occupied ( _) => {
186
- let _ = config. shell ( ) . warn ( format ! (
187
- "skipping duplicate package `{}` found at `{}`" ,
188
- pkg. name( ) ,
189
- path. to_string_lossy( )
190
- ) ) ;
186
+ // We can assume a package with publish = false isn't intended to be seen
187
+ // by users so we can hide the warning about those since the user is unlikely
188
+ // to care about those cases.
189
+ if pkg. publish ( ) . is_none ( ) {
190
+ let _ = config. shell ( ) . warn ( format ! (
191
+ "skipping duplicate package `{}` found at `{}`" ,
192
+ pkg. name( ) ,
193
+ path. display( )
194
+ ) ) ;
195
+ }
191
196
}
192
197
}
193
198
Original file line number Diff line number Diff line change @@ -1078,16 +1078,34 @@ fn dep_with_skipped_submodule() {
1078
1078
}
1079
1079
1080
1080
#[ cargo_test]
1081
- fn dep_ambiguous ( ) {
1081
+ fn ambiguous_published_deps ( ) {
1082
1082
let project = project ( ) ;
1083
1083
let git_project = git:: new ( "dep" , |project| {
1084
1084
project
1085
- . file ( "aaa/Cargo.toml" , & basic_manifest ( "bar" , "0.5.0" ) )
1085
+ . file (
1086
+ "aaa/Cargo.toml" ,
1087
+ & format ! (
1088
+ r#"
1089
+ [project]
1090
+ name = "bar"
1091
+ version = "0.5.0"
1092
+ publish = true
1093
+ "#
1094
+ ) ,
1095
+ )
1086
1096
. file ( "aaa/src/lib.rs" , "" )
1087
- . file ( "bbb/Cargo.toml" , & basic_manifest ( "bar" , "0.5.0" ) )
1097
+ . file (
1098
+ "bbb/Cargo.toml" ,
1099
+ & format ! (
1100
+ r#"
1101
+ [project]
1102
+ name = "bar"
1103
+ version = "0.5.0"
1104
+ publish = true
1105
+ "#
1106
+ ) ,
1107
+ )
1088
1108
. file ( "bbb/src/lib.rs" , "" )
1089
- . file ( "ccc/Cargo.toml" , & basic_manifest ( "bar" , "0.5.0" ) )
1090
- . file ( "ccc/src/lib.rs" , "" )
1091
1109
} ) ;
1092
1110
1093
1111
let p = project
@@ -1115,7 +1133,6 @@ fn dep_ambiguous() {
1115
1133
. with_stderr (
1116
1134
"\
1117
1135
[WARNING] skipping duplicate package `bar` found at `[..]`
1118
- [WARNING] skipping duplicate package `bar` found at `[..]`
1119
1136
[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]
1120
1137
[RUNNING] `target/debug/foo[EXE]`
1121
1138
" ,
You can’t perform that action at this time.
0 commit comments