Commit graph

8410 commits

Author SHA1 Message Date
Kevin Butler
7690ec89ff libstd: implement From<&Path|PathBuf> for Cow<Path> 2015-11-03 11:25:34 +00:00
bors
3330f54198 Auto merge of #29514 - apasel422:issue-26220, r=alexcrichton
Closes #26220.

r? @alexcrichton
2015-11-03 04:52:12 +00:00
bors
a1fd944eb8 Auto merge of #29456 - alexcrichton:path-hash, r=aturon
Almost all operations on Path are based on the components iterator in one form
or another to handle equivalent paths. The `Hash` implementations, however,
mistakenly just went straight to the underlying `OsStr`, causing these
equivalent paths to not get merged together.

This commit updates the `Hash` implementation to also be based on the iterator
which should ensure that if two paths are equal they hash to the same thing.

cc #29008, but doesn't close it
2015-11-02 21:56:47 +00:00
Alex Crichton
d2dd700891 std: Base Hash for Path on its iterator
Almost all operations on Path are based on the components iterator in one form
or another to handle equivalent paths. The `Hash` implementations, however,
mistakenly just went straight to the underlying `OsStr`, causing these
equivalent paths to not get merged together.

This commit updates the `Hash` implementation to also be based on the iterator
which should ensure that if two paths are equal they hash to the same thing.

cc #29008, but doesn't close it
2015-11-02 12:58:54 -08:00
bors
cf2319bbb6 Auto merge of #29510 - mneumann:dragonfly-guard-page, r=alexcrichton
Only tested on DragonFly.
2015-11-02 18:29:33 +00:00
Andrew Paseltiner
6ad6cc30ef Implement IntoIterator for &{Path, PathBuf}
Closes #26220.
2015-11-01 18:04:53 -05:00
Michael Neumann
9415450ace Use guard-pages also on DragonFly/FreeBSD.
Only tested on DragonFly.
2015-11-01 22:56:31 +01:00
bors
71409184dc Auto merge of #29177 - vadimcn:rtstuff, r=alexcrichton
Note: for now, this change only affects `-windows-gnu` builds.

So why was this `libgcc` dylib dependency needed in the first place?
The stack unwinder needs to know about locations of unwind tables of all the modules loaded in the current process.  The easiest portable way of achieving this is to have each module register itself with the unwinder when loaded into the process.  All modules compiled by GCC do this by calling the __register_frame_info() in their startup code (that's `crtbegin.o` and `crtend.o`, which are automatically linked into any gcc output).
Another important piece is that there should be only one copy of the unwinder (and thus unwind tables registry) in the process.  This pretty much means that the unwinder must be in a shared library (unless everything is statically linked). 

Now, Rust compiler tries very hard to make sure that any given Rust crate appears in the final output just once.   So if we link the unwinder statically to one of Rust's crates, everything should be fine.

Unfortunately, GCC startup objects are built under assumption that `libgcc` is the one true place for the unwind info registry, so I couldn't find any better way than to replace them.  So out go `crtbegin`/`crtend`, in come `rsbegin`/`rsend`!  

A side benefit of this change is that rustc is now more in control of the command line that goes to the linker, so we could stop using `gcc` as the linker driver and just invoke `ld` directly.
2015-11-01 17:15:29 +00:00
Vadim Chugunov
0332ee9f63 Fix stage0 ICE caused by the old _Unwind_Resume override trickery. 2015-10-31 18:52:37 -07:00
bors
1a2eaffb63 Auto merge of #29487 - sfackler:current-exe-docs, r=steveklabnik
The "optionally" stuff just makes things confusing.

r? @steveklabnik
2015-10-31 14:13:43 +00:00
Steven Fackler
4af19537b2 Tweak env docs a bit
The "optionally" stuff just makes things confusing.
2015-10-30 22:13:32 -07:00
bors
fa7a3c210d Auto merge of #29484 - steveklabnik:gh29330, r=brson
These two commits do a few things:

1. reformat to 80 cols
2. use the reference-style links where appropriate for improved in-source readability
3. adds a few links, tweaks a couple of words, `3` -> `three`, stuff like that

While the diff is big due to these edits, there's no significant content change.

r? @brson
2015-10-31 04:04:45 +00:00
Steve Klabnik
744df28758 Some fixes to std index docs
Part of https://github.com/rust-lang/rust/issues/29330

Needed because of https://github.com/rust-lang/rust/issues/29481 and https://github.com/rust-lang/rust/issues/29483
2015-10-30 17:43:05 -04:00
Steve Klabnik
e2906dbeac Clean up formatting on std main page
Part of #29330
2015-10-30 17:18:26 -04:00
Alexis Beingessner
e351595c61 don't use drop_in_place as an intrinsic 2015-10-30 11:24:54 -04:00
bors
e8e6892e3c Auto merge of #29289 - DiamondLovesYou:pnacl-std-crates, r=alexcrichton 2015-10-29 03:20:13 +00:00
Richard Diamond
a7d93c939a Port the standard crates to PNaCl/NaCl. 2015-10-28 17:23:28 -05:00
bors
cb591e517a Auto merge of #29298 - tbu-:pr_doc_env_panic, r=alexcrichton 2015-10-27 04:45:39 +00:00
bors
72ed590f8b Auto merge of #29301 - reddraggone9:patch-1, r=alexcrichton
Added a single character to fix a typo in a doc comment.
2015-10-26 06:37:12 +00:00
bors
908979d53d Auto merge of #29299 - tbu-:pr_btreemap_example_dup, r=alexcrichton 2015-10-26 02:56:27 +00:00
Tobias Bucher
fe2a47b88a Say that std::env::{set_var, unset_var} *may* panic
Previously the documentation suggested that the documentation about the
panics are guarantees.
2015-10-25 20:03:42 +00:00
bors
e02ada6d38 Auto merge of #29254 - alexcrichton:stabilize-1.5, r=brson
This commit stabilizes and deprecates library APIs whose FCP has closed in the
last cycle, specifically:

Stabilized APIs:

* `fs::canonicalize`
* `Path::{metadata, symlink_metadata, canonicalize, read_link, read_dir, exists,
   is_file, is_dir}` - all moved to inherent methods from the `PathExt` trait.
* `Formatter::fill`
* `Formatter::width`
* `Formatter::precision`
* `Formatter::sign_plus`
* `Formatter::sign_minus`
* `Formatter::alternate`
* `Formatter::sign_aware_zero_pad`
* `string::ParseError`
* `Utf8Error::valid_up_to`
* `Iterator::{cmp, partial_cmp, eq, ne, lt, le, gt, ge}`
* `<[T]>::split_{first,last}{,_mut}`
* `Condvar::wait_timeout` - note that `wait_timeout_ms` is not yet deprecated
  but will be once 1.5 is released.
* `str::{R,}MatchIndices`
* `str::{r,}match_indices`
* `char::from_u32_unchecked`
* `VecDeque::insert`
* `VecDeque::shrink_to_fit`
* `VecDeque::as_slices`
* `VecDeque::as_mut_slices`
* `VecDeque::swap_remove_front` - (renamed from `swap_front_remove`)
* `VecDeque::swap_remove_back` - (renamed from `swap_back_remove`)
* `Vec::resize`
* `str::slice_mut_unchecked`
* `FileTypeExt`
* `FileTypeExt::{is_block_device, is_char_device, is_fifo, is_socket}`
* `BinaryHeap::from` - `from_vec` deprecated in favor of this
* `BinaryHeap::into_vec` - plus a `Into` impl
* `BinaryHeap::into_sorted_vec`

Deprecated APIs

* `slice::ref_slice`
* `slice::mut_ref_slice`
* `iter::{range_inclusive, RangeInclusive}`
* `std::dynamic_lib`

Closes #27706
Closes #27725
cc #27726 (align not stabilized yet)
Closes #27734
Closes #27737
Closes #27742
Closes #27743
Closes #27772
Closes #27774
Closes #27777
Closes #27781
cc #27788 (a few remaining methods though)
Closes #27790
Closes #27793
Closes #27796
Closes #27810
cc #28147 (not all parts stabilized)
2015-10-25 16:38:38 +00:00
Alex Crichton
ff49733274 std: Stabilize library APIs for 1.5
This commit stabilizes and deprecates library APIs whose FCP has closed in the
last cycle, specifically:

Stabilized APIs:

* `fs::canonicalize`
* `Path::{metadata, symlink_metadata, canonicalize, read_link, read_dir, exists,
   is_file, is_dir}` - all moved to inherent methods from the `PathExt` trait.
* `Formatter::fill`
* `Formatter::width`
* `Formatter::precision`
* `Formatter::sign_plus`
* `Formatter::sign_minus`
* `Formatter::alternate`
* `Formatter::sign_aware_zero_pad`
* `string::ParseError`
* `Utf8Error::valid_up_to`
* `Iterator::{cmp, partial_cmp, eq, ne, lt, le, gt, ge}`
* `<[T]>::split_{first,last}{,_mut}`
* `Condvar::wait_timeout` - note that `wait_timeout_ms` is not yet deprecated
  but will be once 1.5 is released.
* `str::{R,}MatchIndices`
* `str::{r,}match_indices`
* `char::from_u32_unchecked`
* `VecDeque::insert`
* `VecDeque::shrink_to_fit`
* `VecDeque::as_slices`
* `VecDeque::as_mut_slices`
* `VecDeque::swap_remove_front` - (renamed from `swap_front_remove`)
* `VecDeque::swap_remove_back` - (renamed from `swap_back_remove`)
* `Vec::resize`
* `str::slice_mut_unchecked`
* `FileTypeExt`
* `FileTypeExt::{is_block_device, is_char_device, is_fifo, is_socket}`
* `BinaryHeap::from` - `from_vec` deprecated in favor of this
* `BinaryHeap::into_vec` - plus a `Into` impl
* `BinaryHeap::into_sorted_vec`

Deprecated APIs

* `slice::ref_slice`
* `slice::mut_ref_slice`
* `iter::{range_inclusive, RangeInclusive}`
* `std::dynamic_lib`

Closes #27706
Closes #27725
cc #27726 (align not stabilized yet)
Closes #27734
Closes #27737
Closes #27742
Closes #27743
Closes #27772
Closes #27774
Closes #27777
Closes #27781
cc #27788 (a few remaining methods though)
Closes #27790
Closes #27793
Closes #27796
Closes #27810
cc #28147 (not all parts stabilized)
2015-10-25 09:36:32 -07:00
Lee Jenkins
0044a68249 Fix doc comment typo
Added a single character to fix a typo in a doc comment.
2015-10-25 09:17:27 -05:00
Tobias Bucher
5794950c2d Document possible panics for std::env::{set_var, unset_var} 2015-10-25 12:04:29 +00:00
Tobias Bucher
4b45f39f92 Remove key duplication from BTreeMap example in collections 2015-10-25 12:03:21 +00:00
bors
1d792a64b6 Auto merge of #29256 - alexcrichton:less-flaky, r=brson
The new bots we have may conflict with one another on base ports, causing tests
to fail. For example the linux-musl-64-opt and linux-64-opt bots are using the
same base port right now, causing some spurious failures every now and then.
2015-10-25 02:12:00 +00:00
bors
8d86d1a4e1 Auto merge of #29215 - fhahn:issue-28157-bad-semicolon, r=alexcrichton
PR for #28157. At the moment, `rustc` emits a warning when a bare semicolon is encountered (could also be a fail, but I think this is a backwards incompatible change).

Also I am not sure where the best place for a test for that warning would be. Seems run-pass tests do not check warnings.
2015-10-24 18:37:09 +00:00
Florian Hahn
107b4aa329 Remove bare semicolons 2015-10-24 00:35:44 +02:00
Alex Crichton
2098ff4a33 std: Add more entries to stdtest base_port
The new bots we have may conflict with one another on base ports, causing tests
to fail. For example the linux-musl-64-opt and linux-64-opt bots are using the
same base port right now, causing some spurious failures every now and then.
2015-10-23 10:51:48 -07:00
Vadim Chugunov
afc3046515 Drop advapi32 and shell32 from late_link_args. 2015-10-23 09:35:02 -07:00
bors
e518c057f5 Auto merge of #27894 - steveklabnik:gh26888, r=alexcrichton
{BTree,Hash}{Map,Set} will not update their key if it already exists, which
can matter with more complex keys. This behavior is now documented.

Fixes #26888
2015-10-23 03:13:10 +00:00
Steve Klabnik
e8e3c6f386 Document replacement behavior in some collections
{BTree,Hash}{Map,Set} will not update their key if it already exists, which
can matter with more complex keys. This behavior is now documented.

Fixes #26888
2015-10-22 20:30:42 -04:00
Wesley Wiser
3673978539 Fix doc sample for Cursor
Fixes #29219
2015-10-21 22:33:24 -04:00
Vadim Chugunov
d710f8ba1f Moar comments. 2015-10-21 10:05:27 -07:00
Alex Crichton
8aa6a117a4 std: Implement FromStr for SocketAddrV{4,6}
This was already implemented for SocketAddr, so the other types are lacking it
is just an oversight!

Closes #29183
2015-10-20 11:35:05 -07:00
bors
5e9f305642 Auto merge of #29187 - steveklabnik:rollup, r=steveklabnik
- Successful merges: #29158, #29162, #29175, #29176
- Failed merges:
2015-10-20 15:28:08 +00:00
Steve Klabnik
b314f845e0 Rollup merge of #29158 - arcnmx:process-test, r=alexcrichton
This test was mysteriously messed with as part of #28500

r? @alexcrichton
2015-10-20 09:43:47 -04:00
bors
229385c4f8 Auto merge of #29156 - arcnmx:net-tests, r=alexcrichton
Just some minor cleanup.
2015-10-20 13:39:23 +00:00
bors
a9d5285344 Auto merge of #29155 - retep998:read-no-dir, r=alexcrichton
Fixes #29150 

r? @alexcrichton
2015-10-20 10:06:42 +00:00
Vadim Chugunov
145b8438fe Use cfg_attr for switching link attrs in libunwind. 2015-10-19 18:57:09 -07:00
Steve Klabnik
2f2d8df534 Rollup merge of #29169 - apasel422:spell, r=steveklabnik
r? @steveklabnik
2015-10-19 17:14:08 -04:00
Steve Klabnik
e1d4983879 Rollup merge of #29125 - iKevinY:std-io-doc-fixes, r=alexcrichton
Just a few minor spelling/grammar fixes.
2015-10-19 17:14:07 -04:00
Andrew Paseltiner
9431f3cc7b Correct spelling in docs 2015-10-19 13:48:42 -04:00
bors
c74454a360 Auto merge of #28977 - arcnmx:cstring-into, r=alexcrichton
`OsString` has these sorts of conversions, while `CString` has been missing them. I'm iffy on `into_string` simply because the return type would be better off as `FromUtf8Error<CString>`, which of course isn't generic 😢

Also should a different/new feature gate be used?
2015-10-19 17:05:40 +00:00
arcnmx
cb48d44583 Owned conversions for CString 2015-10-19 01:29:44 -04:00
Peter Atashian
dd11d3c619 Add error kind handling for ERROR_PATH_NOT_FOUND
Fixes #29150

Signed-off-by: Peter Atashian <retep998@gmail.com>
2015-10-19 00:54:51 -04:00
arcnmx
9c3a06219a Add missing #[test] attribute to test 2015-10-19 00:54:31 -04:00
arcnmx
f7ad223f8e Touch up net tests 2015-10-19 00:19:01 -04:00
Vadim Chugunov
c807ff3b44 Create entry points for unwind frame registry in libstd. 2015-10-18 19:57:32 -07:00