Commit Graph

8581 Commits

Author SHA1 Message Date
bors
a06bb977d8 Auto merge of #30458 - fhahn:fix-warnings-tests-stdlib, r=sanxiyn
This PR siliences some warnings when compiling stdlib with --test. Mostly remove some unused imports and added a few `#[allow(..)]`.

I also marked some signal handling functions with `#[cfg(not(test))]`, because they are only called through `rt::lang_start`, which is also marked as  `#[cfg(not(test))]`
2015-12-30 07:35:10 +00:00
Florian Hahn
e27cbeff37 Fix warnings when compiling stdlib with --test 2015-12-29 16:07:01 +01:00
bors
9007d63f24 Auto merge of #30548 - mmcco:linux-syscall, r=brson
There's no need for us to redeclare it in an extern block.

We should probably put the syscall number constants in libc too.
2015-12-28 20:11:34 +00:00
bors
89753077fc Auto merge of #30570 - fhartwig:dead-doc-links, r=steveklabnik
r? @steveklabnik
2015-12-28 09:55:45 +00:00
Florian Hartwig
0fcf4710e9 Fix links in docs for std::io 2015-12-26 00:11:20 +01:00
Florian Hartwig
0cf5083b24 Fix link that is currently broken due to bad markup 2015-12-26 00:01:10 +01:00
Manish Goregaokar
91440adbed Rollup merge of #30513 - alexcrichton:assert-is-safe, r=aturon
Types like `&AssertRecoverSafe<T>` and `Rc<AssertRecoverSafe<T>>` were
mistakenly not considered recover safe, but the point of the assertion wrapper
is that it indeed is! This was caused by an interaction between the
`RecoverSafe` and `NoUnsafeCell` marker traits, and this is updated by adding an
impl of the `NoUnsafeCell` marker trait for `AssertRecoverSafe` to ensure that
it never interacts with the other negative impls of `RecoverSafe`.

cc #30510
2015-12-25 18:39:54 +05:30
Manish Goregaokar
12f171b052 Rollup merge of #30485 - sfackler:panic-handler, r=alexcrichton
r? @alexcrichton
2015-12-25 16:54:30 +05:30
Michael McConville
b0a9b3d458 Use libc's Linux syscall()
There's no need for us to redeclare it in an extern block.
2015-12-23 22:46:45 -05:00
Steve Klabnik
1b68a357fd Rollup merge of #30537 - tshepang:make-visible, r=Gankro 2015-12-23 18:09:12 -05:00
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
Steven Fackler
f1148a540a Implement custom panic handlers 2015-12-23 11:19:20 -07:00
Tshepang Lekhonkhobe
97547e2868 doc: make line visible 2015-12-23 17:47:12 +02: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
Alex Crichton
cb3826d9ad std: Ensure AssertRecoverSafe indeed is more often
Types like `&AssertRecoverSafe<T>` and `Rc<AssertRecoverSafe<T>>` were
mistakenly not considered recover safe, but the point of the assertion wrapper
is that it indeed is! This was caused by an interaction between the
`RecoverSafe` and `NoUnsafeCell` marker traits, and this is updated by adding an
impl of the `NoUnsafeCell` marker trait for `AssertRecoverSafe` to ensure that
it never interacts with the other negative impls of `RecoverSafe`.

cc #30510
2015-12-21 14:00:17 -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