Steve Klabnik
1dce223d50
Rollup merge of #30465 - androm3da:master, r=alexcrichton
...
The `dynamic_lib` library has been deprecated in favor of contents on crates.io, but apparently `libloading` is a more specific direction that fits the need.
2015-12-23 18:09:11 -05:00
bors
42c3ef8f9f
Auto merge of #30417 - alexcrichton:better-detect-elf-tls, r=alexcrichton
...
Currently a compiler can be built with the `--disable-elf-tls` option for compatibility with OSX 10.6 which doesn't have ELF TLS. This is unfortunate, however, as a whole new compiler must be generated which can take some time. These commits add a new (feature gated) `cfg(target_thread_local)` annotation set by the compiler which indicates whether `#[thread_local]` is available for use. The compiler now interprets `MACOSX_DEPLOYMENT_TARGET` (a standard environment variable) to set this flag on OSX. With this we may want to start compiling our OSX nightlies with `MACOSX_DEPLOYMENT_TARGET` set to 10.6 which would allow the compiler out-of-the-box to generate 10.6-compatible binaries.
For now the compiler still by default targets OSX 10.7 by allowing ELF TLS by default (e.g. if `MACOSX_DEPLOYMENT_TARGET` isn't set).
2015-12-22 09:15:29 +00:00
Alex Crichton
2f42ac438e
std: Remove rust_builtin C support library
...
All these definitions can now be written in Rust, so do so!
2015-12-21 22:12:48 -08:00
Alex Crichton
cd74364e5d
std: Use cfg(target_thread_local) in thread_local!
...
This transitions the standard library's `thread_local!` macro to use the
freshly-added and gated `#[cfg(target_thread_local)]` attribute. This greatly
simplifies the `#[cfg]` logic in play here, but requires that the standard
library expose both the OS and ELF TLS implementation modules as unstable
implementation details.
The implementation details were shuffled around a bit but end up generally
compiling to the same thing.
Closes #26581 (this supersedes the need for the option)
Closes #27057 (this also starts ignoring the option)
2015-12-21 22:05:37 -08:00
bors
2343a92a90
Auto merge of #30352 - alexcrichton:new-snashots, r=nikomatsakis
...
Lots of cruft to remove!
2015-12-21 21:37:26 +00:00
Alex Crichton
cd1848a1a6
Register new snapshots
...
Lots of cruft to remove!
2015-12-21 09:26:21 -08:00
Sébastien Marie
f9a8861922
unbreak openbsd code
...
- upgrades libc to version with si_addr support in openbsd
- declares libc use for getentropy
2015-12-21 13:36:23 +01:00
ebadf
a8df425dd5
Corrected deprecation reference to appropriate crate
2015-12-20 14:37:53 -06:00
bors
d3aec9fd20
Auto merge of #30454 - mmcco:size_t, r=alexcrichton
...
It returns sizeof(dirent_t), so I'm not sure why its return type is int.
It's only used once, and that usage immediately casts it to usize.
2015-12-20 07:19:07 +00:00
bors
abf60b20aa
Auto merge of #30430 - mmcco:master, r=alexcrichton
...
Rust already supports Linux's getrandom(2), which is very similar and
was based on getentropy(2). This is a pretty clean, simple addition that
uses the same approach as the iOS randomness API support.
2015-12-19 23:21:12 +00:00
bors
67a2d1f34f
Auto merge of #30403 - webmobster:master, r=alexcrichton
...
I didn't see any reason that debug couldn't be added to this object, since every field derives debug.
2015-12-19 06:21:10 +00:00
Michael McConville
9fde3e9b94
Use libc's syscall() and NR_GETENTROPY const
2015-12-18 22:40:07 -05:00
Michael McConville
e8d2706cba
Merge branch 'master' of https://github.com/rust-lang/rust
2015-12-18 22:37:00 -05:00
bors
8ad12c3e25
Auto merge of #30381 - fhahn:memchr-in-std, r=alexcrichton
...
This PR adds `memchr`and `memrchr` based on @BurntSushi 's rust-memchr crate to libstd (as discussed in #30151 ).
I've update some places in libstd to use memchr/memrchr, but I am not sure if there are other places where it could be used as well.
ref #30076
2015-12-19 00:57:25 +00:00
Michael McConville
33113f86f4
Fix build by removing needless type prefix
2015-12-18 19:26:11 -05:00
Michael McConville
5b282981d3
Simplify logic checking getentropy's return value
2015-12-18 19:26:11 -05:00
Michael McConville
3ee3a784bf
Use a const for getentropy(2)'s syscall number
...
Reported by Sebastien Marie.
2015-12-18 19:26:10 -05:00
Michael McConville
a51b70b816
Use the correct syscall name in panic message
...
I copied it from the getrandom code but forgot to change the name.
Reported by Sebastien Marie.
2015-12-18 19:26:10 -05:00
Michael McConville
f4d409d6ed
Use the getentropy(2) syscall on OpenBSD
...
Rust already supports Linux's getrandom(2), which is very similar and
was based on getentropy(2). This is a pretty clean, simple addition that
uses the same approach as the iOS randomness API support.
2015-12-18 19:26:09 -05:00
Florian Hahn
a206e556d0
Use memrchr bindings provided by libc
2015-12-18 21:49:20 +01:00
bors
ef91cdb140
Auto merge of #29973 - petrochenkov:privinpub, r=nikomatsakis
...
Some notes:
This patch enforces the rules from [RFC 136](https://github.com/rust-lang/rfcs/blob/master/text/0136-no-privates-in-public.md ) and makes "private in public" a module-level concept and not crate-level. Only `pub` annotations are used by the new algorithm, crate-level exported node set produced by `EmbargoVisitor` is not used. The error messages are tweaked accordingly and don't use the word "exported" to avoid confusing people (https://github.com/rust-lang/rust/issues/29668 ).
The old algorithm tried to be extra smart with impls, but it mostly led to unpredictable behavior and bugs like https://github.com/rust-lang/rust/issues/28325 .
The new algorithm tries to be as simple as possible - an impl is considered public iff its type is public and its trait is public (if presents).
A type or trait is considered public if all its components are public, [complications](https://internals.rust-lang.org/t/limits-of-type-inference-smartness/2919 ) with private types leaking to other crates/modules through trait impls and type inference are deliberately ignored so far.
The new algorithm is not recursive and uses the nice new facility `Crate::visit_all_items`!
Obsolete pre-1.0 feature `visible_private_types` is removed.
This is a [breaking-change].
The two main vectors of breakage are type aliases (https://github.com/rust-lang/rust/issues/28450 ) and impls (https://github.com/rust-lang/rust/issues/28325 ).
I need some statistics from a crater run (cc @alexcrichton) to decide on the breakage mitigation strategy.
UPDATE: All the new errors are reported as warnings controlled by a lint `private_in_public` and lint group `future_incompatible`, but the intent is to make them hard errors eventually.
Closes https://github.com/rust-lang/rust/issues/28325
Closes https://github.com/rust-lang/rust/issues/28450
Closes https://github.com/rust-lang/rust/issues/29524
Closes https://github.com/rust-lang/rust/issues/29627
Closes https://github.com/rust-lang/rust/issues/29668
Closes https://github.com/rust-lang/rust/issues/30055
r? @nikomatsakis
2015-12-18 18:54:52 +00:00
ebadf
cb7017ce3a
Made dynamic_lib migration path more explicit
2015-12-18 10:21:13 -06:00
Manish Goregaokar
e9166766bd
Rollup merge of #30431 - mmcco:cleanup, r=alexcrichton
...
Remove a needless variable and simply a cfg().
2015-12-18 20:02:13 +05:30
Florian Hahn
de3e843d24
Use memchr in libstd where possible, closes #30076
2015-12-18 13:32:14 +01:00
Florian Hahn
ca52c56e34
Add memchr implemenation based on rust-memchr to libstd
2015-12-18 13:32:14 +01:00
Michael McConville
cf03ceed14
Add a type prefix to fix build
...
Apparently this file's use annotations have changed since I last pulled
on my test machine.
2015-12-17 21:24:14 -05:00
Michael McConville
5f59e1c8f9
Make runtime function return size_t
...
It returns sizeof(dirent_t), so I'm not sure why its return type is int.
It's only used once, and that usage immediately casts it to usize.
2015-12-17 21:04:54 -05:00
Vadim Petrochenkov
26a2f852be
Fix the fallout
2015-12-18 04:12:31 +03:00
bors
48700be9cb
Auto merge of #30445 - steveklabnik:rollup, r=steveklabnik
...
- Successful merges: #30370 , #30404 , #30415 , #30419 , #30428 , #30437 , #30439 , #30441 , #30442 , #30443
- Failed merges:
2015-12-17 20:08:48 +00:00
Steve Klabnik
b3bf43cdb5
Rollup merge of #30442 - tshepang:typo, r=steveklabnik
2015-12-17 14:47:14 -05:00
Steve Klabnik
e42f97dae3
Rollup merge of #30441 - tshepang:missing-comma, r=steveklabnik
2015-12-17 14:47:14 -05:00
Tshepang Lekhonkhobe
bd4aa64f31
doc: fix typo
2015-12-17 20:57:14 +02:00
Tshepang Lekhonkhobe
6fdde01368
doc: add a missing comma
2015-12-17 20:55:20 +02:00
Ed Clarke
21030f1fc9
Add a debug implementation to process::Output
2015-12-17 18:40:49 +00:00
Jeffrey Seyfried
8364a6feef
Remove unused imports
2015-12-17 05:43:27 +00:00
Michael McConville
ccb218616b
Trivial cleanup
...
Remove a needless variable and simply a cfg().
2015-12-17 00:36:31 -05:00
Steve Klabnik
4e2ec9a178
small fix to str doc example
2015-12-16 22:12:47 -05:00
bors
110df043bf
Auto merge of #30351 - tamird:remove-range-inclusive, r=alexcrichton
...
r? @alexcrichton
2015-12-13 23:40:12 +00:00
bors
69adc883aa
Auto merge of #30343 - Seeker14491:patch-1, r=bluss
...
The `MIN` link was broken. Reverts #29624 .
2015-12-13 17:11:36 +00:00
Tamir Duberstein
b964b1d043
remove deprecated APIs missed in #30182
2015-12-13 01:02:12 -05:00
bors
f0ed9f9169
Auto merge of #30312 - seanmonstar:ioerror-description, r=alexcrichton
...
cc @pnkfelix @alexcrichton
2015-12-12 12:47:03 +00:00
Brian Bowman
73615f7f8a
Fix MIN, MAX links
...
The `MIN` link was broken. Reverts #29624 .
2015-12-11 15:00:54 -06:00
Sean McArthur
025f97a1de
std: improve io error descriptions
2015-12-10 14:25:11 -08:00
bors
47cd3a4ae7
Auto merge of #30182 - alexcrichton:remove-deprecated, r=aturon
...
This is a standard "clean out libstd" commit which removes all 1.5-and-before
deprecated functionality as it's now all been deprecated for at least one entire
cycle.
2015-12-10 19:54:15 +00:00
Alex Crichton
da50f7c288
std: Remove deprecated functionality from 1.5
...
This is a standard "clean out libstd" commit which removes all 1.5-and-before
deprecated functionality as it's now all been deprecated for at least one entire
cycle.
2015-12-10 11:47:55 -08:00
bors
ce132752c6
Auto merge of #30267 - alexcrichton:tls-init-oh-my, r=nikomatsakis
...
Due to #30228 it's not currently sound to do `*ptr = Some(value)`, so instead
use `mem::replace` which fixes the soundness hole for now.
2015-12-10 18:11:32 +00:00
Steve Klabnik
77882c9cba
Fix extra space in str docs
2015-12-09 15:52:04 -05:00
bors
08a5b112ed
Auto merge of #30270 - DiamondLovesYou:fix-30231, r=alexcrichton
...
Closes #30231
2015-12-09 18:42:15 +00:00
bors
6bf8cc5789
Auto merge of #29937 - alexcrichton:panic-recover, r=alexcrichton
...
This commit is an implementation of [RFC 1236] and [RFC 1323] which
rename the `thread::catch_panic` function to `panic::recover` while also
replacing the `Send + 'static` bounds with a new `PanicSafe` bound.
[RFC 1236]: https://github.com/rust-lang/rfcs/pull/1236
[RFC 1323]: https://github.com/rust-lang/rfcs/pull/1323
cc #27719
2015-12-09 16:57:46 +00:00
Alex Crichton
0a13f1abaf
std: Rename thread::catch_panic to panic::recover
...
This commit is an implementation of [RFC 1236] and [RFC 1323] which
rename the `thread::catch_panic` function to `panic::recover` while also
replacing the `Send + 'static` bounds with a new `PanicSafe` bound.
[RFC 1236]: https://github.com/rust-lang/rfcs/pull/1236
[RFC 1323]: https://github.com/rust-lang/rfcs/pull/1323
cc #27719
2015-12-09 07:19:17 -08:00