Commit Graph

6832 Commits

Author SHA1 Message Date
Jorge Aparicio efc97a51ff convert remaining `range(a, b)` to `a..b` 2015-01-29 07:49:01 -05:00
Jorge Aparicio 7d661af9c8 `for x in range(a, b)` -> `for x in a..b`
sed -i 's/in range(\([^,]*\), *\([^()]*\))/in \1\.\.\2/g' **/*.rs
2015-01-29 07:47:37 -05:00
Jorge Aparicio c300d681bd `range(a, b).foo()` -> `(a..b).foo()`
sed -i 's/ range(\([^,]*\), *\([^()]*\))\./ (\1\.\.\2)\./g' **/*.rs
2015-01-29 07:46:44 -05:00
bors 3d6f5100af Auto merge of #21730 - Manishearth:rollup, r=alexcrichton
Should clear our backlog of rollups from the queue
2015-01-29 11:28:30 +00:00
Flavio Percoco 947f6ca4a1 Feature gate macro_reexport. Fixes #20906 2015-01-29 08:44:25 +01:00
bors bedd8108dc Auto merge of #21680 - japaric:slice, r=alexcrichton
Replaces `slice_*` method calls with slicing syntax, and removes `as_slice()` calls that are redundant due to `Deref`.
2015-01-29 05:47:21 +00:00
Steven Fackler 26276f4751 Fix up check to bypass internal buffer
We don't care about how much space the allocation has, but the actual
usable space in the buffer.
2015-01-28 20:12:00 -08:00
Michael Neumann ca0e83cdec Fix wrong use std::io -> old_io 2015-01-29 01:56:59 +01:00
Manish Goregaokar 2403176dde Rollup merge of 21654 - FlaPer87:unify-impls, r=alexcrichton 2015-01-29 03:16:25 +05:30
Manish Goregaokar 0d1a4ac269 Rollup merge of #21640 - retep998:rmdir, r=alexcrichton
`_wrmdir` is literally just a wrapper around `RemoveDirectoryW`, so let's just use `RemoveDirectoryW`.
r? @alexcrichton
2015-01-29 03:04:10 +05:30
Manish Goregaokar c709ed2faf Merge remote-tracking branch 'origin/master' into rollup
Conflicts:
	src/libcollections/slice.rs
	src/libcore/nonzero.rs
	src/libcore/ops.rs
2015-01-28 23:31:03 +05:30
Vojtech Kral 9ee972ca32 Thread native name setting, fix #10302 2015-01-28 16:52:53 +01:00
Vojtech Kral 7e67eba180 Thread native name setting, fix #10302 2015-01-28 14:01:14 +01:00
Vojtech Kral 33a3d6d88f Thread native name setting, fix #10302 2015-01-28 13:48:27 +01:00
Manish Goregaokar 1df030059b Rollup merge of #21676 - Victory:fix-deprication-in-random, r=alexcrichton
Cleanup mention of uint, use usize/us instead. This includes the example `println!("{}", 2u * x);`
2015-01-28 04:35:57 +05:30
Brian Anderson 7122305053 Merge remote-tracking branch 'rust-lang/master'
Conflicts:
	src/libcore/cell.rs
	src/librustc_driver/test.rs
	src/libstd/old_io/net/tcp.rs
	src/libstd/old_io/process.rs
2015-01-27 15:05:04 -08:00
Manish Goregaokar 51ff9e82ec Rollup merge of #21602 - japaric:derive-copy, r=alexcrichton 2015-01-27 22:24:02 +05:30
Vojtech Kral c155208de4 Thread native name setting, fix #10302 2015-01-27 16:00:26 +01:00
Jorge Aparicio bce81e2464 cleanup: s/`v.slice*()`/`&v[a..b]`/g + remove redundant `as_slice()` calls 2015-01-27 09:03:06 -05:00
Felix S. Klock II 2c2f0f1216 accommodate new scoping rules in libstd unit tests. 2015-01-27 10:26:52 +01:00
Vojtech Kral ec4981ece8 Thread native name setting, fix #10302 2015-01-27 03:41:49 +01:00
Victory ac285d5531 Don't use if we can avoid it 2015-01-26 20:18:24 -05:00
Victory 23fd8cad04 cleanup depricated `uint` in rand mod and rand os 2015-01-26 19:48:29 -05:00
Alex Crichton 5d836cdf86 std: Rename Writer::write to Writer::write_all
In preparation for upcoming changes to the `Writer` trait (soon to be called
`Write`) this commit renames the current `write` method to `write_all` to match
the semantics of the upcoming `write_all` method. The `write` method will be
repurposed to return a `usize` indicating how much data was written which
differs from the current `write` semantics. In order to head off as much
unintended breakage as possible, the method is being deprecated now in favor of
a new name.

[breaking-change]
2015-01-26 16:01:58 -08:00
Alex Crichton 3a07f859b8 Fallout of io => old_io 2015-01-26 16:01:16 -08:00
Alex Crichton f72b164510 std: Rename io to old_io
In preparation for the I/O rejuvination of the standard library, this commit
renames the current `io` module to `old_io` in order to make room for the new
I/O modules. It is expected that the I/O RFCs will land incrementally over time
instead of all at once, and this provides a fresh clean path for new modules to
enter into as well as guaranteeing that all old infrastructure will remain in
place for some time.

As each `old_io` module is replaced it will be deprecated in-place for new
structures in `std::{io, fs, net}` (as appropriate).

This commit does *not* leave a reexport of `old_io as io` as the deprecation
lint does not currently warn on this form of use. This is quite a large breaking
change for all imports in existing code, but all functionality is retained
precisely as-is and path statements simply need to be renamed from `io` to
`old_io`.

[breaking-change]
2015-01-26 16:01:16 -08:00
Flavio Percoco fde4472848 Make Unix and Windows impls consistent
There are some explicit Send/Sync implementations for Window's types
that don't exist in Unix. While the end result will be the same, I
believe it's clearer if we keep the explicit implementations consistent
by making the os-specific types Send/Sync where needed and possible.

This commit addresses tcp. Existing differences below:

src/libstd/sys/unix/tcp.rs
unsafe impl Sync for TcpListener {}
unsafe impl Sync for AcceptorInner {}

src/libstd/sys/windows/tcp.rs
unsafe impl Send for Event {}
unsafe impl Sync for Event {}
unsafe impl Send for TcpListener {}
unsafe impl Sync for TcpListener {}
unsafe impl Send for TcpAcceptor {}
unsafe impl Sync for TcpAcceptor {}
unsafe impl Send for AcceptorInner {}
unsafe impl Sync for AcceptorInner {}
2015-01-26 09:12:28 +01:00
Flavio Percoco fff5600925 Make Unix and Windows impls consistent
There are some explicit Send/Sync implementations for Window's types
that don't exist in Unix. While the end result will be the same, I
believe it's clearer if we keep the explicit implementations consistent
by making the os-specific types Send/Sync where needed and possible.

This commit addresses pipe

src/libstd/sys/unix/pipe.rs
unsafe impl Send for UnixListener {}
unsafe impl Sync for UnixListener {}

src/libstd/sys/windows/pipe.rs
unsafe impl Send for UnixStream {}
unsafe impl Sync for UnixStream {}
unsafe impl Send for UnixListener {}
unsafe impl Sync for UnixListener {}
unsafe impl Send for UnixAcceptor {}
unsafe impl Sync for UnixAcceptor {}
unsafe impl Send for AcceptorState {}
unsafe impl Sync for AcceptorState {}
2015-01-26 09:12:26 +01:00
Brian Anderson d179ba3b8e Merge remote-tracking branch 'rust-lang/master'
Conflicts:
	src/libcore/cmp.rs
	src/libcore/fmt/mod.rs
	src/libcore/iter.rs
	src/libcore/marker.rs
	src/libcore/num/f32.rs
	src/libcore/num/f64.rs
	src/libcore/result.rs
	src/libcore/str/mod.rs
	src/librustc/lint/builtin.rs
	src/librustc/lint/context.rs
	src/libstd/sync/mpsc/mod.rs
	src/libstd/sync/poison.rs
2015-01-25 22:14:06 -08:00
Peter Atashian 8f38eae7ad wrmdir -> RemoveDirectoryW
Signed-off-by: Peter Atashian <retep998@gmail.com>
2015-01-25 23:00:21 -05:00
Jorge Aparicio bff462302b cleanup: s/impl Copy/#[derive(Copy)]/g 2015-01-25 11:20:38 -05:00
bors 0899807294 Auto merge of #20613 - dgriffen:master, r=alexcrichton 2015-01-25 10:59:28 +00:00
Brian Anderson 63fcbcf3ce Merge remote-tracking branch 'rust-lang/master'
Conflicts:
	mk/tests.mk
	src/liballoc/arc.rs
	src/liballoc/boxed.rs
	src/liballoc/rc.rs
	src/libcollections/bit.rs
	src/libcollections/btree/map.rs
	src/libcollections/btree/set.rs
	src/libcollections/dlist.rs
	src/libcollections/ring_buf.rs
	src/libcollections/slice.rs
	src/libcollections/str.rs
	src/libcollections/string.rs
	src/libcollections/vec.rs
	src/libcollections/vec_map.rs
	src/libcore/any.rs
	src/libcore/array.rs
	src/libcore/borrow.rs
	src/libcore/error.rs
	src/libcore/fmt/mod.rs
	src/libcore/iter.rs
	src/libcore/marker.rs
	src/libcore/ops.rs
	src/libcore/result.rs
	src/libcore/slice.rs
	src/libcore/str/mod.rs
	src/libregex/lib.rs
	src/libregex/re.rs
	src/librustc/lint/builtin.rs
	src/libstd/collections/hash/map.rs
	src/libstd/collections/hash/set.rs
	src/libstd/sync/mpsc/mod.rs
	src/libstd/sync/mutex.rs
	src/libstd/sync/poison.rs
	src/libstd/sync/rwlock.rs
	src/libsyntax/feature_gate.rs
	src/libsyntax/test.rs
2015-01-25 01:20:55 -08:00
bors 43046becce Auto merge of #21558 - alexcrichton:result-debug, r=aturon
This commit relaxes the bound on `Result::unwrap` and `Result::unwrap_err` from
the `Display` trait to the `Debug` trait for generating an error message about
the unwrapping operation.

This commit is a breaking change and any breakage should be mitigated by
ensuring that `Debug` is implemented on the relevant type.

[breaking-change]
2015-01-25 05:50:30 +00:00
Aaron Turon c5369ebc7f Add ffi::OsString and OsStr
Per [RFC 517](https://github.com/rust-lang/rfcs/pull/575/), this commit
introduces platform-native strings. The API is essentially as described
in the RFC.

The WTF-8 implementation is adapted from @SimonSapin's
[implementation](https://github.com/SimonSapin/rust-wtf8). To make this
work, some encodign and decoding functionality in `libcore` is now
exported in a "raw" fashion reusable for WTF-8. These exports are *not*
reexported in `std`, nor are they stable.
2015-01-24 10:21:30 -08:00
Daniel Griffen ec88426ea8 Implement winsize() for unix. 2015-01-24 04:25:17 -06:00
Brian Anderson b44ee371b8 grandfathered -> rust1 2015-01-23 21:48:20 -08:00
Brian Anderson 9758c488a9 Deprecated attributes don't take 'feature' names and are paired with stable/unstable
Conflicts:
	src/libcore/atomic.rs
	src/libcore/finally.rs
	src/test/auxiliary/inherited_stability.rs
	src/test/auxiliary/lint_stability.rs
2015-01-23 15:50:03 -08:00
Alex Crichton 08246520c0 std: Relax Result::unwrap() to Debug
This commit relaxes the bound on `Result::unwrap` and `Result::unwrap_err` from
the `Display` trait to the `Debug` trait for generating an error message about
the unwrapping operation.

This commit is a breaking change and any breakage should be mitigated by
ensuring that `Debug` is implemented on the relevant type.

[breaking-change]
2015-01-23 14:11:34 -08:00
Brian Anderson cd6d9eab5d Set unstable feature names appropriately
* `core` - for the core crate
* `hash` - hashing
* `io` - io
* `path` - path
* `alloc` - alloc crate
* `rand` - rand crate
* `collections` - collections crate
* `std_misc` - other parts of std
* `test` - test crate
* `rustc_private` - everything else
2015-01-23 13:28:40 -08:00
Brian Anderson 47905f98ee Add a missing stable attribute 2015-01-22 16:23:07 -08:00
Steve Klabnik 22ed381ada Rollup merge of #21477 - steveklabnik:gh21440, r=alexcrichton
Fixes #21440"
2015-01-22 18:09:59 -05:00
Steve Klabnik 3364d41282 Rollup merge of #21325 - nagisa:thread-panicking, r=steveklabnik
Previous wording wasn’t clear about its actual behaviour. It could be
interpreted as answering either:

* Can current thread panic?
* Is current thread unwinding because of panic?

r? @steveklabnik
2015-01-22 18:09:58 -05:00
Steve Klabnik 4db64bd824 Rollup merge of #21217 - Gankro:docadoca, r=steveklabnik
Not sure on what *exactly* should be said here, but I think this is the most important bit. This PR also establishes conventions for describing performance minimally.

I suggest to describe preformance for individual methods we use a `# Performance` heading. Not sure if we should have 

```
# Performance: O(1)
details details
```
or

```
# Performance:
O(1)
details details
```

Since I think most methods don't need discussion, the former seems more resonable. But it's kind of weird to have info "in" the heading.

r? @steveklabnik
2015-01-22 18:09:58 -05:00
Brian Anderson d3c0bb416e Put #[staged_api] behind the 'staged_api' gate 2015-01-22 13:47:56 -08:00
Brian Anderson 41278c5441 Remove 'since' from unstable attributes 2015-01-21 19:25:55 -08:00
Brian Anderson 7b73ec4698 Tie stability attributes to feature gates 2015-01-21 16:16:21 -08:00
Brian Anderson 94ca8a3610 Add 'feature' and 'since' to stability attributes 2015-01-21 16:16:18 -08:00
Alex Crichton ecbee2e568 More test fixes and rebase conflicts 2015-01-21 12:49:02 -08:00
Steve Klabnik bbbdd1086c Improve RwLock::new's docs
Fixes #21440"
2015-01-21 14:54:52 -05:00
Alex Crichton 886c6f3534 rollup merge of #21258: aturon/stab-3-index
Conflicts:
	src/libcore/ops.rs
	src/librustc_typeck/astconv.rs
	src/libstd/io/mem.rs
	src/libsyntax/parse/lexer/mod.rs
2015-01-21 11:53:49 -08:00
Alex Crichton 4ffde0814f Test fixes and rebase conflicts 2015-01-21 10:32:56 -08:00
Alex Crichton 87c3ee861e rollup merge of #21457: alexcrichton/issue-21436
Conflicts:
	src/liballoc/boxed.rs
	src/librustc/middle/traits/error_reporting.rs
	src/libstd/sync/mpsc/mod.rs
2015-01-21 09:20:35 -08:00
Alex Crichton 907db6c834 rollup merge of #21444: petrochenkov/null
Conflicts:
	src/libstd/sync/mpsc/select.rs
2015-01-21 09:18:07 -08:00
Alex Crichton 27838075e0 rollup merge of #21438: taralx/kill-racycell
Conflicts:
	src/libstd/sync/mpsc/mod.rs
2015-01-21 09:17:40 -08:00
Alex Crichton 04a2255739 rollup merge of #21437: FlaPer87/snapshot
r? @alexcrichton
2015-01-21 09:16:40 -08:00
Alex Crichton 9ef5484783 rollup merge of #21423: oli-obk/prettier_read_until
Conflicts:
	src/libstd/io/mod.rs
2015-01-21 09:16:33 -08:00
Alex Crichton e4e9a2771c rollup merge of #21419: Toby-S/patch-1
This just corrects a couple of typos in doc comments, and changes some to conform to the Rust guidelines.
2015-01-21 09:16:03 -08:00
Alex Crichton a6780d8c6b rollup merge of #21414: ejjeong/aarch64-linux-android
Initial support for aarch64-linux-android (#18920)
- Add new configuration files
- Modify some options to compile & link succesfully.
  (PIE, disable tls on jemalloc, modify some external function linkage, ..)
- To build, refer to https://github.com/rust-lang/rust/wiki/Doc-building-for-android.
   (tested with platform=21 and toolchain=aarch64-linux-android-4.9)
2015-01-21 09:15:59 -08:00
Alex Crichton 1646707c6e rollup merge of #21396: japaric/no-parens-in-range
Conflicts:
	src/libsyntax/parse/lexer/comments.rs
2015-01-21 09:15:15 -08:00
Alex Crichton 8b10733e7a rollup merge of #21389: retep998/timer
Fixes #20943 and adds a test for it
r? @alexcrichton
2015-01-21 09:14:36 -08:00
Aaron Turon a506d4cbfe Fallout from stabilization. 2015-01-21 08:11:07 -08:00
Alex Crichton 3cb9fa26ef std: Rename Show/String to Debug/Display
This commit is an implementation of [RFC 565][rfc] which is a stabilization of
the `std::fmt` module and the implementations of various formatting traits.
Specifically, the following changes were performed:

[rfc]: https://github.com/rust-lang/rfcs/blob/master/text/0565-show-string-guidelines.md

* The `Show` trait is now deprecated, it was renamed to `Debug`
* The `String` trait is now deprecated, it was renamed to `Display`
* Many `Debug` and `Display` implementations were audited in accordance with the
  RFC and audited implementations now have the `#[stable]` attribute
  * Integers and floats no longer print a suffix
  * Smart pointers no longer print details that they are a smart pointer
  * Paths with `Debug` are now quoted and escape characters
* The `unwrap` methods on `Result` now require `Display` instead of `Debug`
* The `Error` trait no longer has a `detail` method and now requires that
  `Display` must be implemented. With the loss of `String`, this has moved into
  libcore.
* `impl<E: Error> FromError<E> for Box<Error>` now exists
* `derive(Show)` has been renamed to `derive(Debug)`. This is not currently
  warned about due to warnings being emitted on stage1+

While backwards compatibility is attempted to be maintained with a blanket
implementation of `Display` for the old `String` trait (and the same for
`Show`/`Debug`) this is still a breaking change due to primitives no longer
implementing `String` as well as modifications such as `unwrap` and the `Error`
trait. Most code is fairly straightforward to update with a rename or tweaks of
method calls.

[breaking-change]
Closes #21436
2015-01-20 22:36:13 -08:00
bors 51e28dd0c8 Auto merge of #21395 - sfackler:fix-cvar-test, r=alexcrichton
r? @alexcrichton
2015-01-21 05:55:02 +00:00
Flavio Percoco cd631c6914 Register snapshot for 9006c3c 2015-01-20 22:15:44 +01:00
JP Sugarbroad b6380f5c67 Kill RacyCell in favor of marking SyncSender explicitly Send. 2015-01-20 12:34:18 -08:00
Barosl LEE 3d6568fcb2 Rollup merge of #21387 - retep998:hmodule, r=alexcrichton
r? @alexcrichton
2015-01-21 02:16:51 +09:00
Barosl LEE a79f1921a9 Rollup merge of #21375 - petrochenkov:ssbsl, r=alexcrichton
After PR #19766 added implicit coersions `*mut T -> *const T`, the explicit casts can be removed.
(The number of such casts turned out to be relatively small).
2015-01-21 02:16:50 +09:00
Barosl LEE 75efb22808 Rollup merge of #21359 - WiSaGaN:bugfix/fix_marker, r=alexcrichton
From std::markers to std::marker.
2015-01-21 02:16:49 +09:00
Barosl LEE efa8360f98 Rollup merge of #21331 - michaelsproul:sync-error-impls, r=alexcrichton
Two errors in `std::sync` are currently missing implementations of the standard error trait because they contain types which aren't `Send`.

This PR therefore requires #21312.
2015-01-21 02:16:47 +09:00
Barosl LEE e63443d536 Rollup merge of #21312 - michaelsproul:remove-error-send-bound, r=aturon
As discussed with @aturon, this PR removes the `Send` bound from `std::error::Error`, allowing us to implement `Error` for error types containing non-`Send` types. Current examples include `PoisonError` and `TryLockError` from `std::sync` which contain a Guard that we don't want sent between tasks.

[breaking-change]
2015-01-21 02:16:47 +09:00
Barosl LEE 8f5ab04b47 Rollup merge of #21302 - gutworth:rm-find-equiv-test, r=brson 2015-01-21 02:16:46 +09:00
Barosl LEE 1d8b917811 Rollup merge of #20998 - estsauver:20984, r=steveklabnik
There are a large number of places that incorrectly refer
to deriving in comments, instead of derives.

If someone could look at src/etc/generate-deriving-span-tests.py,
I'm not sure how those tests were passing before/if they were.
2015-01-21 02:16:45 +09:00
Oliver Schneider f2b8404bcb prettier Buffer::read_until 2015-01-20 14:18:17 +01:00
Toby Scrace 01d7b8c669 Correct small typos in map.rs.
This just corrects a couple of typos in doc comments, and changes some to conform to the Rust guidelines.
2015-01-20 12:18:23 +00:00
Eunji Jeong 940080501b Initial support for aarch64-linux-android 2015-01-20 17:43:15 +09:00
bors 54c9a4655b Auto merge of #20082 - pczarn:btree-bounded-iter, r=Gankro
Part of collections reform v1, #18424
Also, iteration is simplified:
```
before
test btree::map::bench::iter_1000                          ... bench:     17177 ns/iter (+/- 6302)
test btree::map::bench::iter_100000                        ... bench:   1735731 ns/iter (+/- 23908)
test btree::map::bench::iter_20                            ... bench:       386 ns/iter (+/- 148)
after
test btree::map::bench::iter_1000                          ... bench:     15777 ns/iter (+/- 346)
test btree::map::bench::iter_100000                        ... bench:   1602604 ns/iter (+/- 73629)
test btree::map::bench::iter_20                            ... bench:       339 ns/iter (+/- 91)
```
cc @gereeter @cgaebel
r? @Gankro
2015-01-19 17:43:47 +00:00
Jorge Aparicio 49684850be remove unnecessary parentheses from range notation 2015-01-19 12:24:43 -05:00
Steven Fackler 2854f0c75e Fix flaky condvar test 2015-01-19 09:11:06 -08:00
Piotr Czarnecki 429c23d5f4 Implement range and range_mut for BTree
Simplify BTree's iterators, too.
2015-01-19 17:48:59 +01:00
Peter Atashian abccfa4018 Impl Send for Timer on Windows
Fixes #20943

Signed-off-by: Peter Atashian <retep998@gmail.com>
2015-01-19 05:55:15 -05:00
Peter Atashian b57662aed7 Fix HMODULE
Signed-off-by: Peter Atashian <retep998@gmail.com>
2015-01-19 03:43:44 -05:00
we 2c2480df5d Replace `0 as *const/mut T` with `ptr::null/null_mut()` 2015-01-19 08:27:09 +03:00
klutzy d053ccb45f std::dynamic_lib: Fix Windows error handling
This is a [breaking-change] since `std::dynamic_lib::dl` is now
private.

When `LoadLibraryW()` fails, original code called `errno()` to get error
code.  However, there was local allocation of `Vec` before
`LoadLibraryW()`, and it drops before `errno()`, and the drop
(deallocation) changed `errno`! Therefore `dynamic_lib::open()` thought
it always succeeded.
This commit fixes the issue.

This commit also sets Windows error mode during `LoadLibrary()` to
prevent "dll load failed" dialog.
2015-01-19 00:12:45 +09:00
Wangshan Lu e28da7ad44 Fix std::marker.
From std::markers to std::marker.
2015-01-18 22:17:44 +08:00
Brian Anderson 6f3a80e411 Set allow(unstable) in crates that use unstable features
Lets them build with the -dev, -nightly, or snapshot compiler
2015-01-17 16:38:04 -08:00
Eduard Burtescu 89b80faa8e Register new snapshots. 2015-01-17 16:37:34 -08:00
Michael Sproul ffdf1118d5 Implement the error trait for errors in std::sync. 2015-01-17 14:35:16 -08:00
Simonas Kazlauskas 618cf5f8d7 Refine wording of Thread::panicking
Previous wording wasn’t clear about its actual behaviour. It could be
interpreted as answering either:

* Can current thread panic?
* Is current thread unwinding because of panic?
2015-01-17 23:53:53 +02:00
Michael Sproul 97a2b2638d Remove Send bound from Error trait. 2015-01-17 12:20:11 -08:00
Earl St Sauver 6ab95bdd62 s/deriving/derives in Comments/Docs
There are a large number of places that incorrectly refer
to deriving in comments, instead of derives.

Fixes #20984
2015-01-17 11:08:02 -08:00
Steve Klabnik 69e9b462e9 fix rollup 2015-01-17 13:58:54 -05:00
Benjamin Peterson 35d46fabaf remove test_find_equiv, since find_equiv doesn't exist anymore 2015-01-17 11:29:24 -05:00
Alex Crichton 34fa70fba5 std: Move the bitflags! macro to a gated crate
In accordance with [collections reform part 2][rfc] this macro has been moved to
an external [bitflags crate][crate] which is [available though
crates.io][cratesio]. Inside the standard distribution the macro has been moved
to a crate called `rustc_bitflags` for current users to continue using.

[rfc]: https://github.com/rust-lang/rfcs/blob/master/text/0509-collections-reform-part-2.md
[crate]: https://github.com/rust-lang/bitflags
[cratesio]: http://crates.io/crates/bitflags

The major user of `bitflags!` in terms of a public-facing possibly-stable API
today is the `FilePermissions` structure inside of `std::io`. This user,
however, will likely no longer use `bitflags!` after I/O reform has landed. To
prevent breaking APIs today, this structure remains as-is.

Current users of the `bitflags!` macro should add this to their `Cargo.toml`:

    bitflags = "0.1"

and this to their crate root:

    #[macro_use] extern crate bitflags;

Due to the removal of a public macro, this is a:

[breaking-change]
2015-01-17 10:51:07 -05:00
Steve Klabnik 078bd498b9 Evaluate # fn in docs
I searched for times when we were hiding functions with # in the documentation,
and fixed them to not use it unless neccesary.

I also made random improvements whenever I changed something. For example,
I changed Example to Examples, for consistency.

Fixes #13423
2015-01-17 10:49:49 -05:00
we 812ce6c190 Remove unnecessary explicit conversions to *const T 2015-01-17 07:34:10 +03:00
bors 378fb5846d auto merge of #21132 : sfackler/rust/wait_timeout, r=alexcrichton
**The implementation is a direct adaptation of libcxx's condition_variable implementation.**

I also added a wait_timeout_with method, which matches the second overload in C++'s condition_variable. The implementation right now is kind of dumb but it works. There is an outstanding issue with it: as is it doesn't support the use case where a user doesn't care about poisoning and wants to continue through poison.

r? @alexcrichton @aturon
2015-01-17 03:51:34 +00:00
Steven Fackler 08f6380a9f Rewrite Condvar::wait_timeout and make it public
**The implementation is a direct adaptation of libcxx's
condition_variable implementation.**

pthread_cond_timedwait uses the non-monotonic system clock. It's
possible to change the clock to a monotonic via pthread_cond_attr, but
this is incompatible with static initialization. To deal with this, we
calculate the timeout using the system clock, and maintain a separate
record of the start and end times with a monotonic clock to be used for
calculation of the return value.
2015-01-16 09:17:37 -08:00
bors ee2bfae011 auto merge of #20972 : FlaPer87/rust/oibit-send-and-friends, r=nikomatsakis
This PR adds rules for negative implementations. It follows pretty much what the [RFC](https://github.com/rust-lang/rfcs/blob/master/text/0019-opt-in-builtin-traits.md) says with 1 main difference:

Instead of positive implementations override negative implementations, this have been implemented in a way that a negative implementation of `Trait` for `T` will overlap with a positive implementation, causing a coherence error.

@nikomatsakis r?

cc #13231

[breaking-change]
2015-01-16 13:10:59 +00:00
Flavio Percoco c6ab9a6370 Don't use NoSend/NoSync in libstd 2015-01-16 08:18:56 +01:00