mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-30 02:33:55 +00:00
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
This commit is contained in:
parent
e6b9db0884
commit
e4694ca519
12
src/test/run-pass/compare-generic-enums.rs
Normal file
12
src/test/run-pass/compare-generic-enums.rs
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
type an_int = int;
|
||||||
|
|
||||||
|
fn cmp(x: option<an_int>, y: option<int>) -> bool {
|
||||||
|
x == y
|
||||||
|
}
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
assert !cmp(some(3), none);
|
||||||
|
assert !cmp(some(3), some(4));
|
||||||
|
assert cmp(some(3), some(3));
|
||||||
|
assert cmp(none, none);
|
||||||
|
}
|
@ -1,5 +1,3 @@
|
|||||||
//xfail-test
|
|
||||||
|
|
||||||
// Issue #2263.
|
// Issue #2263.
|
||||||
|
|
||||||
// Should pass region checking.
|
// Should pass region checking.
|
||||||
|
Loading…
Reference in New Issue
Block a user