@@ -20,14 +20,15 @@ fn within_namespace_requires_feature() {
20
20
. masquerade_as_nightly_cargo ( & [ "open-namespaces" ] )
21
21
. with_status ( 101 )
22
22
. with_stderr (
23
- "\
24
- [ERROR] invalid character `:` in package name: `foo::bar`, characters must be Unicode XID characters (numbers, `-`, `_`, or most letters)
25
- --> Cargo.toml:3:24
26
- |
27
- 3 | name = \" foo::bar\"
28
- | ^^^^^^^^^^
29
- |
30
- " ,
23
+ r#"error: failed to parse manifest at `[CWD]/Cargo.toml`
24
+
25
+ Caused by:
26
+ feature `open-namespaces` is required
27
+
28
+ The package requires the Cargo feature called `open-namespaces`, but that feature is not stabilized in this version of Cargo ([..]).
29
+ Consider adding `cargo-features = ["open-namespaces"]` to the top of Cargo.toml (above the [package] table) to tell Cargo you are opting in to use this unstable feature.
30
+ See https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#open-namespaces for more information about the status of this feature.
31
+ "# ,
31
32
)
32
33
. run ( )
33
34
}
@@ -51,17 +52,50 @@ fn implicit_lib_within_namespace() {
51
52
52
53
p. cargo ( "read-manifest" )
53
54
. masquerade_as_nightly_cargo ( & [ "open-namespaces" ] )
54
- . with_status ( 101 )
55
- . with_stderr (
56
- "\
57
- [ERROR] invalid character `:` in package name: `foo::bar`, characters must be Unicode XID characters (numbers, `-`, `_`, or most letters)
58
- --> Cargo.toml:5:24
59
- |
60
- 5 | name = \" foo::bar\"
61
- | ^^^^^^^^^^
62
- |
63
- " ,
55
+ . with_json (
56
+ r#"{
57
+ "authors": [],
58
+ "categories": [],
59
+ "default_run": null,
60
+ "dependencies": [],
61
+ "description": null,
62
+ "documentation": null,
63
+ "edition": "2015",
64
+ "features": {},
65
+ "homepage": null,
66
+ "id": "path+file://[..]#foo::[email protected] ",
67
+ "keywords": [],
68
+ "license": null,
69
+ "license_file": null,
70
+ "links": null,
71
+ "manifest_path": "[CWD]/Cargo.toml",
72
+ "metadata": null,
73
+ "name": "foo::bar",
74
+ "publish": null,
75
+ "readme": null,
76
+ "repository": null,
77
+ "rust_version": null,
78
+ "source": null,
79
+ "targets": [
80
+ {
81
+ "crate_types": [
82
+ "lib"
83
+ ],
84
+ "doc": true,
85
+ "doctest": true,
86
+ "edition": "2015",
87
+ "kind": [
88
+ "lib"
89
+ ],
90
+ "name": "foo::bar",
91
+ "src_path": "[CWD]/src/lib.rs",
92
+ "test": true
93
+ }
94
+ ],
95
+ "version": "0.0.1"
96
+ }"# ,
64
97
)
98
+ . with_stderr ( "" )
65
99
. run ( )
66
100
}
67
101
@@ -84,17 +118,50 @@ fn implicit_bin_within_namespace() {
84
118
85
119
p. cargo ( "read-manifest" )
86
120
. masquerade_as_nightly_cargo ( & [ "open-namespaces" ] )
87
- . with_status ( 101 )
88
- . with_stderr (
89
- "\
90
- [ERROR] invalid character `:` in package name: `foo::bar`, characters must be Unicode XID characters (numbers, `-`, `_`, or most letters)
91
- --> Cargo.toml:5:24
92
- |
93
- 5 | name = \" foo::bar\"
94
- | ^^^^^^^^^^
95
- |
96
- " ,
121
+ . with_json (
122
+ r#"{
123
+ "authors": [],
124
+ "categories": [],
125
+ "default_run": null,
126
+ "dependencies": [],
127
+ "description": null,
128
+ "documentation": null,
129
+ "edition": "2015",
130
+ "features": {},
131
+ "homepage": null,
132
+ "id": "path+file://[..]#foo::[email protected] ",
133
+ "keywords": [],
134
+ "license": null,
135
+ "license_file": null,
136
+ "links": null,
137
+ "manifest_path": "[CWD]/Cargo.toml",
138
+ "metadata": null,
139
+ "name": "foo::bar",
140
+ "publish": null,
141
+ "readme": null,
142
+ "repository": null,
143
+ "rust_version": null,
144
+ "source": null,
145
+ "targets": [
146
+ {
147
+ "crate_types": [
148
+ "bin"
149
+ ],
150
+ "doc": true,
151
+ "doctest": false,
152
+ "edition": "2015",
153
+ "kind": [
154
+ "bin"
155
+ ],
156
+ "name": "foo::bar",
157
+ "src_path": "[CWD]/src/main.rs",
158
+ "test": true
159
+ }
160
+ ],
161
+ "version": "0.0.1"
162
+ }"# ,
97
163
)
164
+ . with_stderr ( "" )
98
165
. run ( )
99
166
}
100
167
@@ -116,22 +183,69 @@ fn explicit_bin_within_namespace() {
116
183
"# ,
117
184
)
118
185
. file ( "src/lib.rs" , "" )
119
- . file ( "src/foo-bar/main.rs" , "fn main() {}" )
186
+ . file ( "src/bin/ foo-bar/main.rs" , "fn main() {}" )
120
187
. build ( ) ;
121
188
122
189
p. cargo ( "read-manifest" )
123
190
. masquerade_as_nightly_cargo ( & [ "open-namespaces" ] )
124
- . with_status ( 101 )
125
- . with_stderr (
126
- "\
127
- [ERROR] invalid character `:` in package name: `foo::bar`, characters must be Unicode XID characters (numbers, `-`, `_`, or most letters)
128
- --> Cargo.toml:5:24
129
- |
130
- 5 | name = \" foo::bar\"
131
- | ^^^^^^^^^^
132
- |
133
- " ,
191
+ . with_json (
192
+ r#"{
193
+ "authors": [],
194
+ "categories": [],
195
+ "default_run": null,
196
+ "dependencies": [],
197
+ "description": null,
198
+ "documentation": null,
199
+ "edition": "2015",
200
+ "features": {},
201
+ "homepage": null,
202
+ "id": "path+file://[..]#foo::[email protected] ",
203
+ "keywords": [],
204
+ "license": null,
205
+ "license_file": null,
206
+ "links": null,
207
+ "manifest_path": "[CWD]/Cargo.toml",
208
+ "metadata": null,
209
+ "name": "foo::bar",
210
+ "publish": null,
211
+ "readme": null,
212
+ "repository": null,
213
+ "rust_version": null,
214
+ "source": null,
215
+ "targets": [
216
+ {
217
+ "crate_types": [
218
+ "lib"
219
+ ],
220
+ "doc": true,
221
+ "doctest": true,
222
+ "edition": "2015",
223
+ "kind": [
224
+ "lib"
225
+ ],
226
+ "name": "foo::bar",
227
+ "src_path": "[CWD]/src/lib.rs",
228
+ "test": true
229
+ },
230
+ {
231
+ "crate_types": [
232
+ "bin"
233
+ ],
234
+ "doc": true,
235
+ "doctest": false,
236
+ "edition": "2015",
237
+ "kind": [
238
+ "bin"
239
+ ],
240
+ "name": "foo-bar",
241
+ "src_path": "[CWD]/src/bin/foo-bar/main.rs",
242
+ "test": true
243
+ }
244
+ ],
245
+ "version": "0.0.1"
246
+ }"# ,
134
247
)
248
+ . with_stderr ( "" )
135
249
. run ( )
136
250
}
137
251
@@ -164,14 +278,14 @@ fn main() {}
164
278
"edition": "2021",
165
279
"features": {},
166
280
"homepage": null,
167
- "id": "path+file://[..]#foo-- [email protected] ",
281
+ "id": "path+file://[..]#foo:: [email protected] ",
168
282
"keywords": [],
169
283
"license": null,
170
284
"license_file": null,
171
285
"links": null,
172
286
"manifest_path": "[CWD]/foo::bar.rs",
173
287
"metadata": null,
174
- "name": "foo-- bar",
288
+ "name": "foo:: bar",
175
289
"publish": [],
176
290
"readme": null,
177
291
"repository": null,
@@ -188,7 +302,7 @@ fn main() {}
188
302
"kind": [
189
303
"bin"
190
304
],
191
- "name": "foo-- bar",
305
+ "name": "foo:: bar",
192
306
"src_path": "[..]/foo::bar.rs",
193
307
"test": true
194
308
}
@@ -197,10 +311,7 @@ fn main() {}
197
311
}
198
312
"# ,
199
313
)
200
- . with_stderr (
201
- "\
202
- ",
203
- )
314
+ . with_stderr ( "" )
204
315
. run ( ) ;
205
316
}
206
317
@@ -232,12 +343,14 @@ fn publish_namespaced() {
232
343
. with_status ( 101 )
233
344
. with_stderr (
234
345
"\
235
- [ERROR] invalid character `:` in package name: `foo::bar`, characters must be Unicode XID characters (numbers, `-`, `_`, or most letters)
236
- --> Cargo.toml:5:24
237
- |
238
- 5 | name = \" foo::bar\"
239
- | ^^^^^^^^^^
240
- |
346
+ [UPDATING] crates.io index
347
+ [WARNING] manifest has no documentation, homepage or repository.
348
+ See https://doc.rust-lang.org/cargo/reference/manifest.html#package-metadata for more info.
349
+ Packaging foo::bar v0.0.1 ([CWD])
350
+ [ERROR] failed to prepare local package for uploading
351
+
352
+ Caused by:
353
+ cannot publish with `open-namespaces`
241
354
" ,
242
355
)
243
356
. run ( ) ;
0 commit comments