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 11 pull requests #38958

Merged
merged 26 commits into from
Jan 10, 2017
Merged
Changes from 2 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
51b655e
std: Remove unused objects from compiler-builtins
alexcrichton Dec 26, 2016
ca9b07b
Replace uses of `#[unsafe_destructor_blind_to_params]` with `#[may_da…
apasel422 Dec 28, 2016
ae23f03
Doc fix
minaguib Jan 3, 2017
07e844f
Add more docs for CoerceUnsized and Unsize
Manishearth Jan 4, 2017
1a4a6b9
Add test for correct span for type
estebank Dec 25, 2016
8d076ce
Fix typo in tuple docs
ollie27 Jan 5, 2017
943c53b
Update usage of rustc
F001 Jan 5, 2017
4794f95
Expand {Path,OsStr}::{to_str,to_string_lossy} doc examples.
frewsxcv Jan 5, 2017
56e5867
ICH: Add some more test cases for trait impls.
michaelwoerister Jan 5, 2017
5cb37f6
Update vec.rs
richard-uk1 Jan 6, 2017
0a85d5f
Update vec.rs
richard-uk1 Jan 6, 2017
e72b203
Test for appropriate span on second custom derive
estebank Dec 25, 2016
c999221
Move check-ui to fulldeps so librustc is available
estebank Jan 7, 2017
78e9093
trying to figure out why this test failes, might need help
estebank Jan 8, 2017
d8b3a64
review comment
estebank Jan 9, 2017
a81cd32
Rollup merge of #38606 - estebank:test-for-27522, r=petrochenkov
sanxiyn Jan 10, 2017
3149261
Rollup merge of #38607 - estebank:test-for-36935, r=alexcrichton
sanxiyn Jan 10, 2017
4d3d2c7
Rollup merge of #38623 - alexcrichton:less-osx-warnings, r=aturon
sanxiyn Jan 10, 2017
d350c9b
Rollup merge of #38664 - apasel422:may-dangle, r=pnkfelix
sanxiyn Jan 10, 2017
25a9d91
Rollup merge of #38799 - minaguib:patch-1, r=steveklabnik
sanxiyn Jan 10, 2017
ac27238
Rollup merge of #38816 - Manishearth:coercion-doc, r=GuillaumeGomez
sanxiyn Jan 10, 2017
a62f1b5
Rollup merge of #38836 - ollie27:patch-1, r=steveklabnik
sanxiyn Jan 10, 2017
20c7dbc
Rollup merge of #38839 - frewsxcv:osstr-to-str, r=GuillaumeGomez
sanxiyn Jan 10, 2017
833d693
Rollup merge of #38841 - F001:Fix, r=steveklabnik
sanxiyn Jan 10, 2017
8ccb3ef
Rollup merge of #38849 - michaelwoerister:ich-trait-impl-test, r=niko…
sanxiyn Jan 10, 2017
db74f11
Rollup merge of #38874 - derekdreery:patch-1, r=steveklabnik
sanxiyn Jan 10, 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
23 changes: 23 additions & 0 deletions src/libstd/ffi/os_str.rs
Original file line number Diff line number Diff line change
@@ -259,6 +259,15 @@ impl OsStr {
/// Yields a `&str` slice if the `OsStr` is valid Unicode.
///
/// This conversion may entail doing a check for UTF-8 validity.
///
/// # Examples
///
/// ```
/// use std::ffi::OsStr;
///
/// let os_str = OsStr::new("foo");
/// assert_eq!(os_str.to_str(), Some("foo"));
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
pub fn to_str(&self) -> Option<&str> {
self.inner.to_str()
@@ -267,6 +276,20 @@ impl OsStr {
/// Converts an `OsStr` to a `Cow<str>`.
///
/// Any non-Unicode sequences are replaced with U+FFFD REPLACEMENT CHARACTER.
///
/// # Examples
///
/// Calling `to_string_lossy` on an `OsStr` with valid unicode:
///
/// ```
/// use std::ffi::OsStr;
///
/// let os_str = OsStr::new("foo");
/// assert_eq!(os_str.to_string_lossy(), "foo");
/// ```
///
/// Had `os_str` contained invalid unicode, the `to_string_lossy` call might
/// have returned `"fo�"`.
#[stable(feature = "rust1", since = "1.0.0")]
pub fn to_string_lossy(&self) -> Cow<str> {
self.inner.to_string_lossy()
13 changes: 9 additions & 4 deletions src/libstd/path.rs
Original file line number Diff line number Diff line change
@@ -1428,8 +1428,8 @@ impl Path {
/// ```
/// use std::path::Path;
///
/// let path_str = Path::new("foo.txt").to_str();
/// assert_eq!(path_str, Some("foo.txt"));
/// let path = Path::new("foo.txt");
/// assert_eq!(path.to_str(), Some("foo.txt"));
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
pub fn to_str(&self) -> Option<&str> {
@@ -1444,12 +1444,17 @@ impl Path {
///
/// # Examples
///
/// Calling `to_string_lossy` on a `Path` with valid unicode:
///
/// ```
/// use std::path::Path;
///
/// let path_str = Path::new("foo.txt").to_string_lossy();
/// assert_eq!(path_str, "foo.txt");
/// let path = Path::new("foo.txt");
/// assert_eq!(path.to_string_lossy(), "foo.txt");
/// ```
///
/// Had `os_str` contained invalid unicode, the `to_string_lossy` call might
/// have returned `"fo�.txt"`.
#[stable(feature = "rust1", since = "1.0.0")]
pub fn to_string_lossy(&self) -> Cow<str> {
self.inner.to_string_lossy()