@@ -3,6 +3,7 @@ extern crate hamcrest;
3
3
4
4
use cargotest:: is_nightly;
5
5
use cargotest:: support:: { execs, project} ;
6
+ use cargotest:: support:: registry:: Package ;
6
7
use hamcrest:: assert_that;
7
8
8
9
#[ test]
@@ -238,3 +239,57 @@ fn issue_3418() {
238
239
execs ( ) . with_status ( 0 )
239
240
. with_stderr_does_not_contain ( "--crate-type lib" ) ) ;
240
241
}
242
+
243
+ // Some weirdness that seems to be caused by a crate being built as well as
244
+ // checked, but in this case with a proc macro too.
245
+ #[ test]
246
+ fn issue_3419 ( ) {
247
+ if !is_nightly ( ) {
248
+ return ;
249
+ }
250
+
251
+ let foo = project ( "foo" )
252
+ . file ( "Cargo.toml" , r#"
253
+ [package]
254
+ name = "foo"
255
+ version = "0.0.1"
256
+ authors = []
257
+
258
+ [dependencies]
259
+ rustc-serialize = "*"
260
+ "# )
261
+ . file ( "src/lib.rs" , r#"
262
+ extern crate rustc_serialize;
263
+
264
+ use rustc_serialize::Decodable;
265
+
266
+ pub fn take<T: Decodable>() {}
267
+ "# )
268
+ . file ( "src/main.rs" , r#"
269
+ extern crate rustc_serialize;
270
+
271
+ extern crate foo;
272
+
273
+ #[derive(RustcDecodable)]
274
+ pub struct Foo;
275
+
276
+ fn main() {
277
+ foo::take::<Foo>();
278
+ }
279
+ "# ) ;
280
+
281
+ Package :: new ( "rustc-serialize" , "1.0.0" )
282
+ . file ( "src/lib.rs" ,
283
+ r#"pub trait Decodable: Sized {
284
+ fn decode<D: Decoder>(d: &mut D) -> Result<Self, D::Error>;
285
+ }
286
+ pub trait Decoder {
287
+ type Error;
288
+ fn read_struct<T, F>(&mut self, s_name: &str, len: usize, f: F)
289
+ -> Result<T, Self::Error>
290
+ where F: FnOnce(&mut Self) -> Result<T, Self::Error>;
291
+ } "# ) . publish ( ) ;
292
+
293
+ assert_that ( foo. cargo_process ( "check" ) ,
294
+ execs ( ) . with_status ( 0 ) ) ;
295
+ }
0 commit comments