Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add requirements of TotalEq and TotalOrd #13358

Merged
merged 2 commits into from Apr 7, 2014
Merged

Conversation

tbu-
Copy link
Contributor

@tbu- tbu- commented Apr 6, 2014

Add requirements of TotalEq and TotalOrd

Clarify that TotalEq needs an underlying equivalence relation and that TotalOrd
needs a total ordering and specifically named the required (and sufficient)
attributes.

* This means, that additionally to `a == b` and `a != b` being strict
* inverses, the following three properties are required:
*
* Reflexivity, which means that `a == a` must be true for all `a`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you make this a list, e.g.

/**
 * Trait for equality comparisons that form an [equalence relation](...).
 *
 * The equality must be (for all `a`, `b` and `c`):
 *
 * - reflexive: `a == a`;
 * - symmetric: `a == b` implies `b == a`; and
 * - transitive: `a == b` and `b == c` implies `a == c`.
 *
 * `a == b` and `a != b` must be strict inverses.
 */

Clarify that TotalEq needs an underlying equivalence relation and that TotalOrd
needs a total ordering and specifically named the required (and sufficient)
attributes.
@@ -62,7 +62,18 @@ pub trait Eq {
fn ne(&self, other: &Self) -> bool { !self.eq(other) }
}

/// Trait for equality comparisons where `a == b` and `a != b` are strict inverses.
/**
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: we don't use block comments, use /// on every line.

bors added a commit that referenced this pull request Apr 7, 2014
Add requirements of TotalEq and TotalOrd

Clarify that TotalEq needs an underlying equivalence relation and that TotalOrd
needs a total ordering and specifically named the required (and sufficient)
attributes.
@bors bors closed this Apr 7, 2014
@bors bors merged commit 85129e2 into rust-lang:master Apr 7, 2014
@adrientetar
Copy link
Contributor

What's wrong with block comments exactly?

bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 18, 2022
…on, r=Veykril

feat: Autocomplete Cargo-defined env vars in `env!` and `option_env!` (rust-lang#12448)

Closes rust-lang#12448

Important to know:

- Variables are taken from https://doc.rust-lang.org/cargo/reference/environment-variables.html and hardcoded as a const array.
- For the sake of simplicity I didn't include the autocompletion of `CARGO_BIN_EXE_<name>` and `OUT_DIR` since it would require information about build.rs and binary name. If somebody knows an easy way of obtaining them I can add those vars as well :)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants