Skip to content

Commit e4694ca

Browse files
committed
add a test that types w/ def_ids compare just fine to types w/o def_ids
this is not clearly going to work due to monomorphization, which convverts each enum<T> to a distinct "type" from POV of the shape code
1 parent e6b9db0 commit e4694ca

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
type an_int = int;
2+
3+
fn cmp(x: option<an_int>, y: option<int>) -> bool {
4+
x == y
5+
}
6+
7+
fn main() {
8+
assert !cmp(some(3), none);
9+
assert !cmp(some(3), some(4));
10+
assert cmp(some(3), some(3));
11+
assert cmp(none, none);
12+
}

src/test/run-pass/regions-fn-subtyping.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
//xfail-test
2-
31
// Issue #2263.
42

53
// Should pass region checking.

0 commit comments

Comments
 (0)