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 comment for Ord implementation for array #71944

Merged
merged 1 commit into from
May 6, 2020
Merged

Conversation

ldm0
Copy link
Contributor

@ldm0 ldm0 commented May 6, 2020

Corresponding to Ord implementation for slice. It hints new comer the rule of comparing two arrays.

@rust-highfive
Copy link
Collaborator

r? @sfackler

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 6, 2020
@sfackler
Copy link
Member

sfackler commented May 6, 2020

I don't believe that comment will be displayed anywhere in the documentation, but if you move it down to the cmp method it will.

@ldm0
Copy link
Contributor Author

ldm0 commented May 6, 2020

I don't believe that comment will be displayed anywhere in the documentation, but if you move it down to the cmp method it will.

Sorry, but it actually will be displayed after expanding the impl block. You can check https://doc.rust-lang.org/std/primitive.slice.html#impl-Ord and

rust/src/libcore/slice/mod.rs

Lines 5795 to 5803 in 8da5869

/// Implements comparison of vectors lexicographically.
#[stable(feature = "rust1", since = "1.0.0")]
impl<T: Ord> Ord for [T] {
fn cmp(&self, other: &[T]) -> Ordering {
SliceOrd::compare(self, other)
}
}

@sfackler
Copy link
Member

sfackler commented May 6, 2020

Oh, great!

@bors r+ rollup

@bors
Copy link
Contributor

bors commented May 6, 2020

📌 Commit 5087c1a has been approved by sfackler

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 6, 2020
bors added a commit to rust-lang-ci/rust that referenced this pull request May 6, 2020
Rollup of 7 pull requests

Successful merges:

 - rust-lang#71269 (Define UB in float-to-int casts to saturate)
 - rust-lang#71591 (use new interface to create threads on HermitCore)
 - rust-lang#71819 (x.py: Give a more helpful error message if curl isn't installed)
 - rust-lang#71893 (Use the `impls` module to import pre-existing dataflow analyses)
 - rust-lang#71929 (Use -fvisibility=hidden for libunwind)
 - rust-lang#71937 (Ignore SGX on a few ui tests)
 - rust-lang#71944 (Add comment for `Ord` implementation for array)

Failed merges:

r? @ghost
@bors bors merged commit fbb4ccb into rust-lang:master May 6, 2020
@ldm0 ldm0 deleted the arrordhint branch May 23, 2020 11:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants