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 18 pull requests #44550

Closed
wants to merge 44 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 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
6b4bdbd
Require rlibs for dependent crates when linking static executables
smaeul Sep 2, 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
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
31368ae
Rollup merge of #44131 - smaeul:openssl-perl, r=Mark-Simulacrum
GuillaumeGomez Sep 13, 2017
084fa1a
Rollup merge of #44254 - GuillaumeGomez:const-fix-rustdoc, r=QuietMis…
GuillaumeGomez Sep 13, 2017
3d93a53
Rollup merge of #44279 - smaeul:crt_static-deps, r=alexcrichton
GuillaumeGomez Sep 13, 2017
5ebf810
Rollup merge of #44356 - nrc:rls-component-manifest, r=@alexcrichton
GuillaumeGomez Sep 13, 2017
6a6190f
Rollup merge of #44368 - ollie27:rustdoc_pulldown_ids, r=QuietMisdreavus
GuillaumeGomez Sep 13, 2017
5faf67b
Rollup merge of #44374 - jsheard:threadname, r=alexcrichton
GuillaumeGomez Sep 13, 2017
95a0696
Rollup merge of #44388 - tbu-:pr_doc_udp_connect_multiple, r=frewsxcv
GuillaumeGomez Sep 13, 2017
f6c9f1b
Rollup merge of #44430 - steveklabnik:update-mdbook, r=alexcrichton
GuillaumeGomez Sep 13, 2017
7d1053b
Rollup merge of #44450 - SergioBenitez:master, r=nrc
GuillaumeGomez Sep 13, 2017
de562c6
Rollup merge of #44453 - tommyip:doc_string_as_mut_str, r=frewsxcv
GuillaumeGomez Sep 13, 2017
b49660a
Rollup merge of #44472 - smt923:master, r=frewsxcv
GuillaumeGomez Sep 13, 2017
d318148
Rollup merge of #44476 - integer32llc:update-label-explanation, r=Mar…
GuillaumeGomez Sep 13, 2017
a7183cf
Rollup merge of #44477 - napen123:master, r=frewsxcv
GuillaumeGomez Sep 13, 2017
b964209
Rollup merge of #44485 - 42triangles:master, r=frewsxcv
GuillaumeGomez Sep 13, 2017
be19ea3
Rollup merge of #44497 - tommyip:doc_example, r=frewsxcv
GuillaumeGomez Sep 13, 2017
0aade70
Rollup merge of #44521 - rwakulszowa:str_utf16_doc, r=frewsxcv
GuillaumeGomez Sep 13, 2017
5d9e3ef
Rollup merge of #44536 - Havvy:transmute-docs, r=steveklabnik
GuillaumeGomez Sep 13, 2017
cfd19f4
Rollup merge of #44541 - GuillaumeGomez:openoptions-docs, r=QuietMisd…
GuillaumeGomez Sep 13, 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
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
1 change: 1 addition & 0 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
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
44 changes: 44 additions & 0 deletions src/libcore/str/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,37 @@ pub fn from_utf8(v: &[u8]) -> Result<&str, Utf8Error> {
}

/// Converts a mutable slice of bytes to a mutable string slice.
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// use std::str;
///
/// // "Hello, Rust!" as a mutable vector
/// let mut hellorust = vec![72, 101, 108, 108, 111, 44, 32, 82, 117, 115, 116, 33];
///
/// // As we know these bytes are valid, we can use `unwrap()`
/// let outstr = str::from_utf8_mut(&mut hellorust).unwrap();
///
/// assert_eq!("Hello, Rust!", outstr);
/// ```
///
/// Incorrect bytes:
///
/// ```
/// use std::str;
///
/// // Some invalid bytes in a mutable vector
/// let mut invalid = vec![128, 223];
///
/// assert!(str::from_utf8_mut(&mut invalid).is_err());
/// ```
/// See the docs for [`Utf8Error`][error] for more details on the kinds of
/// errors that can be returned.
///
/// [error]: struct.Utf8Error.html
#[stable(feature = "str_mut_extras", since = "1.20.0")]
pub fn from_utf8_mut(v: &mut [u8]) -> Result<&mut str, Utf8Error> {
run_utf8_validation(v)?;
Expand Down Expand Up @@ -382,6 +413,19 @@ pub unsafe fn from_utf8_unchecked(v: &[u8]) -> &str {
/// See the immutable version, [`from_utf8_unchecked()`][fromutf8], for more information.
///
/// [fromutf8]: fn.from_utf8_unchecked.html
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// use std::str;
///
/// let mut heart = vec![240, 159, 146, 150];
/// let heart = unsafe { str::from_utf8_unchecked_mut(&mut heart) };
///
/// assert_eq!("💖", heart);
/// ```
#[inline]
#[stable(feature = "str_mut_extras", since = "1.20.0")]
pub unsafe fn from_utf8_unchecked_mut(v: &mut [u8]) -> &mut str {
Expand Down
Loading