In particular, be clear that it is sound to specify memory not
originating from a previous `Vec` allocation. That is already suggested
in other parts of the documentation about zero-alloc conversions to Box<[T]>.
Incorporate a constraint from `slice::from_raw_parts` that was missing
but needs to be fulfilled, since a `Vec` can be converted into a slice.
Pull Derefer before ElaborateDrops
_Follow up work to #97025#96549#96116#95887 #95649_
This moves `Derefer` before `ElaborateDrops` and creates a new `Rvalue` called `VirtualRef` that allows us to bypass many constraints for `DerefTemp`.
r? `@oli-obk`
Rollup of 10 pull requests
Successful merges:
- #98789 (rustdoc-json-types: Clean up derives.)
- #98848 (Build the Clippy book as part of x.py doc)
- #99020 (check non_exhaustive attr and private fields for transparent types)
- #99132 (Add some autolabels for A-bootstrap and T-infra)
- #99148 (Clarify that [iu]size bounds were only defined for the target arch)
- #99152 (Use CSS variables to handle theming (part 2))
- #99168 (Add regression test for #74713)
- #99176 (⬆️ rust-analyzer)
- #99183 (Mention rust-analyzer maintainers when `proc_macro` bridge is changed)
- #99185 (llvm-wrapper: adapt for LLVM API change)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
Mention rust-analyzer maintainers when `proc_macro` bridge is changed
rust-analyzer vendors a modified copy of the `proc_macro` crate in order to expand procedural macros built by Cargo. Since the ABI used by proc macros can change, we need to follow along with those changes. Getting notified when the proc macro bridge changes should make that easier, since that's what defines the ABI.
cc ```@rust-lang/wg-rls-2```
Build the Clippy book as part of x.py doc
r? ``@ehuss`` since you said you would be interested in helping moving this forward.
cc ``@jyn514`` as part of the bootstrap team.
rustdoc-json-types: Clean up derives.
Closes#96189
Everything is `Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize` except `Crate` and `Item` which arn't `Hash`, as they have `HashMap`'s. See linked issue for reasoning.
``@rustbot`` modify labels: +T-rustdoc +A-rustdoc-json
Remove most box syntax from librustdoc
This is the second attempt after the librustdoc specific changes have been reverted from #87781 in #89134, due to a minor, but exant regression caused by the changes. ~~There have been some changes to librustdoc in the past and maybe thanks to them there is no regression any more. If there is still a regression, one can investigate further and maybe find ways to fix the regressions. Thus, i request a perf run.~~ Edit: turns out there is still a regression, but it's caused only by a subset of the changes. So I've changed this PR to only contains the changes that don't cause any performance regressions, keeping the regression causing changes for a later PR.
Configure nightly branch name in `stage0.json`
The beta version number detection code relies on git to know how many merge commits were made since we branched off, and in doing so hardcodes `master` as the default branch name. This works for rust-lang/rust, but is problematic for forks that use a different default branch name (in Ferrocene we use `main` instead).
This PR changes the code to instead load the default branch name from `src/stage0.json`. `bump-stage0` has also been updated to remove the need to update it every time a new field is added to `stage0.json`.
interpret: refactor projection handling code
Moves our projection handling code into a common file, and avoids the use of a
general mplace-based fallback function by have more specialized implementations.
mplace_index (and the other slice-related functions) could be more efficient by
copy-pasting the body of operand_index. Or we could do some trait magic to share
the code between them. But for now this is probably fine.
This is the common part of https://github.com/rust-lang/rust/pull/99013 and https://github.com/rust-lang/rust/pull/99097. I am seeing some strange perf results so this probably should be its own change so we know which diff caused which perf changes...
r? `@oli-obk`
Rollup of 6 pull requests
Successful merges:
- #98622 (rustc_target: Flip the default for `TargetOptions::executables` to true)
- #98633 (Fix last `let_chains` blocker)
- #98972 (Suggest adding a missing zero to a floating point number)
- #99038 (Some more `EarlyBinder` cleanups)
- #99154 (use PlaceRef::iter_projections to fix old FIXME)
- #99171 (Put back UI test regex)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
Put back UI test regex
I just realized I overwrote these two commits in https://github.com/rust-lang/rust/pull/99055 when force pushing to fix the stdout output...
r? `@Dylan-DPC`
Fix last `let_chains` blocker
In order to forbid things like `let x = (let y = 1);` or `if let a = 1 && { let x = let y = 1; } {}`, the parser **HAS** to know the context of `let`.
This context thing is not a surprise in the parser because you can see **a lot** of ad hoc fixes mixing parsing logic with validation logic creating code that looks more like spaghetti with tomato sauce.
To make things even greater, a new ad hoc fix was added to only allow `let`s in a valid `let_chains` context by checking the previously processed token. This was the only solution I could think of and believe me, I thought about it for a long time 👍
In the long term, it should be preferable to segregate different responsibilities or create a more robust and cleaner parser framework.
cc https://github.com/rust-lang/rust/pull/94927
cc https://github.com/rust-lang/rust/issues/53667
Moves our projection handling code into a common file, and avoids the use of a
general mplace-based fallback function by have more specialized implementations.
mplace_index (and the other slice-related functions) could be more efficient by
copy-pasting the body of operand_index. Or we could do some trait magic to share
the code between them. But for now this is probably fine.
Rollup of 8 pull requests
Successful merges:
- #97210 (Support `-A`, `-W`, `-D` and `-F` when running `./x.py clippy`)
- #99055 (Fix rustdoc help options)
- #99075 (Fix duplicated type annotation suggestion)
- #99124 (Fix sized check ICE in asm check)
- #99142 (fix(doctest): treat fatal parse errors as incomplete attributes)
- #99145 (Don't rerun the build script for the compiler each time on non-windows platforms)
- #99146 (Do not error during method probe on `Sized` predicates for types that aren't the method receiver)
- #99161 (compiletest: trim edition before passing as flag)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
Do not error during method probe on `Sized` predicates for types that aren't the method receiver
Fixes#61525
This is safe even though we're skipping an error because we end up confirming the method, which means we're still checking the `Sized` predicate in the end. It just means that we don't emit an erroneous message as below:
```
error: the `query` method cannot be invoked on a trait object
--> src/lib.rs:14:11
|
14 | 1.query::<dyn ToString>("")
| ^^^^^
|
= note: another candidate was found in the following trait, perhaps add a `use` for it:
`use crate::Example;`
```
Also fixes erroneously suggesting the same trait over again, as seen in the `issue-35976.rs` UI test.
Don't rerun the build script for the compiler each time on non-windows platforms
In practice, this doesn't matter very much because the script takes ~no time to run.
But this makes `CARGO_LOG=info` easier to read, and theoretically saves a few milliseconds.
Fix sized check ICE in asm check
Fixes (beta nominated, so doesn't close) #99122
1. Moves a check for unresolved inference variables to _before_ other checks that could possibly ICE. We're not changing behavior here, just doing the same thing earlier in the function.
2. Erases region variables in sized check (which are not resolved at this point) because rustc will also ICE when region vars are passed to a query which does not canonicalize them.
Fix duplicated type annotation suggestion
Before, there was more or less duplicated suggestions to add type hints.
Fix by clearing more generic suggestions when a more specific suggestion
is possible.
This fixes#93506 .
Fix rustdoc help options
Fixes#98976.
Since you're the one who found out about the problem and also provided the solution (thanks for both!):
r? ```@jyn514```