Skip to content

Confusion about rooting in Borrowed Pointers Tutorial. #9596

Closed
@nejucomo

Description

@nejucomo

Section 5 Borrowing managed boxes and rooting of the Borrowed Pointers tutorial says:

"A heap box that is unrooted is one such that no pointer values in the heap point to it."

Shouldn't this say:

"A heap box is unrooted if there are no owning (non-borrowed) pointers to it."

?

In the following example, isn't the Point rooted, even though there are "no pointer values in the heap" pointing to it?

fn f() {
  let p = @Point { x: 42, y: 23 };
  let y = &p.x
  // ...
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions