about summary refs log tree commit diff
path: root/src/libstd
AgeCommit message (Collapse)AuthorLines
2016-03-13Add is_documentation for IPv6Abhishek Chanda-19/+29
This function returns true if the given IPv6 is reserved for documentation. Also, reject this block in the is_global check
2016-03-13Auto merge of #32211 - achanda:ipv6-global, r=alexcrichtonbors-1/+3
Reject unspecified IP from global Also fixed the test
2016-03-13Auto merge of #32184 - ollie27:win_stdout, r=alexcrichtonbors-23/+21
Fixup stout/stderr on Windows WriteConsoleW can fail if called with a large buffer so we need to slice any stdout/stderr output. However the current slicing has a few problems: 1. It slices by byte but still expects valid UTF-8. 2. The slicing happens even when not outputting to a console. 3. panic! output is not sliced. This fixes these issues by moving the slice to right before WriteConsoleW and slicing on a char boundary.
2016-03-12Reject unspecified and loopback IP from globalAbhishek Chanda-1/+3
2016-03-12std: Clean out deprecated APIsAlex Crichton-1488/+180
Removes all unstable and deprecated APIs prior to the 1.8 release. All APIs that are deprecated in the 1.8 release are sticking around for the rest of this cycle. Some notable changes are: * The `dynamic_lib` module was moved into `rustc_back` as the compiler still relies on a few bits and pieces. * The `DebugTuple` formatter now special-cases an empty struct name with only one field to append a trailing comma.
2016-03-11std: Remove unstable from ReentrantMutexAlex Crichton-3/+0
This isn't exported so it doesn't need a tag.
2016-03-12Further simplify Windows stdout/stderrOliver Middleton-13/+8
This makes it output as much valid UTF-8 as it can then return failure.
2016-03-11Auto merge of #32200 - Manishearth:rollup, r=Manishearthbors-3/+3
Rollup of 11 pull requests - Successful merges: #32137, #32158, #32171, #32174, #32178, #32179, #32180, #32181, #32183, #32186, #32197 - Failed merges:
2016-03-11Auto merge of #32132 - arcnmx:cargobuild-std-target, r=alexcrichtonbors-5/+5
cover more linux targets in libstd cargobuild libstd/build.rs checked the target name against `"unknown-linux"`... That doesn't necessarily apply to all Linux targets as some toolchains for embedded targets will change that `unknown` field to some vendor name. Some shifting around was needed since Android is also a Linux target. r? @alexcrichton
2016-03-12Rollup merge of #32174 - cmbrandenburg:spell_fix, r=steveklabnikManish Goregaokar-3/+3
Spell fixes for std::ffi doc comments
2016-03-11Auto merge of #32133 - alexcrichton:linkchecker, r=brsonbors-17/+17
Add a link validator to rustbuild This commit was originally targeted at just adding a link checking script to the rustbuild system. This ended up snowballing a bit to extend rustbuild to be amenable to various tools we have as part of the build system in general. There's a new `src/tools` directory which has a number of scripts/programs that are purely intended to be used as part of the build system and CI of this repository. This is currently inhabited by rustbook, the error index generator, and a new linkchecker script added as part of this PR. I suspect that more tools like compiletest, tidy scripts, snapshot scripts, etc will migrate their way into this directory over time. The commit which adds the error index generator shows the steps necessary to add new tools to the build system, namely: 1. New steps are defined for building the tool and running the tool 2. The dependencies are configured 3. The steps are implemented In terms of the link checker, these commits do a few things: * A new `src/tools/linkchecker` script is added. This will read an entire documentation tree looking for broken relative links (HTTP links aren't followed yet). * A large number of broken links throughout the documentation were fixed. Many of these were just broken when viewed from core as opposed to std, but were easily fixed. * A few rustdoc bugs here and there were fixed
2016-03-10Auto merge of #32102 - alexcrichton:assert-safe-closures, r=aturonbors-1/+36
std: Add impl of FnOnce to AssertRecoverSafe This was originally intended, but forgot to land by accident! cc #27719
2016-03-10Simplify Windows stdout/stderrOliver Middleton-4/+2
2016-03-10Fixup stout/stderr on WindowsOliver Middleton-21/+26
WriteConsoleW can fail if called with a large buffer so we need to slice any stdout/stderr output. However the current slicing has a few problems: 1. It slices by byte but still expects valid UTF-8. 2. The slicing happens even when not outputting to a console. 3. panic! output is not sliced. This fixes these issues by moving the slice to right before WriteConsoleW and slicing on a char boundary.
2016-03-10Auto merge of #32107 - Stebalien:partial-write, r=alexcrichtonbors-2/+32
Never return an error after a partial write If LineWriter fails to flush, return the number of bytes written instead of an error. Fixes #32085
2016-03-10Spell fixes for std::ffi doc commentsCraig M. Brandenburg-3/+3
2016-03-09Auto merge of #31618 - alexcrichton:no-thread-spawns, r=brsonbors-52/+608
Optimize some functions in std::process * Be sure that `read_to_end` gets directed towards `read_to_end_uninitialized` for all handles * When spawning a child that guaranteed doesn't need a stdin, don't actually create a stdin pipe for that process, instead just redirect it to /dev/null * When calling `wait_with_output`, don't spawn threads to read out the pipes of the child. Instead drain all pipes on the calling thread and *then* wait on the process. Functionally, it is intended that nothing changes as part of this PR --- Note that this was the same as #31613, and even after that it turned out that fixing Windows was easier than I thought! To copy a comment from over there: > As some rationale for this as well, it's always bothered me that we've spawned threads in the standard library for this (seems a bit overkill), and I've also been curious lately as to our why our build times for Windows are so much higher than Unix (on the buildbots we have). I have done basically 0 investigation into why, but I figured it can't help to try to optimize Command::output which I believe is called quite a few times during the test suite.
2016-03-09std: Don't spawn threads in `wait_with_output`Alex Crichton-33/+458
Semantically there's actually no reason for us to spawn threads as part of the call to `wait_with_output`, and that's generally an incredibly heavyweight operation for just reading a few bytes (especially when stderr probably rarely has bytes!). An equivalent operation in terms of what's implemented today would be to just drain both pipes of all contents and then call `wait` on the child process itself. On Unix we can implement this through some convenient use of the `select` function, whereas on Windows we can make use of overlapped I/O. Note that on Windows this requires us to use named pipes instead of anonymous pipes, but they're semantically the same under the hood.
2016-03-08Auto merge of #31981 - achanda:unspecified-ip, r=alexcrichtonbors-17/+20
Exclude 0.0.0.0 from the list of globally routable addresses
2016-03-08std: Don't always create stdin for childrenAlex Crichton-10/+16
For example if `Command::output` or `Command::status` is used then stdin is just immediately closed. Add an option for this so as an optimization we can avoid creating pipes entirely. This should help reduce the number of active file descriptors when spawning processes on Unix and the number of active handles on Windows.
2016-03-08std: Funnel read_to_end through to one locationAlex Crichton-11/+136
This pushes the implementation detail of proxying `read_to_end` through to `read_to_end_uninitialized` all the way down to the `FileDesc` and `Handle` implementations on Unix/Windows. This way intermediate layers will also be able to take advantage of this optimized implementation. This commit also adds the optimized implementation for `ChildStdout` and `ChildStderr`.
2016-03-08doc: Fix a bunch of broken linksAlex Crichton-17/+17
A few categories: * Links into compiler docs were just all removed as we're not generating compiler docs. * Move up one more level to forcibly go to std docs to fix inlined documentation across the facade crates.
2016-03-08cover more linux targets in libstd cargobuildarcnmx-5/+5
2016-03-08Auto merge of #32009 - alexcrichton:trim-fulldeps, r=brsonbors-13/+0
mk: Distribute fewer TARGET_CRATES Right now everything in TARGET_CRATES is built by default for all non-fulldeps tests and is distributed by default for all target standard library packages. Currenly this includes a number of unstable crates which are rarely used such as `graphviz` and `rbml`> This commit trims down the set of `TARGET_CRATES`, moves a number of tests to `*-fulldeps` as a result, and trims down the dependencies of libtest so we can distribute fewer crates in the `rust-std` packages.
2016-03-08Auto merge of #31986 - ashleysommer:emscripten_fixes, r=alexcrichtonbors-8/+232
Fix building libstd on emscripten targets. The main cause of the problem is that libstd/os/mod.rs treats emscripten targets as an alias of linux targets, whereas liblibc treats emscripten targets as musl-compliant, so it gets a slightly different struct stat64 defined. This commit adds conditional compilation checks to use the correct timestamp format on fs metadata functions in the case of compiling to emscripten targets. This commit also depends needs https://github.com/ashleysommer/rust/commit/f1575cff2d631e977038fdba3fa3422ba5f8f2fe applied in order to successfully build libstd with emscripten target.
2016-03-07Add test case for #32085Steven Allen-0/+28
2016-03-07Never return an error after a partial writeSteven Allen-2/+4
If LineWriter fails to flush, return the number of bytes written instead of an error. Fixes #32085
2016-03-07mk: Distribute fewer TARGET_CRATESAlex Crichton-13/+0
Right now everything in TARGET_CRATES is built by default for all non-fulldeps tests and is distributed by default for all target standard library packages. Currenly this includes a number of unstable crates which are rarely used such as `graphviz` and `rbml`> This commit trims down the set of `TARGET_CRATES`, moves a number of tests to `*-fulldeps` as a result, and trims down the dependencies of libtest so we can distribute fewer crates in the `rust-std` packages.
2016-03-07std: Add impl of FnOnce to AssertRecoverSafeAlex Crichton-1/+36
This was originally intended, but forgot to land by accident! cc #27719
2016-03-07Auto merge of #32081 - cmbrandenburg:spell_fix, r=apasel422bors-1/+1
2016-03-07Auto merge of #32078 - japaric:rustbuild-i686-musl, r=alexcrichtonbors-3/+9
- make sure we copy the third party objects (crt*.o) to the target stage directory. - apply the x86_64-musl logic also to the i686-musl target. --- r? @alexcrichton
2016-03-07Fix building libstd on on emscripten targets.ashleysommer-8/+232
Squashed 10 commits: 1) The main cause of the problem is that libstd/os/mod.rs treats emscripten targets as an alias of linux targets, whereas liblibc treats emscripten targets as musl-compliant, so it gets a slightly different struct stat64 defined. This commit adds conditional compilation checks to use the correct timestamp format on fs metadata functions in the case of compiling to emscripten targets. 2) Update previous commit to comply with rust formatting standards. Removed tab characters, remove trailing whitespaces. 3) Move emscripten changes into their own file under libstd/os/emscripten Put libstd/os/linux/fs back to the way it was. 4) Cannot use stat.st_ctim on emscripten to get created time. 5) Remove compile-time conditionals for target_env = musl, it looks like musl builds compile fine already. 6) Undone some formatting changes that are no longer needed, Removed some more target_env="musl" compilation checks that I missed from my previous commit. 7) upgrade to liblibc e19309c, it fixes the differences in the musl stat and stat64 definitions. 8) Undo the compile-time checks to check for emscripten (or musl targets) in the FileAttr struct. No longer needed after updating liblibc to e19309c. 9) Change the MetadataExt implementation of emscripten fs.rs module to match the changes in new liblibc. 10) remove a stray return statement, should have been removed in the previous commit.
2016-03-07Auto merge of #32051 - steveklabnik:gh9447, r=blussbors-6/+6
Fixes #9447
2016-03-06Spelling fix for "because"Craig M. Brandenburg-1/+1
2016-03-06rustbuild: fix cross compilation of libstd to i686-unknown-linux-muslJorge Aparicio-3/+9
- make sure we copy the third party objects (crt*.o) to the target stage directory. - apply the x86_64-musl logic also to the i686-musl target.
2016-03-06Auto merge of #32020 - alexcrichton:stabilize-into-ascii, r=brsonbors-8/+4
These were intended to land in stable 1.8 but were just waiting for the implementation PR, so now they're landing. Specifically this PR stabilizes: * `AsciiExt::into_ascii_uppercase` * `AsciiExt::into_ascii_lowercase` * `AsciiExt for Vec<u8>` * `AsciiExt for String`
2016-03-06Auto merge of #30884 - durka:inclusive-ranges, r=aturonbors-1/+1
This PR implements [RFC 1192](https://github.com/rust-lang/rfcs/blob/master/text/1192-inclusive-ranges.md), which is triple-dot syntax for inclusive range expressions. The new stuff is behind two feature gates (one for the syntax and one for the std::ops types). This replaces the deprecated functionality in std::iter. Along the way I simplified the desugaring for all ranges. This is my first contribution to rust which changes more than one character outside of a test or comment, so please review carefully! Some of the individual commit messages have more of my notes. Also thanks for putting up with my dumb questions in #rust-internals. - For implementing `std::ops::RangeInclusive`, I took @Stebalien's suggestion from https://github.com/rust-lang/rfcs/pull/1192#issuecomment-137864421. It seemed to me to make the implementation easier and increase type safety. If that stands, the RFC should be amended to avoid confusion. - I also kind of like @glaebhoerl's [idea](https://github.com/rust-lang/rfcs/pull/1254#issuecomment-147815299), which is unified inclusive/exclusive range syntax something like `x>..=y`. We can experiment with this while everything is behind a feature gate. - There are a couple of FIXMEs left (see the last commit). I didn't know what to do about `RangeArgument` and I haven't added `Index` impls yet. Those should be discussed/finished before merging. cc @Gankro since you [complained](https://www.reddit.com/r/rust/comments/3xkfro/what_happened_to_inclusive_ranges/cy5j0yq) cc #27777 #30877 rust-lang/rust#1192 rust-lang/rfcs#1254 relevant to #28237 (tracking issue)
2016-03-04End stdlib module summaries with a full stop.Steve Klabnik-6/+6
Fixes #9447
2016-03-04Rollup merge of #32027 - japaric:rustbuild-mips, r=alexcrichtonSteve Klabnik-1/+1
These targets don't link statically to libunwind or libc --- r? @alexcrichton
2016-03-04Formatting changes to make tidy passAbhishek Chanda-3/+3
2016-03-04Reject the reserved block as not globalAbhishek Chanda-1/+4
2016-03-04Exclude 0.0.0.0 from the list of globally routable addressesAbhishek Chanda-17/+17
2016-03-04Auto merge of #31945 - sfackler:net2, r=alexcrichtonbors-4/+733
I have these tagged as stable in 1.9, so this shouldn't merge until the 1.8 beta's cut.
2016-03-03[rustbuild] fix cross compilation of std for mips(el)-linux-muslJorge Aparicio-1/+1
These targets don't link statically to libunwind or libc
2016-03-03Fix netbsdSteven Fackler-4/+4
2016-03-03std: Stabilize `into_*` ASCII methodsAlex Crichton-8/+4
These were intended to land in stable 1.8 but were just waiting for the implementation PR, so now they're landing. Specifically this PR stabilizes: * `AsciiExt::into_ascii_uppercase` * `AsciiExt::into_ascii_lowercase` * `AsciiExt for Vec<u8>` * `AsciiExt for String`
2016-03-03Fix android buildSteven Fackler-3/+3
2016-03-02Fix comments and OSX buildSteven Fackler-5/+30
2016-03-02Rollup merge of #31985 - ashleysommer:libbackgrace_emscripten_fix, ↵Manish Goregaokar-1/+1
r=alexcrichton Was getting error: ``` running: "sh" "/home/flubba86/rust/src/libstd/../libbacktrace/configure" "--with-pic" "--disable-multilib" "--disable-shared" "--disable-host-shared" "--host=asmjs-unknown-emscripten" "--build=x86_64-unknown-linux-gnu" ... Invalid configuration `asmjs-unknown-emscripten': system `emscripten' not recognized ``` This commit adds the emscripten target to the libbacktrace configure script so it is no longer unrecognized.
2016-03-02Rollup merge of #31982 - apasel422:sync, r=alexcrichtonManish Goregaokar-0/+6
These types were already `!Sync`, but this improves error messages when they are used in contexts that require `Sync`, aligning them with conventions used with `Rc`, among others. r? @alexcrichton