- 07 5月, 2015 10 次提交
-
-
由 Andreas Tolfsen 提交于
-
由 bors 提交于
So, I realize this is really late in the game so it's unlikely to be accepted but `FromRawFd`/`FromRawHandle` are necessary for fine grain control over file creation. For example, the current `OpenOptions` does not provide a way to avoid file creation races (there's no way to specify `O_EXCL` or the windows equivalent). Stabilizing these traits and their implementations will give 1.0 users fine-grain control over file creation without committing to any new complex APIs. Additionally, `AsRawFd`/`AsRawHandle` are already stable so I feel that that stabilizing their inverses is a reasonably small change. Disclaimer: I'm asking because my crate, tempfile, depends on this feature.
-
由 bors 提交于
Depends on #24921. r? @alexcrichton
-
由 bors 提交于
cc #19986 r? @Gankro
-
由 bors 提交于
The [UnsafeCell documentation says it is undefined behavior](http://doc.rust-lang.org/nightly/std/cell/struct.UnsafeCell.html), so people shouldn't do it. This happened to catch one case in libstd that was doing this, and I switched that to use an UnsafeCell internally. Closes #13146
-
由 bors 提交于
Added documentation of the panicking overflow to the `count` and `position` methods of `IteratorExt`, also make them more obvious in the code. Also mention that the `Iterator::next` method of the struct returned by `IteratorExt::enumerate` can panic due to overflow.
-
由 bors 提交于
Previously, `try_write` actually only obtained shared read access (but would return a `RwLockWriteGuard` if that access was successful). Also updates the docs for `try_read` and `try_write`, which were leftover from when those methods returned `Option` instead of `Result`.
-
由 Ms2ger 提交于
These constants were added in 6f54ce9a and e8fbd1ce to a consts module that is behind a gate. I have not confirmed that these constants do indeed work on either OSX or iOS. It appears that some of the constants may actually belong in a POSIX module, but I didn't make these changes here because I don't have access to the POSIX standard.
-
由 Steven Allen 提交于
-
- 06 5月, 2015 29 次提交
-
-
由 bors 提交于
Many bounds are currently of the form `T: ?Sized + AsRef<OsStr>` where the argument is `&T`, but the pattern elsewhere (primarily `std::fs`) has been to remove the `?Sized` bound and take `T` instead (allowing usage with both references and owned values). This commit generalizes the possible apis in `std::env` from `&T` to `T` in this fashion. The `split_paths` function remains the same as the return value borrows the input value, so ta borrowed reference is required.
-
由 John Gallagher 提交于
-
由 John Gallagher 提交于
-
由 Tobias Bucher 提交于
Explicitely spell out behaviour on overflow for `usize`-returning iterator functions. Mention that panics are guaranteed if debug assertions are active, otherwise a wrong result might be returned.
-
由 bors 提交于
collections: Convert SliceConcatExt to use associated types Coherence now allows this, we have `SliceConcatExt<T> for [V] where T: Sized + Clone` and` SliceConcatExt<str> for [S]`, these don't conflict because str is never Sized.
-
由 bors 提交于
-
由 bors 提交于
This PR adds a program which uses the JSON output from #24884 to generate a webpage with descriptions of each diagnostic error. The page is constructed by hand, with calls to `rustdoc`'s markdown renderers where needed. I opted to generate HTML directly as I think it's more flexible than generating a markdown file and feeding it into the `rustdoc` executable. I envision adding the ability to filter errors by their properties (description, no description, used, unused), which is infeasible using the whole-file markdown approach due to the need to wrap each error in a `<div>` (markdown inside tags isn't rendered). Architecturally, I wasn't sure how to add this generator to the distribution. For the moment I've settled on a separate Rust program in `src/etc/` that gets compiled and run by a custom makefile rule. This approach doesn't seem too hackish, but I'm unsure if my usage of makefile variables is correct, particularly the call to `rustc` (and the `LD_LIBRARY_PATH` weirdness). Other options I considered were: * Integrate the error-index generator into `rustdoc` so that it gets invoked via a flag and can be built as part of `rustdoc`. * Add the error-index-generator as a "tool" to the `TOOLS` array, and make use of the facilities for building tools. The main reason I didn't do this was because it seemed like I'd need to add lots of stuff. I'm happy to investigate this further if it's the preferred method.
-
由 Johannes Oertel 提交于
-
由 bors 提交于
Specifically, make count, nth, and last call the corresponding methods on the underlying iterator where possible. This way, if the underlying iterator has an optimized count, nth, or last implementations (e.g. slice::Iter), these methods will propagate these optimizations. Additionally, change Skip::next to take advantage of a potentially optimized nth method on the underlying iterator. This covers: * core::iter::Chain: count, last, nth * core::iter::Enumerate: count, nth * core::iter::Peekable: count, last, nth * core::iter::Skip: count, last, next (should call nth), nth * core::iter::Take: nth * core::iter::Fuse: count, last, nth of #24214.
-
由 Sean McArthur 提交于
-
由 Sean McArthur 提交于
-
由 Sean McArthur 提交于
[breaking-change] Technically breaking, since code that had been using these transmutes before will no longer compile. However, it was undefined behavior, so really, it's a good thing. Fixing your code would require some re-working to use an UnsafeCell instead. Closes #13146
-
由 bors 提交于
According to rust-lang/rfcs#235, `VecDeque` should have this method (`VecDeque` was called `RingBuf` at the time) but it was never implemented. I marked this stable since "1.0.0" because it's stable in `Vec`.
-
由 Tamir Duberstein 提交于
-
由 Tamir Duberstein 提交于
-
由 bors 提交于
Turns out that a verbatim path was leaking through to gcc via the PATH environment variable (pointing to the bundled gcc provided by the main distribution) which was wreaking havoc when gcc itself was run. The fix here is to just stop passing verbatim paths down by adding more liberal uses of `fix_windows_verbatim_for_gcc`. Closes #25072
-
由 Alex Crichton 提交于
Many bounds are currently of the form `T: ?Sized + AsRef<OsStr>` where the argument is `&T`, but the pattern elsewhere (primarily `std::fs`) has been to remove the `?Sized` bound and take `T` instead (allowing usage with both references and owned values). This commit generalizes the possible apis in `std::env` from `&T` to `T` in this fashion. The `split_paths` function remains the same as the return value borrows the input value, so ta borrowed reference is required.
-
由 bors 提交于
- Successful merges: #24782, #25080, #25112, #25114, #25127 - Failed merges:
-
由 Alex Crichton 提交于
Turns out that a verbatim path was leaking through to gcc via the PATH environment variable (pointing to the bundled gcc provided by the main distribution) which was wreaking havoc when gcc itself was run. The fix here is to just stop passing verbatim paths down by adding more liberal uses of `fix_windows_verbatim_for_gcc`. Closes #25072
-
由 Steve Klabnik 提交于
-
由 Steve Klabnik 提交于
I've added backticks in a few places to ensure correct highlighting in the HTML output (cf #25062). Other changes include: * Remove use of `1.` and `2.` separated by a code block as this was being rendered as two separate lists beginning at 1. * Correct the spelling of successful in two places (from "succesful"). Other changes are a result of reflowing text to stay within the 80 character limit.
-
由 Steve Klabnik 提交于
The indentation in this example is messed up. The `_ => break,` line was using a tab instead of spaces to indent.
-
由 Steve Klabnik 提交于
This also made me realize that I wasn't using the correct term, 'associated functions', rather than 'static methods'. So I corrected that in the method syntax chapter.
-
由 Steve Klabnik 提交于
Also, as @huonw guessed, move semantics really _does_ make more sense as a sub-chapter of ownership.
-
由 Steve Klabnik 提交于
This also made me realize that I wasn't using the correct term, 'associated functions', rather than 'static methods'. So I corrected that in the method syntax chapter.
-
由 Corey Farwell 提交于
-
由 Steve Klabnik 提交于
Also, as @huonw guessed, move semantics really _does_ make more sense as a sub-chapter of ownership.
-
由 bors 提交于
As pointed out in #17136 the semantics of a `BufStream` aren't always what one expects, and it looks like other [languages like C#][c-sharp] implement a buffered stream with only one underlying buffer. For now this commit destabilizes the primitive in the `std::io` module to give us some more time in figuring out what to do with it. [c-sharp]: https://msdn.microsoft.com/en-us/library/system.io.bufferedstream%28v=vs.110%29.aspx [breaking-change]
-
由 Steven Allen 提交于
Specifically, make count, nth, and last call the corresponding methods on the underlying iterator where possible. This way, if the underlying iterator has an optimized count, nth, or last implementations (e.g. slice::Iter), these methods will propagate these optimizations. Additionally, change Skip::next to take advantage of a potentially optimized nth method on the underlying iterator.
-
- 05 5月, 2015 1 次提交
-
-
由 bors 提交于
Closes #22471.
-