@@ -87,15 +87,64 @@ fn override_with_features() {
8787 . build ( ) ;
8888
8989 p. cargo ( "build" )
90- . with_status ( 101 )
9190 . with_stderr (
9291 "\
9392 [UPDATING] [..] index
94- [ERROR] failed to get `bar` as a dependency of package `foo v0.0.1 ([..])`
93+ [UPDATING] git repository `[..]`
94+ [WARNING] replacement for `bar` uses the features mechanism. default-features and features \
95+ will not take effect because the replacement dependency does not support this mechanism
96+ [COMPILING] bar v0.1.0 (file://[..])
97+ [COMPILING] foo v0.0.1 ([CWD])
98+ [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]
99+ " ,
100+ )
101+ . run ( ) ;
102+ }
95103
96- Caused by:
97- patch for `bar` uses the features mechanism. default-features and features \
98- will not take effect because the patch dependency does not support this mechanism
104+ #[ cargo_test]
105+ fn override_with_setting_default_features ( ) {
106+ Package :: new ( "bar" , "0.1.0" ) . publish ( ) ;
107+
108+ let bar = git:: repo ( & paths:: root ( ) . join ( "override" ) )
109+ . file ( "Cargo.toml" , & basic_manifest ( "bar" , "0.1.0" ) )
110+ . file ( "src/lib.rs" , "pub fn bar() {}" )
111+ . build ( ) ;
112+
113+ let p = project ( )
114+ . file (
115+ "Cargo.toml" ,
116+ & format ! (
117+ r#"
118+ [package]
119+ name = "foo"
120+ version = "0.0.1"
121+ authors = []
122+
123+ [dependencies]
124+ bar = "0.1.0"
125+
126+ [replace]
127+ "bar:0.1.0" = {{ git = '{}', default-features = false, features = ["none_default_feature"] }}
128+ "# ,
129+ bar. url( )
130+ ) ,
131+ )
132+ . file (
133+ "src/lib.rs" ,
134+ "extern crate bar; pub fn foo() { bar::bar(); }" ,
135+ )
136+ . build ( ) ;
137+
138+ p. cargo ( "build" )
139+ . with_stderr (
140+ "\
141+ [UPDATING] [..] index
142+ [UPDATING] git repository `[..]`
143+ [WARNING] replacement for `bar` uses the features mechanism. default-features and features \
144+ will not take effect because the replacement dependency does not support this mechanism
145+ [COMPILING] bar v0.1.0 (file://[..])
146+ [COMPILING] foo v0.0.1 ([CWD])
147+ [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]
99148" ,
100149 )
101150 . run ( ) ;
0 commit comments