test: Add a test case for the "self" region in enums
This commit is contained in:
parent
1ed768bc3b
commit
83ed4f4bc4
1 changed files with 16 additions and 0 deletions
16
src/test/run-pass/regions-self-in-enums.rs
Normal file
16
src/test/run-pass/regions-self-in-enums.rs
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
enum int_wrapper {
|
||||
int_wrapper_ctor(&int)
|
||||
}
|
||||
|
||||
fn main() {
|
||||
unsafe {
|
||||
let x = 3;
|
||||
let y = int_wrapper_ctor(&x);
|
||||
let z : ∫
|
||||
alt y {
|
||||
int_wrapper_ctor(zz) { z = zz; }
|
||||
}
|
||||
log(debug, *z);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue