You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A temporary "reference holder" variable that stores a function result may be attached to a reference cycle and therefore never freed.
type T = struct {
next: ^T
}
fn foo(n: T): T {
n.next = &n
return n
}
fn bar() {
foo(T{})
} // Runtime error: Pointer to a local variable escapes from the function
fn main() {
bar()
}
The text was updated successfully, but these errors were encountered:
@skejeton I think you mean #199. Yes, it's related, but not the same. There are many ways to produce a reference cycle involving a local variable. What distinguishes the current issue is that a user cannot even see this variable.
A temporary "reference holder" variable that stores a function result may be attached to a reference cycle and therefore never freed.
The text was updated successfully, but these errors were encountered: