Skip to content

Commit ec2ccdc

Browse files
committed
Add test for mixing types from two incompatible crate versions
1 parent 0dba6c1 commit ec2ccdc

File tree

5 files changed

+133
-0
lines changed

5 files changed

+133
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
//@ edition:2021
2+
//@ aux-build:multiple-dep-versions-2.rs
3+
extern crate dependency;
4+
pub use dependency::do_something;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#![crate_name="dependency"]
2+
//@ edition:2021
3+
//@ compile-flags: -C metadata=1 -C extra-filename=-1
4+
pub struct Type;
5+
pub trait Trait {}
6+
impl Trait for Type {}
7+
pub fn do_something<X: Trait>(_: X) { }
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#![crate_name="dependency"]
2+
//@ edition:2021
3+
//@ compile-flags: -C metadata=2 -C extra-filename=-2
4+
pub struct Type(pub i32);
5+
pub trait Trait {}
6+
impl Trait for Type {}
7+
pub fn do_something<X: Trait>(_: X) {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
//@ aux-build:dep-2-reexport.rs
2+
//@ aux-build:multiple-dep-versions-1.rs
3+
//@ edition:2021
4+
//@ compile-flags: --error-format=human --color=always --crate-type bin --extern dependency={{build-base}}/crate-loading/multiple-dep-versions/auxiliary/libdependency-1.so --extern dep_2_reexport={{build-base}}/crate-loading/multiple-dep-versions/auxiliary/libdep_2_reexport.so
5+
//@ ignore-windows
6+
7+
extern crate dependency;
8+
extern crate dep_2_reexport;
9+
use dependency::Type;
10+
use dep_2_reexport::do_something;
11+
12+
fn main() {
13+
do_something(Type);
14+
}
Loading

0 commit comments

Comments
 (0)