This commit is contained in:
parent
21f74be2c1
commit
171c89f4c5
@ -340,7 +340,8 @@ class mark : public shape::data<mark,shape::ptr> {
|
|||||||
void walk_fn2(char code) {
|
void walk_fn2(char code) {
|
||||||
switch (code) {
|
switch (code) {
|
||||||
case shape::SHAPE_BOX_FN: {
|
case shape::SHAPE_BOX_FN: {
|
||||||
shape::data<mark,shape::ptr>::walk_fn_contents1();
|
shape::bump_dp<void*>(dp); // skip over the code ptr
|
||||||
|
walk_box2(); // walk over the environment ptr
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case shape::SHAPE_BARE_FN: // Does not close over data.
|
case shape::SHAPE_BARE_FN: // Does not close over data.
|
||||||
|
24
src/test/run-pass/issue-1989.rs
Normal file
24
src/test/run-pass/issue-1989.rs
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
// exec-env:RUST_CC_ZEAL=1
|
||||||
|
|
||||||
|
enum maybe_pointy {
|
||||||
|
none,
|
||||||
|
p(@pointy)
|
||||||
|
}
|
||||||
|
|
||||||
|
type pointy = {
|
||||||
|
mut a : maybe_pointy,
|
||||||
|
mut f : fn@()->(),
|
||||||
|
};
|
||||||
|
|
||||||
|
fn empty_pointy() -> @pointy {
|
||||||
|
ret @{
|
||||||
|
mut a : none,
|
||||||
|
mut f : fn@()->(){},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn main()
|
||||||
|
{
|
||||||
|
let v = [empty_pointy(), empty_pointy()];
|
||||||
|
v[0].a = p(v[0]);
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user