Unsized tuple coercions
Part of #18469. Fixes#32702.
#37685 and #34451 might also be related.
This PR does the following:
- Introduce explicit `Sized` constraints on tuple initializers, similar to that of record-struct initializers. Not much relevant to the main contribution but I noticed this when making tests for unsized tuple coercions.
- Implement `(.., T): Unsize<(.., U)>` where `T: Unsize<U>`.
- Assume `(.., T)` is MaybeUnsizedUnivariant.
- Modify `src/librustc/ty/util.rs` and `src/librustc_trans/glue.rs` so that tuples and structs are uniformly traversed when translating.
Document that `/` works as separator on Windows
Hi Whenever I see code like `Path::new("./src/bin/main.rs")` or `path.ends_with("foo/bar")`, I wonder if it will work on Windows as I expect. Unfortunately, reading the current docs does not help to answer this question, because all examples are Unix-specific.
However, I believe that using `/` is fine, because both Windows itself [and Rust stdlib](47faf1d519/src/libstd/sys/windows/path.rs (L26)) do treat it as a file separator, and because it is [actually used](abf01e1edd/tests/git.rs (L579)) in Cargo. So looks like we can just document it?
r? @steveklabnik
cc @retep998 I don't actually program for windows that much, so I might be totally wrong, and perhaps we should advise to always use (allocating) `.join` method to construct paths of more than one component?
[libcore/cmp] Expand Ord/PartialOrd Derivable doc for enum types
Expand Derivable docblock section for `Ord` and `PartialOrd` to cover
`enum` types, in addition to the existing language explaining it for
`struct` types.
std: Fix implementation of `Alloc::alloc_one`
This had an accidental `u8 as *mut T` where it was intended to have just a
normal pointer-to-pointer cast.
Closes#42827
Update docs for fmt::write.
#29355
I reworded it slightly to make it more clear that the function only take
two arguments - the output and the Arguments struct that can be
generated from the format_args! macro.
r? @steveklabnik
add `allow_fail` test attribute
This change allows the user to add an `#[allow_fail]` attribute to
tests that will cause the test to compile & run, but if the test fails
it will not cause the entire test run to fail. The test output will
show the failure, but in yellow instead of red, and also indicate that
it was an allowed failure.
Here is an example of the output: http://imgur.com/a/wt7ga