rust-lang / rust-lang/fls

Weird definition of overlap

Open
#372 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

A-type-layout C-enhancement S-waiting-on-author
Dominant language
reStructuredText
Stars
497
Forks
41
Avg merge
3h 52m
Merged PRs (30d)
4

Description

You define overlap as

Two values overlap when their memory locations overlap, or both values are elements of the same array.

So even if they don't overlap in memory location, but are part of the same array, they are still considered to overlap. However, you then define:

While a mutable reference is active, no other reference shall refer to a value that overlaps with the referent of the mutable reference.

But mutable references to arrays can usually be split into several references if they don't overlap in the conventional sense, but this contradicts the definition with arrays.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked glossary definition of overlap and the active-reference rule in ownership-and-deconstruction.html. Compare the array-specific overlap rule with the documented rules for splitting mutable references; done means the specification's treatment of these cases is clarified and internally consistent.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
documentation
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.