Skip to content

Rollup of 20 pull requests #44561

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

Closed
wants to merge 48 commits into from
Closed
Changes from 2 commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
adfebed
Explicitly run perl for OpenSSL Configure
smaeul Aug 28, 2017
1ffc3dd
Attempt to fix the component manifest problem for rls-preview
nrc Sep 5, 2017
55f9087
rustdoc: Don't counts ids twice when using --enable-commonmark
ollie27 Sep 6, 2017
8e80cee
Implement named threads on Windows
jsheard Sep 6, 2017
b4d0f61
Clarify the behavior of UDP sockets wrt. multiple addresses in `connect`
tbu- Sep 7, 2017
5d3626d
Add `impl From<Vec<Span>> for MultiSpan`.
SergioBenitez Sep 9, 2017
cd1bf6d
Added short examples for 'str::from_utf8_mut'
smt923 Sep 10, 2017
51bbd69
Fix incorrect markdown title
smt923 Sep 10, 2017
f20b030
Fix trailing whitespace
smt923 Sep 10, 2017
bc1a4c6
Add doc example to String::as_mut_str
tommyip Sep 9, 2017
303b7c2
Fix markdown link for Utf8Error
smt923 Sep 10, 2017
204414b
Actually fix the trailing whitespace
smt923 Sep 10, 2017
69b9494
Alphabetize current label explanations
carols10cents Sep 10, 2017
28fc93f
Add explanations for undocumented labels
carols10cents Sep 10, 2017
18ef0de
Add doc examples to str::from_utf8_unchecked_mut
napen123 Sep 10, 2017
833a9b5
Added an example for `std::str::into_boxed_bytes()`
CodenameLambda Sep 11, 2017
f452acb
Removed trailing whitespace
CodenameLambda Sep 11, 2017
f3d6f12
update mdbook
steveklabnik Sep 11, 2017
ede6dfd
Add doc example to str::from_boxed_utf8_unchecked
tommyip Sep 11, 2017
b8e0989
Add an example of std::str::encode_utf16
rwakulszowa Sep 12, 2017
742ff5a
Fix rendering of const keyword for functions
GuillaumeGomez Sep 1, 2017
8adf50d
Remove Invalid UTF-8 from str::from_utf8_unchecked_mut
napen123 Sep 12, 2017
518bd30
Fix drain_filter doctest.
Sep 13, 2017
9dd2ee1
Fix example in transmute; add safety requirement to Vec::from_raw_parts
Havvy Sep 13, 2017
ccd4689
Add missing urls for OpenOptions docs
GuillaumeGomez Sep 13, 2017
c4044ee
Add note for append method in OpenOptions docs
GuillaumeGomez Sep 13, 2017
5f43357
update "since" for discriminant_value
durka Sep 13, 2017
2d292cf
Remove unneeded `loop`.
frewsxcv Sep 14, 2017
f155c81
Rollup merge of #44131 - smaeul:openssl-perl, r=Mark-Simulacrum
frewsxcv Sep 14, 2017
4dc29b3
Rollup merge of #44254 - GuillaumeGomez:const-fix-rustdoc, r=QuietMis…
frewsxcv Sep 14, 2017
0952276
Rollup merge of #44356 - nrc:rls-component-manifest, r=@alexcrichton
frewsxcv Sep 14, 2017
7289731
Rollup merge of #44368 - ollie27:rustdoc_pulldown_ids, r=QuietMisdreavus
frewsxcv Sep 14, 2017
711e163
Rollup merge of #44374 - jsheard:threadname, r=alexcrichton
frewsxcv Sep 14, 2017
273922f
Rollup merge of #44388 - tbu-:pr_doc_udp_connect_multiple, r=frewsxcv
frewsxcv Sep 14, 2017
7cc5a4f
Rollup merge of #44430 - steveklabnik:update-mdbook, r=alexcrichton
frewsxcv Sep 14, 2017
e67f434
Rollup merge of #44450 - SergioBenitez:master, r=nrc
frewsxcv Sep 14, 2017
423120a
Rollup merge of #44453 - tommyip:doc_string_as_mut_str, r=frewsxcv
frewsxcv Sep 14, 2017
d5c61d1
Rollup merge of #44472 - smt923:master, r=frewsxcv
frewsxcv Sep 14, 2017
5504873
Rollup merge of #44476 - integer32llc:update-label-explanation, r=Mar…
frewsxcv Sep 14, 2017
56ee7dc
Rollup merge of #44477 - napen123:master, r=frewsxcv
frewsxcv Sep 14, 2017
f90eabd
Rollup merge of #44485 - 42triangles:master, r=frewsxcv
frewsxcv Sep 14, 2017
38a8d60
Rollup merge of #44497 - tommyip:doc_example, r=frewsxcv
frewsxcv Sep 14, 2017
8ca0212
Rollup merge of #44521 - rwakulszowa:str_utf16_doc, r=frewsxcv
frewsxcv Sep 14, 2017
66c1954
Rollup merge of #44534 - adlerd:drain_filter_doctest, r=bluss
frewsxcv Sep 14, 2017
da6a159
Rollup merge of #44536 - Havvy:transmute-docs, r=steveklabnik
frewsxcv Sep 14, 2017
d73f4dd
Rollup merge of #44541 - GuillaumeGomez:openoptions-docs, r=QuietMisd…
frewsxcv Sep 14, 2017
24c4e26
Rollup merge of #44552 - durka:patch-42, r=alexcrichton
frewsxcv Sep 14, 2017
0058d58
Rollup merge of #44559 - frewsxcv:frewsxcv-rm-loop, r=sfackler
frewsxcv Sep 14, 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
16 changes: 8 additions & 8 deletions src/libcore/mem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -712,39 +712,39 @@ pub unsafe fn transmute_copy<T, U>(src: &T) -> U {
/// Opaque type representing the discriminant of an enum.
///
/// See the `discriminant` function in this module for more information.
#[stable(feature = "discriminant_value", since = "1.22.0")]
#[stable(feature = "discriminant_value", since = "1.21.0")]
pub struct Discriminant<T>(u64, PhantomData<*const T>);

// N.B. These trait implementations cannot be derived because we don't want any bounds on T.

#[stable(feature = "discriminant_value", since = "1.22.0")]
#[stable(feature = "discriminant_value", since = "1.21.0")]
impl<T> Copy for Discriminant<T> {}

#[stable(feature = "discriminant_value", since = "1.22.0")]
#[stable(feature = "discriminant_value", since = "1.21.0")]
impl<T> clone::Clone for Discriminant<T> {
fn clone(&self) -> Self {
*self
}
}

#[stable(feature = "discriminant_value", since = "1.22.0")]
#[stable(feature = "discriminant_value", since = "1.21.0")]
impl<T> cmp::PartialEq for Discriminant<T> {
fn eq(&self, rhs: &Self) -> bool {
self.0 == rhs.0
}
}

#[stable(feature = "discriminant_value", since = "1.22.0")]
#[stable(feature = "discriminant_value", since = "1.21.0")]
impl<T> cmp::Eq for Discriminant<T> {}

#[stable(feature = "discriminant_value", since = "1.22.0")]
#[stable(feature = "discriminant_value", since = "1.21.0")]
impl<T> hash::Hash for Discriminant<T> {
fn hash<H: hash::Hasher>(&self, state: &mut H) {
self.0.hash(state);
}
}

#[stable(feature = "discriminant_value", since = "1.22.0")]
#[stable(feature = "discriminant_value", since = "1.21.0")]
impl<T> fmt::Debug for Discriminant<T> {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
fmt.debug_tuple("Discriminant")
Expand Down Expand Up @@ -777,7 +777,7 @@ impl<T> fmt::Debug for Discriminant<T> {
/// assert!(mem::discriminant(&Foo::B(1)) == mem::discriminant(&Foo::B(2)));
/// assert!(mem::discriminant(&Foo::B(3)) != mem::discriminant(&Foo::C(3)));
/// ```
#[stable(feature = "discriminant_value", since = "1.22.0")]
#[stable(feature = "discriminant_value", since = "1.21.0")]
pub fn discriminant<T>(v: &T) -> Discriminant<T> {
unsafe {
Discriminant(intrinsics::discriminant_value(v), PhantomData)
Expand Down