File tree 2 files changed +9
-12
lines changed
2 files changed +9
-12
lines changed Original file line number Diff line number Diff line change @@ -43,12 +43,6 @@ pub struct PublishOpts<'cfg> {
43
43
pub fn publish ( ws : & Workspace , opts : & PublishOpts ) -> CargoResult < ( ) > {
44
44
let pkg = ws. current ( ) ?;
45
45
46
- // Allow publishing if a registry has been provided, or if there are no nightly
47
- // features enabled.
48
- if opts. registry . is_none ( ) && !pkg. manifest ( ) . features ( ) . activated ( ) . is_empty ( ) {
49
- bail ! ( "cannot publish crates which activate nightly-only cargo features to crates.io" )
50
- }
51
-
52
46
if let Some ( ref allowed_registries) = * pkg. publish ( ) {
53
47
if !match opts. registry {
54
48
Some ( ref registry) => allowed_registries. contains ( registry) ,
Original file line number Diff line number Diff line change 1
1
use cargotest:: ChannelChanger ;
2
- use cargotest:: support:: { execs, project} ;
2
+ use cargotest:: support:: { execs, project, publish } ;
3
3
use hamcrest:: assert_that;
4
4
5
5
#[ test]
@@ -303,7 +303,9 @@ fn z_flags_rejected() {
303
303
}
304
304
305
305
#[ test]
306
- fn publish_rejected ( ) {
306
+ fn publish_allowed ( ) {
307
+ publish:: setup ( ) ;
308
+
307
309
let p = project ( "foo" )
308
310
. file (
309
311
"Cargo.toml" ,
@@ -319,9 +321,10 @@ fn publish_rejected() {
319
321
. file ( "src/lib.rs" , "" )
320
322
. build ( ) ;
321
323
assert_that (
322
- p. cargo ( "publish" ) . masquerade_as_nightly_cargo ( ) ,
323
- execs ( ) . with_status ( 101 ) . with_stderr (
324
- "error: cannot publish crates which activate nightly-only cargo features to crates.io" ,
325
- ) ,
324
+ p. cargo ( "publish" )
325
+ . arg ( "--index" )
326
+ . arg ( publish:: registry ( ) . to_string ( ) )
327
+ . masquerade_as_nightly_cargo ( ) ,
328
+ execs ( ) . with_status ( 0 ) ,
326
329
) ;
327
330
}
You can’t perform that action at this time.
0 commit comments