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 20 pull requests #44561

Closed
wants to merge 48 commits into from
Closed
Show file tree
Hide file tree
Changes from all 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
33 changes: 28 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -400,30 +400,53 @@ labels to triage issues:

* Magenta, **B**-prefixed labels identify bugs which are **blockers**.

* Dark blue, **beta-** labels track changes which need to be backported into
the beta branches.

* Light purple, **C**-prefixed labels represent the **category** of an issue.

* Green, **E**-prefixed labels explain the level of **experience** necessary
to fix the issue.

* The dark blue **final-comment-period** label marks bugs that are using the
RFC signoff functionality of [rfcbot][rfcbot] and are currenty in the final
comment period.

* Red, **I**-prefixed labels indicate the **importance** of the issue. The
[I-nominated][inom] label indicates that an issue has been nominated for
prioritizing at the next triage meeting.

* The purple **metabug** label marks lists of bugs collected by other
categories.

* Purple gray, **O**-prefixed labels are the **operating system** or platform
that this issue is specific to.

* Orange, **P**-prefixed labels indicate a bug's **priority**. These labels
are only assigned during triage meetings, and replace the [I-nominated][inom]
label.

* Blue, **T**-prefixed bugs denote which **team** the issue belongs to.
* The gray **proposed-final-comment-period** label marks bugs that are using
the RFC signoff functionality of [rfcbot][rfcbot] and are currently awaiting
signoff of all team members in order to enter the final comment period.

* Dark blue, **beta-** labels track changes which need to be backported into
the beta branches.
* Pink, **regression**-prefixed labels track regressions from stable to the
release channels.

* The purple **metabug** label marks lists of bugs collected by other
categories.
* The light orange **relnotes** label marks issues that should be documented in
the release notes of the next release.

* Gray, **S**-prefixed labels are used for tracking the **status** of pull
requests.

* Blue, **T**-prefixed bugs denote which **team** the issue belongs to.

If you're looking for somewhere to start, check out the [E-easy][eeasy] tag.

[inom]: https://github.com/rust-lang/rust/issues?q=is%3Aopen+is%3Aissue+label%3AI-nominated
[eeasy]: https://github.com/rust-lang/rust/issues?q=is%3Aopen+is%3Aissue+label%3AE-easy
[lru]: https://github.com/rust-lang/rust/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-asc
[rfcbot]: https://github.com/dikaiosune/rust-dashboard/blob/master/RFCBOT.md

## Out-of-tree Contributions

Expand Down
25 changes: 19 additions & 6 deletions src/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion src/bootstrap/dist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1098,8 +1098,14 @@ impl Step for Rls {
.arg("--output-dir").arg(&distdir(build))
.arg("--non-installed-overlay").arg(&overlay)
.arg(format!("--package-name={}-{}", name, target))
.arg("--component-name=rls")
.arg("--legacy-manifest-dirs=rustlib,cargo");

if build.config.channel == "nightly" {
cmd.arg("--component-name=rls");
} else {
cmd.arg("--component-name=rls-preview");
}

build.run(&mut cmd);
distdir(build).join(format!("{}-{}.tar.gz", name, target))
}
Expand Down
3 changes: 2 additions & 1 deletion src/bootstrap/native.rs
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,8 @@ impl Step for Openssl {
drop(fs::remove_dir_all(&dst));
build.run(Command::new("tar").arg("xf").arg(&tarball).current_dir(&out));

let mut configure = Command::new(obj.join("Configure"));
let mut configure = Command::new("perl");
configure.arg(obj.join("Configure"));
configure.arg(format!("--prefix={}", dst.display()));
configure.arg("no-dso");
configure.arg("no-ssl2");
Expand Down
14 changes: 6 additions & 8 deletions src/liballoc/btree/set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1110,15 +1110,13 @@ impl<'a, T: Ord> Iterator for Union<'a, T> {
type Item = &'a T;

fn next(&mut self) -> Option<&'a T> {
loop {
match cmp_opt(self.a.peek(), self.b.peek(), Greater, Less) {
Less => return self.a.next(),
Equal => {
self.b.next();
return self.a.next();
}
Greater => return self.b.next(),
match cmp_opt(self.a.peek(), self.b.peek(), Greater, Less) {
Less => self.a.next(),
Equal => {
self.b.next();
self.a.next()
}
Greater => self.b.next(),
}
}

Expand Down
35 changes: 35 additions & 0 deletions src/liballoc/str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -855,6 +855,19 @@ impl str {
}

/// Returns an iterator of `u16` over the string encoded as UTF-16.
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// let text = "Zażółć gęślą jaźń";
///
/// let utf8_len = text.len();
/// let utf16_len = text.encode_utf16().count();
///
/// assert!(utf16_len <= utf8_len);
/// ```
#[stable(feature = "encode_utf16", since = "1.8.0")]
pub fn encode_utf16(&self) -> EncodeUtf16 {
EncodeUtf16 { encoder: Utf16Encoder::new(self[..].chars()) }
Expand Down Expand Up @@ -1783,6 +1796,17 @@ impl str {
}

/// Converts a `Box<str>` into a `Box<[u8]>` without copying or allocating.
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// let s = "this is a string";
/// let boxed_str = s.to_owned().into_boxed_str();
/// let boxed_bytes = boxed_str.into_boxed_bytes();
/// assert_eq!(*boxed_bytes, *s.as_bytes());
/// ```
#[stable(feature = "str_box_extras", since = "1.20.0")]
pub fn into_boxed_bytes(self: Box<str>) -> Box<[u8]> {
self.into()
Expand Down Expand Up @@ -2050,6 +2074,17 @@ impl str {

/// Converts a boxed slice of bytes to a boxed string slice without checking
/// that the string contains valid UTF-8.
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// let smile_utf8 = Box::new([226, 152, 186]);
/// let smile = unsafe { std::str::from_boxed_utf8_unchecked(smile_utf8) };
///
/// assert_eq!("☺", &*smile);
/// ```
#[stable(feature = "str_box_extras", since = "1.20.0")]
pub unsafe fn from_boxed_utf8_unchecked(v: Box<[u8]>) -> Box<str> {
mem::transmute(v)
Expand Down
17 changes: 16 additions & 1 deletion src/liballoc/string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -759,7 +759,22 @@ impl String {
self
}

/// Extracts a string slice containing the entire string.
/// Converts a `String` into a mutable string slice.
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// use std::ascii::AsciiExt;
///
/// let mut s = String::from("foobar");
/// let s_mut_str = s.as_mut_str();
///
/// s_mut_str.make_ascii_uppercase();
///
/// assert_eq!("FOOBAR", s_mut_str);
/// ```
#[inline]
#[stable(feature = "string_as_str", since = "1.7.0")]
pub fn as_mut_str(&mut self) -> &mut str {
Expand Down
10 changes: 7 additions & 3 deletions src/liballoc/vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,7 @@ impl<T> Vec<T> {
///
/// * `ptr` needs to have been previously allocated via [`String`]/`Vec<T>`
/// (at least, it's highly likely to be incorrect if it wasn't).
/// * `ptr`'s `T` needs to have the same size and alignment as it was allocated with.
/// * `length` needs to be less than or equal to `capacity`.
/// * `capacity` needs to be the capacity that the pointer was allocated with.
///
Expand Down Expand Up @@ -1969,16 +1970,19 @@ impl<T> Vec<T> {
/// Using this method is equivalent to the following code:
///
/// ```
/// # let some_predicate = |x: &mut i32| { *x == 2 };
/// # let mut vec = vec![1, 2, 3, 4, 5];
/// # let some_predicate = |x: &mut i32| { *x == 2 || *x == 3 || *x == 6 };
/// # let mut vec = vec![1, 2, 3, 4, 5, 6];
/// let mut i = 0;
/// while i != vec.len() {
/// if some_predicate(&mut vec[i]) {
/// let val = vec.remove(i);
/// // your code here
/// } else {
/// i += 1;
/// }
/// i += 1;
/// }
///
/// # assert_eq!(vec, vec![1, 4, 5]);
/// ```
///
/// But `drain_filter` is easier to use. `drain_filter` is also more efficient,
Expand Down
6 changes: 3 additions & 3 deletions src/libcore/intrinsics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -848,12 +848,12 @@ extern "rust-intrinsic" {
/// // The no-copy, unsafe way, still using transmute, but not UB.
/// // This is equivalent to the original, but safer, and reuses the
/// // same Vec internals. Therefore the new inner type must have the
/// // exact same size, and the same or lesser alignment, as the old
/// // type. The same caveats exist for this method as transmute, for
/// // exact same size, and the same alignment, as the old type.
/// // The same caveats exist for this method as transmute, for
/// // the original inner type (`&i32`) to the converted inner type
/// // (`Option<&i32>`), so read the nomicon pages linked above.
/// let v_from_raw = unsafe {
/// Vec::from_raw_parts(v_orig.as_mut_ptr(),
/// Vec::from_raw_parts(v_orig.as_mut_ptr() as *mut Option<&i32>,
/// v_orig.len(),
/// v_orig.capacity())
/// };
Expand Down
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
Loading