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

Rollup of 23 pull requests #40598

Merged
merged 58 commits into from
Mar 17, 2017
Merged
Changes from 1 commit
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
13341f4
Reword the non-dropping of `src` for `ptr::write{,_unaligned}`
tbu- Mar 9, 2017
97a1b6a
Update usages of 'OSX' (and other old names) to 'macOS'.
frewsxcv Mar 12, 2017
b38992c
some style fixes
tshepang Mar 13, 2017
0644773
Remove doc about highlighting code in other languages #40301
projektir Mar 13, 2017
6b7b262
Updating README.md to point to the correct doc location
projektir Mar 13, 2017
eb203d5
Adjust wording #40301
projektir Mar 13, 2017
adba642
fix format grammar
llogiq Mar 13, 2017
5e49f79
Add test for issue #29595
mattico Mar 10, 2017
11d3344
Using X headings #39850
projektir Mar 13, 2017
8b9b3b6
Fix sidebar not extending to the bottom of the page
wesleywiser Mar 14, 2017
5b7f330
Corrected very minor documentation detail about Unicode and Japanese
Mar 14, 2017
e06c515
Rust unstable book: basic desc and example for `const_fn`.
frewsxcv Mar 11, 2017
327e8e9
Rust unstable book: basic desc and example for `conservative_impl_tra…
frewsxcv Mar 11, 2017
0dd03ff
Rust unstable book: basic desc and example for `const_indexing`.
frewsxcv Mar 12, 2017
137c1e8
Rust unstable book: basic desc and example for `i128_type`.
frewsxcv Mar 12, 2017
e58e3d0
Rust unstable book: basic desc and example for `non_ascii_idents`.
frewsxcv Mar 12, 2017
d3ae2eb
Rust unstable book: basic desc and example for `concat_idents`.
frewsxcv Mar 12, 2017
1545f4e
std: remove a workaround for privacy limitations that isn't necessary…
swgillespie Mar 14, 2017
e7b0f2b
Remove function invokation parens from documentation links.
frewsxcv Mar 12, 2017
5cc056a
A few improvements to the `core::hash` top-level docs.
frewsxcv Mar 14, 2017
0671cc1
.gitmodules: use official URLs w/o redirect
nodakai Mar 14, 2017
8af3013
Inline functions Ordering::{then, then_with}
Mar 14, 2017
9a7b789
Add doc example for `OsStr::to_os_string`.
frewsxcv Mar 12, 2017
4d57d92
Add doc example for `OsString::reserve`.
frewsxcv Mar 12, 2017
5537955
Add doc example for `OsString::reserve_exact`.
frewsxcv Mar 12, 2017
bda57db
Add doc example for `OsString::shrink_to_fit`.
frewsxcv Mar 12, 2017
6adbbfc
Add doc example for `OsString::into_boxed_os_str`.
frewsxcv Mar 12, 2017
cc08edc
Remove incorrect feature from the 1.16 relnotes
steveklabnik Mar 14, 2017
8b7c7f3
Link core::slice to std::slice
steveklabnik Mar 14, 2017
e3b8550
Point out correct turbofish usage on `Foo<Bar<Baz>>`
estebank Mar 14, 2017
18a8494
Ammended minor documentation detail abour Unicode cases.
Mar 15, 2017
5de0406
rustbuild: Retry downloads of OpenSSL source
alexcrichton Mar 15, 2017
e66b3a2
Fix documentation for Vec::dedup_by.
kevinmehall Mar 15, 2017
3d01e1a
add sort_unstable to unstable book
steveklabnik Mar 16, 2017
bc6eecd
Merge branch 'master' into frewsxcv-osstr
frewsxcv Mar 17, 2017
70e7327
Rollup merge of #40387 - tbu-:pr_doc_ptr_write2, r=steveklabnik
frewsxcv Mar 17, 2017
01ad185
Rollup merge of #40433 - mattico:test-issue-29595, r=estebank
frewsxcv Mar 17, 2017
739d89a
Rollup merge of #40452 - frewsxcv:frewsxcv-unstable-docs, r=Guillaume…
frewsxcv Mar 17, 2017
6971717
Rollup merge of #40456 - frewsxcv:frewsxcv-docs-function-parens, r=Gu…
frewsxcv Mar 17, 2017
dee6989
Rollup merge of #40457 - frewsxcv:frewsxcv-macos, r=steveklabnik
frewsxcv Mar 17, 2017
695d7ec
Rollup merge of #40458 - frewsxcv:frewsxcv-osstr, r=GuillaumeGomez
frewsxcv Mar 17, 2017
cfca6fc
Rollup merge of #40463 - tshepang:nit, r=nikomatsakis
frewsxcv Mar 17, 2017
127c3ad
Rollup merge of #40466 - projektir:outdated_docs_highlighting, r=stev…
frewsxcv Mar 17, 2017
dcf5f07
Rollup merge of #40467 - projektir:readme_docs, r=steveklabnik
frewsxcv Mar 17, 2017
4fbd884
Rollup merge of #40495 - llogiq:format-docs, r=steveklabnik
frewsxcv Mar 17, 2017
f9236bd
Rollup merge of #40496 - projektir:docs_number_headings, r=frewsxcv
frewsxcv Mar 17, 2017
3ebce67
Rollup merge of #40497 - wesleywiser:fix_sidebar, r=GuillaumeGomez
frewsxcv Mar 17, 2017
e389f6a
Rollup merge of #40499 - ericfindlay:master, r=steveklabnik
frewsxcv Mar 17, 2017
5aab3b9
Rollup merge of #40500 - estebank:turbofish-help, r=pnkfelix
frewsxcv Mar 17, 2017
d7a09d4
Rollup merge of #40503 - swgillespie:thread-hack-removal, r=sfackler
frewsxcv Mar 17, 2017
f47a377
Rollup merge of #40505 - frewsxcv:hash-docs, r=alexcrichton
frewsxcv Mar 17, 2017
1909b62
Rollup merge of #40512 - nodakai:patch-1, r=alexcrichton
frewsxcv Mar 17, 2017
f90fab5
Rollup merge of #40514 - stjepang:inline-then-ordering, r=alexcrichton
frewsxcv Mar 17, 2017
6831180
Rollup merge of #40517 - rust-lang:release-notes-tweak, r=alexcrichton
frewsxcv Mar 17, 2017
2ba4a63
Rollup merge of #40520 - steveklabnik:link-core-slice, r=alexcrichton
frewsxcv Mar 17, 2017
dc1deeb
Rollup merge of #40536 - kevinmehall:dedup_docs_for_dedup_by, r=steve…
frewsxcv Mar 17, 2017
b71e5f7
Rollup merge of #40545 - alexcrichton:retry-download-openssl, r=nikom…
frewsxcv Mar 17, 2017
3bec563
Rollup merge of #40586 - steveklabnik:add-unstable-sort-to-unstable-b…
frewsxcv Mar 17, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
A few improvements to the core::hash top-level docs.
Primarily opened to address the concerns brought up in
#40498.

* run rustfmt on code blocks
* use `DefaultHasher` instead of deprecated `SipHasher`
* rename `hash` to `calculate_hash` to prevent confusion with the `hash`
  method
  • Loading branch information
frewsxcv committed Mar 14, 2017
commit 5cc056a744d1fbdacbdeed65ee62c76362bd68cf
44 changes: 31 additions & 13 deletions src/libcore/hash/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
//! # Examples
//!
//! ```rust
//! use std::hash::{Hash, SipHasher, Hasher};
//! use std::collections::hash_map::DefaultHasher;
//! use std::hash::{Hash, Hasher};
//!
//! #[derive(Hash)]
//! struct Person {
Expand All @@ -25,13 +26,21 @@
//! phone: u64,
//! }
//!
//! let person1 = Person { id: 5, name: "Janet".to_string(), phone: 555_666_7777 };
//! let person2 = Person { id: 5, name: "Bob".to_string(), phone: 555_666_7777 };
//! let person1 = Person {
//! id: 5,
//! name: "Janet".to_string(),
//! phone: 555_666_7777,
//! };
//! let person2 = Person {
//! id: 5,
//! name: "Bob".to_string(),
//! phone: 555_666_7777,
//! };
//!
//! assert!(hash(&person1) != hash(&person2));
//! assert!(calculate_hash(&person1) != calculate_hash(&person2));
//!
//! fn hash<T: Hash>(t: &T) -> u64 {
//! let mut s = SipHasher::new();
//! fn calculate_hash<T: Hash>(t: &T) -> u64 {
//! let mut s = DefaultHasher::new();
//! t.hash(&mut s);
//! s.finish()
//! }
Expand All @@ -43,11 +52,12 @@
//! [`Hash`]: trait.Hash.html
//!
//! ```rust
//! use std::hash::{Hash, Hasher, SipHasher};
//! use std::collections::hash_map::DefaultHasher;
//! use std::hash::{Hash, Hasher};
//!
//! struct Person {
//! id: u32,
//! # #[allow(dead_code)]
//! # #[allow(dead_code)]
//! name: String,
//! phone: u64,
//! }
Expand All @@ -59,13 +69,21 @@
//! }
//! }
//!
//! let person1 = Person { id: 5, name: "Janet".to_string(), phone: 555_666_7777 };
//! let person2 = Person { id: 5, name: "Bob".to_string(), phone: 555_666_7777 };
//! let person1 = Person {
//! id: 5,
//! name: "Janet".to_string(),
//! phone: 555_666_7777,
//! };
//! let person2 = Person {
//! id: 5,
//! name: "Bob".to_string(),
//! phone: 555_666_7777,
//! };
//!
//! assert_eq!(hash(&person1), hash(&person2));
//! assert_eq!(calculate_hash(&person1), calculate_hash(&person2));
//!
//! fn hash<T: Hash>(t: &T) -> u64 {
//! let mut s = SipHasher::new();
//! fn calculate_hash<T: Hash>(t: &T) -> u64 {
//! let mut s = DefaultHasher::new();
//! t.hash(&mut s);
//! s.finish()
//! }
Expand Down