In effect, these just casted `&mut stat64` to `*mut stat64`, twice.
That's harmless, but it masked a problem when this was copied to new
code calling `fstatat`, which takes a pointer to `struct stat`. That
will be fixed by #51785, but let's remove the unnecessary casts here
too.
build: add llvm-tools to manifest
This commit expands on a previous commit to build llvm-tools as a rustup component. It causes the llvm-tools component to be built if the extended step is active. It also adds llvm-tools to the build manifest so rustup can find it.
I tested this as far as I could, but had to hack `build-manifest/src/main.rs` a bit as it is not supported on MacOS. The main change I am not sure about is this line:
```rust
self.package("llvm-tools", &mut manifest.pkg, TARGETS);
```
There are numerous calls to `self.package()`, and I'm not sure if `TARGETS`, `HOSTS`, or `["*"]` is appropriate for llvm-tools.
Otherwise I mostly copied the example set by `rustfmt-preview`.
three diagnostics upgrades
* reword `...` expression syntax error to not imply that you should use it in patterns either (#51043) and make it a structured suggestion
* shorten the top-line message for the trivial-casts lint by tucking the advisory sentence into a help note
* structured suggestion for pattern-named-the-same-as-variant warning
r? @oli-obk
This is virtually certain to cause regressions, needs crater.
In #50781 it was discovered that our object safety rules are not sound because we allow `Self` in where clauses without restrain. This PR is a direct fix to the rules so that we disallow methods with unsound where clauses.
This currently uses hard error to measure impact, but we will want to downgrade it to a future compat error.
Fixes#50781.
r? @nikomatsakis
Prohibit `global_allocator` in submodules
Background: #44113 is caused by weird interactions with hygiene. Hygiene is hard. After a lot of playing around, we decided that the best path forward would be to prohibit `global_allocator`s from being in submodules for now. When somebody gets it working, we can re-enable it.
This PR contains the following
- Some hygiene "fixes" -- things I suspect are the correct thing to do that will make life easier in the future. This includes using call_site hygiene for the generated module and passing the correct crate name to the expansion config.
- Comments and minor formatting fixes
- Some debugging code
- Code to prohibit `global_allocator` in submodules
- Test checking that the proper error occurs.
cc #44113#49320#51241
r? @alexcrichton
- we need to figure out hygiene first
- change the test to check that the prohibition works with a good error
msg
- leaves some comments and debugging code
- leaves some of our supposed fixes
The top level message shouldn't be too long; the
replaced-by-coercion/temporary-variable advice can live in a note. Also,
don't mention type ascription when it's not actually available as a real
thing. (The current state of discussion on the type ascription tracking
issue #23416 makes one rather suspect it will never be a stable thing in
its current form, but that's not for us to adjudicate in this commit.)
While we're here, yank out the differentiating parts of the
numeric/other conditional and only have one codepath emitting the
diagnostic.
Now that `..=` inclusive ranges are stabilized, people probably
shouldn't be using `...` even in patterns, even if it's still legal
there (see #51043). To avoid drawing attention to `...` being a real
thing, let's reword this message to just say "unexpected token" rather
"cannot be used in expressions".
Update rustfmt submodule
The version of rustfmt currently shipped with nightly breaks code that uses `break 'label`. This PR updates the submodule to include the fix (https://github.com/rust-lang-nursery/rustfmt/pull/2774).
Option::get_or_insert(_with): Replace unreachable! with unreachable_unchecked
Optimize codegen for both functions as the None branch is trivially not reachable.