about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src
diff options
context:
space:
mode:
authorJan Behrens <jbe@magnetkern.de>2023-07-26 19:36:26 +0200
committerJan Behrens <jbe@magnetkern.de>2023-10-05 14:44:42 +0200
commit86b031b7349594f23084c0599177975c47eb9925 (patch)
treef3422fe4f8e5ca50eed215b1689ec70a3a9dcc54 /compiler/rustc_codegen_llvm/src
parenteea26141ec2bf07a825011af841463dec51a04c9 (diff)
downloadrust-86b031b7349594f23084c0599177975c47eb9925.tar.gz
rust-86b031b7349594f23084c0599177975c47eb9925.zip
docs: Correct terminology in std::cmp
Some clarifications regarding used (mathematical) terminology:

* Avoid using the terms "total equality" and "partial equality" in favor
  of "equivalence relation" and "partial equivalence relation", which
  are well-defined and unambiguous.
* Clarify that `Ordering` is an ordering between two values (and not an
  order in the mathematical sense).
* Avoid saying that `PartialEq` and `Eq` are "equality comparisons"
  because the terminology "equality comparison" could be misleading:
  it's possible to implement `PartialEq` and `Eq` for other (partial)
  equivalence relations, in particular for relations where `a == b` for
  some `a` and `b` even when `a` and `b` are not the same value.
* Added a section "Strict and non-strict partial orders" to document
  that the `<=` and `>=` operators do not correspond to non-strict
  partial orders.
* Corrected section "Corollaries" in documenation of Ord in regard to
  `<` only describing a strict total order in cases where `==` conforms
  to mathematical equality.

Made documentation easier to understand:

* Explicitly state at the beginning of `PartialEq`'s documentation
  comment that implementing the trait will provide the `==` and `!=`
  operators.
* Added an easier to understand rule when to implement `Eq` in addition
  to `PartialEq`: "if it’s guaranteed that `PartialEq::eq(a, a)` always
  returns `true`."
* Explicitly mention in documentation of `Eq` that the properties
  "symmetric" and "transitive" are already required by `PartialEq`.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
0 files changed, 0 insertions, 0 deletions