Update special types.

Open
#591 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Documentation
Clarity
Mostly clear
Activity status
Stale
Tech stack
rust
Domain
documentation

Research direction

Start with special-types-and-traits.md and review how the document defines or lists special types. Investigate the proposed Rust traits and lang items, including Fn, FnMut, FnOnce, comparison and operator traits, and the unstable items listed here. Done means establishing the criteria for inclusion and updating the document with an agreed complete list; Termination is already addressed by #1194.

Written by the indexing model from the issue text.

Description

I think there are some types missing from special-types-and-traits.md. In particular, I think Fn, FnMut, and FnOnce are special. What is the criteria for being special? Is there anything else missing from the list?

Things to consider adding:

  • cmp:
    • Eq
    • PartialEq
    • Ord
    • PartialOrd
  • ops:
    • Add
    • AddAssign
    • BitAnd
    • BitAndAssign
    • BitOr
    • BitOrAssign
    • BitXor
    • BitXorAssign
    • Div
    • DivAssign
    • Fn
    • FnMut
    • FnOnce
    • Index
    • IndexMut
    • Mul
    • MulAssign
    • Neg
    • Not
    • Rem
    • RemAssign
    • Shl
    • ShlAssign
    • Shr
    • ShrAssign
    • Sub
    • SubAssign
  • Misc:
    • Unpin — Automatically implemented on most types, but not otherwise "used" by the language?
    • Future
    • ManuallyDrop
    • IntoIterator
    • IntoFuture
  • Unstable but maybe exposed in some way?:
    • Termination — Exposed indirectly via main. Done in #1194
    • Unsize / CoerceUnsized — Automatically implemented, involved in coercions?
    • UnsafeCell — Maybe for const eval?
    • StructuralPartialEq / StructuralEq — Needed for match checking?
  • Unstable (not exposed?):
    • Generator, GeneratorState
    • Try
    • DispatchFromDyn ()
    • VaListImpl (va_list lang item)
    • Receiver (currently hard-coded in reference)
    • start
    • eh_personality
    • eh_catch_typeinfo
  • Panic stuff — From a language perspective, is there anything relevant here?
  • Relevance unknown:
    • Freeze
    • exchange_malloc
    • box_free
    • drop_in_place
    • oom
    • alloc_layout
    • MaybeUninit
    • align_offset — const eval?
Dominant language
Rust
Stars
1.6k
Forks
607
Avg merge
1d 1h
Merged PRs (30d)
12

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.

More from rust-lang/reference

All issues in rust-lang/reference

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.