Skip to content

Commit 0094ffd

Browse files
committed
test: Add test for mismatched nominal types when using multiple crate vers
1 parent e0f2341 commit 0094ffd

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
lines changed

src/test/auxiliary/crateresolve5-1.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,10 @@ fn structural() -> { name: str, val: int } {
77
{ name: "crateresolve5", val: 10 }
88
}
99

10+
enum e {
11+
e_val
12+
}
13+
14+
fn nominal() -> e { e_val }
15+
1016
fn f() -> int { 10 }

src/test/auxiliary/crateresolve5-2.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,10 @@ fn structural() -> { name: str, val: int } {
77
{ name: "crateresolve5", val: 10 }
88
}
99

10+
enum e {
11+
e_val
12+
}
13+
14+
fn nominal() -> e { e_val }
15+
1016
fn f() -> int { 20 }
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// xfail-fast
2+
// aux-build:crateresolve5-1.rs
3+
// aux-build:crateresolve5-2.rs
4+
// error-pattern:mismatched types
5+
6+
use cr5_1 (name = "crateresolve5", vers = "0.1");
7+
use cr5_2 (name = "crateresolve5", vers = "0.2");
8+
9+
fn main() {
10+
// Nominal types from two multiple versions of a crate are different types
11+
assert cr5_1::nominal() == cr5_2::nominal();
12+
}

0 commit comments

Comments
 (0)