about summary refs log tree commit diff
path: root/src/libstd
AgeCommit message (Collapse)AuthorLines
2018-01-11s/OsStr/&OsStr in docs to align with &str/String comparisonmuvlon-2/+3
2018-01-11Fix dead links in docs for OsStrmuvlon-0/+2
2018-01-11Fix confusing documentation for OsStrmuvlon-1/+1
2018-01-11Make the documentation build work on CloudABI.Ed Schouten-5/+7
Just like with wasm, we can't just import unix::ext and windows::ext. Our shims are not complete enough for that.
2018-01-11Make tests build on CloudABI.Ed Schouten-6/+13
There are some tests that need to be disabled on CloudABI specifically, due to the fact that the shims cannot be built in combination with unix::ext or windows::ext. Also improve the scoping of some imports to suppress compiler warnings.
2018-01-11Add shims for modules that we can't implement on CloudABI.Ed Schouten-9/+980
As discussed in #47268, libstd isn't ready to have certain functionality disabled yet. Follow wasm's approach of adding no-op modules for all of the features that we can't implement. I've placed all of those shims in a shims/ subdirectory, so we (the CloudABI folks) can experiment with removing them more easily. It also ensures that the code that does work doesn't get polluted with lots of useless boilerplate code.
2018-01-11Implement libstd for CloudABI.Ed Schouten-0/+1165
Though CloudABI is strongly inspired by POSIX, its absence of features that don't work well with capability-based sandboxing makes it different enough that adding bits to sys/unix will make things a mess. This change therefore adds CloudABI specific platform code under sys/cloudabi and borrows parts from sys/unix that can be used without changes. One of the goals of this implementation is to build as much as possible directly on top of CloudABI's system call layer, as opposed to using the C library. This is preferred, as the system call layer is supposed to be stable, whereas the C library ABI technically is not. An advantage of this approach is that it allows us to implement certain interfaces, such as mutexes and condition variables more optimally. They can be lighter than the ones provided by pthreads. This change disables some modules that cannot realistically be implemented right now. For example, libstd's pathname abstraction is not designed with POSIX *at() (e.g., openat()) in mind. The *at() functions are the only set of file system APIs available on CloudABI. There is no global file system namespace, nor a process working directory. Discussions on how to port these modules over are outside the scope of this change. Apart from this change, there are still some other minor fixups that need to be made to platform independent code to make things build. These will be sent out separately, so they can be reviewed more thoroughly.
2018-01-11Import the CloudABI system call bindings into the libstd tree.Ed Schouten-0/+2898
These automatically generated Rust source files allow us to invoke system calls within CloudABI processes. These will be used by libstd to implement primitives for I/O, threading, etc. These source files are normally part of the 'cloudabi' crate. In the case of libstd, we'd better copy them into the source tree, as having external dependencies in libstd is a bit messy. Original source files can be found here: https://github.com/NuxiNL/cloudabi/tree/master/rust
2018-01-10Fix typo.Alexis Hunt-1/+1
2018-01-10Pre-allocate in fs::read and fs::read_stringMatt Brubeck-2/+10
2018-01-10Auto merge of #46830 - Diggsey:cursor-vec-mut, r=alexcrichtonbors-32/+58
Implement `Write` for `Cursor<&mut Vec<T>>` Fixes #30132 r? @dtolnay (I'm just going through `feature-accepted` issues I swear 😛)
2018-01-10fix typo rwlock.rsBulat Musin-1/+1
Hi. Fixed typo: contained -> content
2018-01-09Rollup merge of #47285 - AndrewBrinker:master, r=kennytmCorey Farwell-1/+1
Fixed a typo in the compile_error docs Noticed a typo and fixed it.
2018-01-10We have Rust 1.25 nowest31-1/+1
2018-01-10Stabilize the panic_col featureest31-2/+1
I've added the panic_col feature in PR #42938. Now it's time to stabilize it! Closes #42939.
2018-01-09Fixes whitespace.Nathaniel Ringo-9/+9
2018-01-09Fixes Duration constructor const fns other than new, reverts new to non-const.Nathaniel Ringo-10/+13
2018-01-09Makes the constructors of Duration const fns.Nathaniel Ringo-5/+5
2018-01-09Make core::ops::Place an unsafe traitTaylor Cramer-1/+1
2018-01-09remove implementation detail from docTrevor Spiteri-4/+4
2018-01-08Fixed a typo in the compile_error docsAndrew Brinker-1/+1
2018-01-09Rollup merge of #47272 - GuillaumeGomez:missing-links, r=QuietMisdreavuskennytm-7/+14
Add missing links r? @QuietMisdreavus (please wait for CI, I have a few doubts about the `Write` trait links...)
2018-01-09Rollup merge of #47259 - sfackler:map-remove-entry, r=dtolnaykennytm-1/+49
Add HashMap::remove_entry Implements #46344 r? @dtolnay
2018-01-09Rollup merge of #47254 - rkruppe:no-more-align-hack, r=alexcrichtonkennytm-12/+3
Replace empty array hack with repr(align) As a side effect, this fixes the warning about repr(C, simd) that has been reported during x86_64 windows builds since #47111 (see also: #47103) r? @alexcrichton
2018-01-08doc: show that `f32::log` and `f64::log` are not correctly roundedTrevor Spiteri-20/+18
2018-01-08Add missing linksGuillaume Gomez-7/+14
2018-01-07Add HashMap::remove_entrySteven Fackler-1/+49
Implements #46344
2018-01-07Replace empty array hack with repr(align)Robin Kruppe-12/+3
As a side effect, this fixes the warning about repr(C, simd) that has been reported during x86_64 windows builds since #47111 (see also: #47103)
2018-01-07Make wasm obey backtrace feature, like other targetsAidan Hobson Sayers-0/+1
2018-01-06type error method suggestions use whitelisted identity-like conversionsZack M. Davis-1/+2
Previously, on a type mismatch (and if this wasn't preëmpted by a higher-priority suggestion), we would look for argumentless methods returning the expected type, and list them in a `help` note. This had two major shortcomings. Firstly, a lot of the suggestions didn't really make sense (if you used a &str where a String was expected, `.to_ascii_uppercase()` is probably not the solution you were hoping for). Secondly, we weren't generating suggestions from the most useful traits! We address the first problem with an internal `#[rustc_conversion_suggestion]` attribute meant to mark methods that keep the "same value" in the relevant sense, just converting the type. We address the second problem by making `FnCtxt.probe_for_return_type` pass the `ProbeScope::AllTraits` to `probe_op`: this would seem to be safe because grep reveals no other callers of `probe_for_return_type`. Also, structured suggestions are preferred (because they're pretty, but also for RLS and friends). Also also, we make the E0055 autoderef recursion limit error use the one-time-diagnostics set, because we can potentially hit the limit a lot during probing. (Without this, test/ui/did_you_mean/recursion_limit_deref.rs would report "aborting due to 51 errors"). Unfortunately, the trait probing is still not all one would hope for: at a minimum, we don't know how to rule out `into()` in cases where it wouldn't actually work, and we don't know how to rule in `.to_owned()` where it would. Issues #46459 and #46460 have been filed and are ref'd in a FIXME. This is hoped to resolve #42929, #44672, and #45777.
2018-01-07Rollup merge of #47217 - stjepang:set-examples, r=frewsxcvkennytm-0/+33
Write examples for {BTree,Hash}Set::{get,replace,take}
2018-01-06Auto merge of #47141 - alexcrichton:bump-bootstrap, r=alexcrichtonbors-48/+3
Bump to 1.25.0 * Bump the release version to 1.25 * Bump the bootstrap compiler to the recent beta * Allow using unstable rustdoc features on beta - this fix has been applied to the beta branch but needed to go to the master branch as well.
2018-01-06Rollup merge of #47216 - SergioBenitez:doc-fix, r=Mark-SimulacrumGuillaume Gomez-1/+1
Clarify appending behavior of 'io::Read::read_to_string()'. A simple doc clarification.
2018-01-06Rollup merge of #47165 - mbrubeck:args, r=alexcrichtonGuillaume Gomez-23/+16
[unix] Don't clone command-line args on startup Fixes part of #47164 and simplifies the `args` code on non-Apple Unix platforms. Note: This could change behavior for programs that use both `std::env::args` *and* unsafe code that mutates `argv` directly. However, these programs already behave differently on different platforms. The new behavior on non-Apple platforms is closer to the existing behavior on Apple platforms.
2018-01-06Rollup merge of #46987 - frewsxcv:frewsxcv-current-exe, r=QuietMisdreavusGuillaume Gomez-8/+11
Minor rewrite of env::current_exe docs; clarify symlinks. - Update example in ‘security’ section to use hard links, like the linked securityvulns.com example. - Weaken language on symbolic links – indicate behavior is platform-specific Fixes https://github.com/rust-lang/rust/issues/43617.
2018-01-05Write examples for {BTree,Hash}Set::{get,replace,take}Stjepan Glavina-0/+33
2018-01-05Clarify appending behavior of 'io::Read::read_to_string()'.Sergio Benitez-1/+1
2018-01-05Rollup merge of #47198 - dzamlo:patch-2, r=frewsxcvkennytm-2/+2
Fix an error in std::process documentation
2018-01-05Rollup merge of #47030 - ollie27:stab, r=alexcrichtonkennytm-14/+14
Correct a few stability attributes * The extra impls for `ManuallyDrop` were added in #44310 which was only stabilised in 1.22.0. * The impls for `SliceIndex` were stabilised in #43373 but as `RangeInclusive` and `RangeToInclusive` are still unstable the impls should remain unstable. * The `From` impls for atomic integers were added in #45610 but most atomic integers are still unstable. * The `shared_from_slice2` impls were added in #45990 but they won't be stable until 1.24.0. * The `Mutex` and `RwLock` impls were added in #46082 but won't be stable until 1.24.0.
2018-01-04[unix] Don't clone command-line args on startupMatt Brubeck-23/+16
2018-01-04Fix an error in std::process documentationLoïc Damien-2/+2
2018-01-04Bump to 1.25.0Alex Crichton-48/+3
* Bump the release version to 1.25 * Bump the bootstrap compiler to the recent beta * Allow using unstable rustdoc features on beta - this fix has been applied to the beta branch but needed to go to the master branch as well.
2018-01-02Document when LineWriter flushes; document errors for into_inner.Corey Farwell-0/+11
Fixes https://github.com/rust-lang/rust/issues/42468.
2018-01-02Auto merge of #47042 - redox-os:redox, r=estebankbors-7/+34
Redox - Implement rename using new system call This does the following: - Update syscall module to match upstream - Implement rename using new system call - Make readlink and symlink utilize O_CLOEXEC - Make readlink and symlink not leave dangling file handles on failure
2017-12-31Auto merge of #46713 - Manishearth:memchr, r=blussbors-232/+5
Use memchr to speed up [u8]::contains 3x None
2017-12-30Fix doc typo for is_ascii_graphicvarkor-1/+1
Fixes #47067.
2017-12-29Auto merge of #47026 - EdSchouten:cloudabi-unwind, r=kennytmbors-1/+8
Link against -lunwind on CloudABI. CloudABI makes use of LLVM's libunwind to do stack unwinding. It is installed under the name libunwind.a.
2017-12-29Add proper library dependencies for libstd on CloudABI.Ed Schouten-1/+8
Don't attempt to build libunwind on CloudABI, as libunwind is already provided by the system by default.
2017-12-28Remove an unused import for cfg(not(feature = "backtrace")).Ed Schouten-2/+0
The 'mem' module is not used for this specific code. This was copy-pasted in by accident when adding RFC 1937 (? in main) support.
2017-12-28Implement AsRef<Path> for ComponentDiggory Blake-0/+7