about summary refs log tree commit diff
path: root/src/libstd
AgeCommit message (Collapse)AuthorLines
2016-01-01Auto merge of #30648 - tshepang:missing-graves, r=steveklabnikbors-2/+2
2015-12-31Auto merge of #30645 - tshepang:grammar, r=steveklabnikbors-2/+2
2015-12-31Auto merge of #30616 - arcnmx:cstr-asref, r=aturonbors-2/+33
Are trait impls still insta-stable? Considering that this design has been around for a long time on `String` and `OsString` it probably doesn't matter much... The `From` impl is a bit strange to me. It's stolen from `OsString` but I'm not really sure about it... `String` just impls `From<&str>` instead, would that make more sense?
2015-12-31CStr impl stabilityarcnmx-4/+4
2015-12-31impl From<&CStr> for CStringarcnmx-7/+7
2015-12-31Auto merge of #30644 - tshepang:typo, r=steveklabnikbors-1/+1
2015-12-30doc: missed these in a4da9acTshepang Lekhonkhobe-2/+2
2015-12-30doc: fix grammarTshepang Lekhonkhobe-2/+2
2015-12-30doc: fix typoTshepang Lekhonkhobe-1/+1
2015-12-30Rollup merge of #30546 - tshepang:add-links, r=steveklabnikSteve Klabnik-15/+36
2015-12-30Rollup merge of #30511 - defyrlt:issue_30507, r=steveklabnikSteve Klabnik-10/+11
Resolves #30507 r? @steveklabnik
2015-12-30doc: add gravesTshepang Lekhonkhobe-23/+23
2015-12-30doc: add some links for io::stdioTshepang Lekhonkhobe-14/+35
2015-12-30Auto merge of #30458 - fhahn:fix-warnings-tests-stdlib, r=sanxiynbors-75/+81
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-29AsRef and related conversions for CStringarcnmx-2/+33
2015-12-29Fix warnings when compiling stdlib with --testFlorian Hahn-75/+81
2015-12-28Auto merge of #30548 - mmcco:linux-syscall, r=brsonbors-5/+1
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-28Auto merge of #30570 - fhartwig:dead-doc-links, r=steveklabnikbors-6/+5
r? @steveklabnik
2015-12-26Fix links in docs for std::ioFlorian Hartwig-4/+4
2015-12-26Fix link that is currently broken due to bad markupFlorian Hartwig-2/+1
2015-12-25Rollup merge of #30513 - alexcrichton:assert-is-safe, r=aturonManish Goregaokar-15/+19
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-25Rollup merge of #30485 - sfackler:panic-handler, r=alexcrichtonManish Goregaokar-8/+150
r? @alexcrichton
2015-12-23Use libc's Linux syscall()Michael McConville-5/+1
There's no need for us to redeclare it in an extern block.
2015-12-23Rollup merge of #30537 - tshepang:make-visible, r=GankroSteve Klabnik-1/+1
2015-12-23Rollup merge of #30465 - androm3da:master, r=alexcrichtonSteve Klabnik-1/+1
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-23Implement custom panic handlersSteven Fackler-8/+150
2015-12-23doc: make line visibleTshepang Lekhonkhobe-1/+1
2015-12-22Removed usage of `drop` from `std::net::UdpSocket` docsdefyrlt-10/+11
Resolves #30507
2015-12-22Auto merge of #30417 - alexcrichton:better-detect-elf-tls, r=alexcrichtonbors-77/+49
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-21std: Remove rust_builtin C support libraryAlex Crichton-77/+105
All these definitions can now be written in Rust, so do so!
2015-12-21std: Use cfg(target_thread_local) in thread_local!Alex Crichton-77/+49
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-21std: Ensure AssertRecoverSafe indeed is more oftenAlex Crichton-15/+19
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-21Auto merge of #30352 - alexcrichton:new-snashots, r=nikomatsakisbors-25/+2
Lots of cruft to remove!
2015-12-21Register new snapshotsAlex Crichton-25/+2
Lots of cruft to remove!
2015-12-21unbreak openbsd codeSébastien Marie-1/+1
- upgrades libc to version with si_addr support in openbsd - declares libc use for getentropy
2015-12-20Corrected deprecation reference to appropriate crateebadf-1/+1
2015-12-20Auto merge of #30454 - mmcco:size_t, r=alexcrichtonbors-2/+2
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-19Auto merge of #30430 - mmcco:master, r=alexcrichtonbors-1/+62
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-19Auto merge of #30403 - webmobster:master, r=alexcrichtonbors-0/+27
I didn't see any reason that debug couldn't be added to this object, since every field derives debug.
2015-12-18Use libc's syscall() and NR_GETENTROPY constMichael McConville-7/+1
2015-12-18Merge branch 'master' of https://github.com/rust-lang/rustMichael McConville-4/+396
2015-12-19Auto merge of #30381 - fhahn:memchr-in-std, r=alexcrichtonbors-4/+396
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-18Fix build by removing needless type prefixMichael McConville-1/+1
2015-12-18Simplify logic checking getentropy's return valueMichael McConville-5/+3
2015-12-18Use a const for getentropy(2)'s syscall numberMichael McConville-1/+5
Reported by Sebastien Marie.
2015-12-18Use the correct syscall name in panic messageMichael McConville-1/+1
I copied it from the getrandom code but forgot to change the name. Reported by Sebastien Marie.
2015-12-18Use the getentropy(2) syscall on OpenBSDMichael McConville-1/+66
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-18Use memrchr bindings provided by libcFlorian Hahn-29/+15
2015-12-18Auto merge of #29973 - petrochenkov:privinpub, r=nikomatsakisbors-1/+1
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-18Made dynamic_lib migration path more explicitebadf-1/+1