Revert "Disable big-endian simd in swap_nonoverlapping_bytes"
This reverts commit 77bd4dc654 (#43159).
Issue #42778 was formerly easy to reproduce on two big-endian targets,
`powerpc64` and `s390x`, so we disabled SIMD on this function for all
big-endian targets as a workaround.
I have re-tested this code on `powerpc64` and `s390x`, each with the
bundled LLVM 8 and with external LLVM 7 and LLVM 6, and the problems no
longer appear. So it seems safe to remove this workaround, although I'm
still a little uncomfortable that we never found a root-cause...
Closes#42778.
r? @arielb1
Omit the vendor component in the WASI triple
This renames wasm32-unknown-wasi to wasm32-wasi, omitting the vendor
component. This follows aarch64-linux-android, x86_64-fuchsia, and others in
omitting the vendor field, which has the advantage of aligning with the
[multiarch tuple](https://wiki.debian.org/Multiarch/Tuples), and of being
less noisy.
r? @alexcrichton
Rollup of 8 pull requests
Successful merges:
- #59348 (Clean up and add tests for slice drop shims)
- #60188 (Identify when a stmt could have been parsed as an expr)
- #60234 (std: Derive `Default` for `io::Cursor`)
- #60618 (Comment ext::tt::transcribe)
- #60648 (Skip codegen for one UI test with long file path)
- #60671 (remove unneeded `extern crate`s from build tools)
- #60675 (Remove the old await! macro)
- #60676 (Fix async desugaring providing wrong input to procedural macros.)
Failed merges:
r? @ghost
Updated to handle these changes:
- `core::ptr::*` lost their `__0` elements and are just plain pointers
- `core::ptr::*` probably shouldn't dereference in `DisplayString` s
- `VecDeque` and `Vec` use `core::ptr::*` s
- `VecDeque` and `LinkedList` moved modules again.
Retested - still working fine, left alone:
- `String`, `&str`, `Option`
According to the Cargo Reference:
https://doc.rust-lang.org/cargo/reference/manifest.html
> This is an SPDX 2.1 license expression for this package. Currently
> crates.io will validate the license provided against a whitelist of
> known license and exception identifiers from the SPDX license list
> 2.4. Parentheses are not currently supported.
>
> Multiple licenses can be separated with a `/`, although that usage
> is deprecated. Instead, use a license expression with AND and OR
> operators to get more explicit semantics.
Fix async desugaring providing wrong input to procedural macros.
Fixes#60674.
This PR fixes a minor oversight introduced by #60535 where unused `mut` binding modes were removed from the arguments to an `async fn` (as they were added to the statement that we insert into the closure body). However, this meant that the input to procedural macros was incorrect. This removes that and instead fixes the `unused_mut` error that it avoided.
r? @cramertj
cc @taiki-e
Skip codegen for one UI test with long file path
The path to this test is so long that object files produced by it hit some path length limit on Windows and linker cannot find them.
The workaround here is to skip codegen and avoid producing object files, this test doesn't need them anyway.
Comment ext::tt::transcribe
Also did a bit of minor cleanup (remove unidiomatic use of `Add` and an unneeded `clone`). No functionality changes.
r? @petrochenkov
Identify when a stmt could have been parsed as an expr
There are some expressions that can be parsed as a statement without
a trailing semicolon depending on the context, which can lead to
confusing errors due to the same looking code being accepted in some
places and not others. Identify these cases and suggest enclosing in
parenthesis making the parse non-ambiguous without changing the
accepted grammar.
Fix#54186, cc #54482, fix#59975, fix#47287.
Clean up and add tests for slice drop shims
Adds a test for the MIR generated by `real_drop_in_place::<[T]>`. Also slightly reduces the number of statements and locals used in the shim.
r? @RalfJung
Upgrade non-LTS Ubuntu images in CI
This PR bumps `dist-various-2` to 18.04 LTS and both `x86_64-gnu` and `x86_64-gnu-debug` to 19.04.
Another change is the switch to [rust-lang/mirror-google-fuchsia-zircon](https://github.com/rust-lang/mirror-google-fuchsia-zircon) as the Zircon repository, used during Fuchsia tests: the original repository ([fuchsia.googlesource.com/zircon](https://fuchsia.googlesource.com/zircon)) is now behind a login wall and it doesn't contain anything at all.
r? @alexcrichton
cc @cramertj -- what's happening on the Fuchsia side?
Rollup of 5 pull requests
Successful merges:
- #60601 (Add a `cast` method to raw pointers.)
- #60638 (pin: make the to-module link more visible)
- #60647 (cleanup: Remove `DefIndexAddressSpace`)
- #60656 (Inline some Cursor calls for slices)
- #60657 (Stabilize and re-export core::array in std)
Failed merges:
r? @ghost
This renames wasm32-unknown-wasi to wasm32-wasi, omitting the vendor
component. This follows aarch64-linux-android, x86_64-fuchsia, and others in
omitting the vendor field, which has the advantage of aligning with the
[multiarch tuple](https://wiki.debian.org/Multiarch/Tuples), and of being
less noisy.
This commit removes the modification of the mutability of simple
bindings. While the mutability isn't used, it is important that it is
kept so that the input to procedural macros matches what the user wrote.
This commit also modifies the span of the binding mode so that it is
considered a compiler desugaring and won't be linted against for being
unused..
Inline some Cursor calls for slices
(Partially) brings back https://github.com/rust-lang/rust/pull/33921
I've noticed in some serialization code I was writing that writes to slices produce much, much, worse code than you'd expect even with optimizations turned on. For example, you'd expect something like this to be zero cost:
```
use std::io::{self, Cursor, Write};
pub fn serialize((a, b): (u64, u64)) -> [u8;8+8] {
let mut r = [0u8;16];
{
let mut w = Cursor::new(&mut r[..]);
w.write(&a.to_le_bytes()).unwrap();
w.write(&b.to_le_bytes()).unwrap();
}
r
}
```
...but it compiles down to [dozens of instructions](https://rust.godbolt.org/z/bdwDzb) because the `slice_write()` calls aren't inlined, which in turn means `unwrap()` can't be optimized away, and so on.
To be clear, this pull-req isn't sufficient by itself: if we want to go down that path we also need to add `#[inline]`'s to the default implementations for functions like `write_all()` in the `Write` trait and so on, or implement them separately in the `Cursor` impls. But I figured I'd start a conversation about what tradeoffs we're expecting here.
cleanup: Remove `DefIndexAddressSpace`
The scheme with two address spaces for `DefIndex` was needed in the past, but apparently not needed anymore (after removing `DefId`s from locals and `HirId`-ification).
Add a `cast` method to raw pointers.
This is similar to `NonNull::cast`.
Compared to the `as` operator (which has a wide range of meanings depending on the input and output types), a call to this method:
* Can only go from a raw pointer to a raw pointer
* Cannot change the pointer’s `const`ness
… even when the pointed types are inferred based on context.