Rollup of 10 pull requests
Successful merges:
- #111428 (refactor(resolve): clean up the early error return caused by non-call)
- #111449 (Recover `impl<T ?Sized>` correctly)
- #111572 (Document that `missing_copy_implementations` and `missing_debug_implementations` only apply to public items.)
- #111602 (Suppress "erroneous constant used" for constants tainted by errors)
- #111605 (fixup version placeholder for `cfi_encoding` feature)
- #111607 (Add clubby789 to the bootstrap review rotation)
- #111614 (Add more interesting nonsense to weird-exprs.rs)
- #111617 (Fixed typo)
- #111620 (Add eholk back to compiler-contributors reviewers)
- #111621 (Fix release date of 1.58.1 in release notes.)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
Fix release date of 1.58.1 in release notes.
This fixes the release notes to have the correct release date for 1.58.1. The [blog announcement](https://blog.rust-lang.org/2022/01/20/Rust-1.58.1.html) has the correct date and link (which is otherwise broken without this change).
Closes#94278
Add clubby789 to the bootstrap review rotation
r? `````@clubby789````` - thank you for volunteering!
I have been meaning for a very long time now to write up how to do reviews, but I haven't gotten around to it yet :( here is a short summary:
1. If you're not sure what the changes does or if it's ok, always feel free to ping someone else on the team, especially in the first few weeks. You can use `r? bootstrap` to get triagebot to assign someone else.
2. Bootstrap unfortunately has very few tests. Things that touch CLI or toml parsing should likely have a test in `src/bootstrap/config/tests.rs`; things that touch "core" build logic should have a test in `builder/tests.rs`, anything else kinda just slips in :( see https://github.com/rust-lang/rust/issues/102563 for ideas on how to improve the situation here.
3. "Major" changes should be documented in `src/bootstrap/CHANGELOG.md`. "Major" is up to you, but if it breaks a config option or otherwise is likely to break *someone's* build, it's probably major. If it breaks nearly *everyone*'s build, it should also update `VERSION` in `lib.rs`; this should be very rare. Please also ping me or Mark-Simulacrum for major changes (I might set up a triagebot ping for this so you don't have to remember).
4. Once you've approved the PR, tell bors it's ok - you've been contributing for a while so you know how bors works, but here's a cheatsheet just in case: https://bors.rust-lang.org
Documentation about how to use bootstrap lives at https://rustc-dev-guide.rust-lang.org/building/bootstrapping.html; internal docs live in `src/bootstrap/README.md`. The latter unfortunately is not very complete.
Suppress "erroneous constant used" for constants tainted by errors
When constant evaluation fails because its MIR is tainted by errors,
suppress note indicating that erroneous constant was used, since those
errors have to be fixed regardless of the constant being used or not.
Fixes#110891.
Document that `missing_copy_implementations` and `missing_debug_implementations` only apply to public items.
I encountered #111359 (fixed) and noticed that the documentation didn't say that it was _intended_ that `missing_debug_implementations` only applies to public items. This PR fixes that, and makes the same wording change to `missing_copy_implementations` which has the same condition.
I chose the words to also be similar to `missing_docs` which already had such a remark.
Recover `impl<T ?Sized>` correctly
Fixes#111327
r? ````@Nilstrieb```` but you can re-roll
Alternatively, happy to close this if we're okay with just saying "sorry #111327 is just a poor side-effect of parser ambiguity" 🤷
Get current target config from` --print=cfg`
Compiletest was switched to querying all targets using `--print=all-target-specs-json` and `--print=target-spec-json` in #108905. This unintentionally prevented codegen flags like `-Cpanic` from being reflected in the current target configuration. This change gets the current compiletest target config using `--print=cfg` like it was previously while still using the faster prints for getting information on all other targets.
Fixes#110850.
`@jyn514` might be interested in reviewing since they commented on the issue.
cc `@tmandry` since this issue is affecting Fuchsia.
Combine three generalizer implementations
Fixes#111092Fixes#109505
This code is a bit delicate and there were subtle changes between them, so I'll leave inline comments where further inspection is needed.
Regarding this comment from #109813 -- "add tests triggering all codepaths: at least the combine and the const generalizer", can't really do that now, and I don't really know how we'd get a higher-ranked const error since non-lifetime binders doesn't *really* support `for<const ..>` (it errors out when you try to use it).
r? `@lcnr`
Remove misleading target feature aliases
Fixes#100752. This is a follow up to #103750. These aliases could not be completely removed until rust-lang/stdarch#1355 landed.
cc `@Amanieu`
Rollup of 8 pull requests
Successful merges:
- #108291 (Fix more benchmark test with black_box)
- #108356 (improve doc test for UnsafeCell::raw_get)
- #110049 (Don't claim `LocalKey::with` prevents a reference to be sent across threads)
- #111525 (Stop checking for the absence of something that doesn't exist)
- #111538 (Make sure the build.rustc version is either the same or 1 apart)
- #111578 (Move expansion of query macros in rustc_middle to rustc_middle::query)
- #111584 (Number lexing tweaks)
- #111587 (Custom MIR: Support `Rvalue::CopyForDeref`)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
Move expansion of query macros in rustc_middle to rustc_middle::query
This moves the expansion of `define_callbacks!` and `define_feedable!` from `rustc_middle::ty::query` to `rustc_middle::query`.
This means that types used in queries are both imported and used in `rustc_middle::query` instead of being split between these modules. It also decouples `rustc_middle::ty::query` further from `rustc_middle` which is helpful since we want to move `rustc_middle::ty::query` to the query system crates.
Stop checking for the absence of something that doesn't exist
A couple of codegen tests are doing
```
// CHECK-NOT: slice_index_len_fail
```
However, that function no longer exists: [the only places](https://github.com/search?q=repo%3Arust-lang%2Frust+slice_index_len_fail&type=code) it occurs in the repo are in those tests.
So this PR updates the tests to check for the absense of the functions that are actually used today to panic for out-of-bounds indexing.
Don't claim `LocalKey::with` prevents a reference to be sent across threads
The documentation for `LocalKey` claims that `with` yields a reference that cannot be sent across threads, but this is false since you can easily do that with scoped threads. What it actually prevents is the reference from outliving the current thread.
(docs) Change "wanting" to "want"
Changing " If you’re wanting" to "If you want".
Wanting is not wrong, of course, but I think that "If you want" feels more natural to most readers.
Fix some misleading and copy-pasted `Pattern` examples
These examples were listed twice and also were confusable with doing a substring match instead of a any-of-set match.
Appease lints
Resolved an unnecessary drop warning that appeared when running the linkchecker. Some clippy warnings, too.
Edit: Well this fired up all the CI pipeline. I hope that's not a problem.
Simplify find_width_of_character_at_span.
This makes `find_width_of_character_at_span` simpler and more robust against bad spans.
Fixes (but does not close, per beta policy) https://github.com/rust-lang/rust/issues/111485
add util function to TokenStream to eliminate some clones
Another proposed change in the same vein as #111492 trying to get rid of some clones.
This adds a TokenStream helper function so that rustdoc can directly get a chunks iterator over the underlying token trees so that it no longer needs the clones and vec.
Start node has no immediate dominator
Change the immediate_dominator return type to Option, and use None to
indicate that node has no immediate dominator.
Also fix the issue where the start node would be returned as its own
immediate dominator.
Update doc for `PhantomData` to match code example
After https://github.com/rust-lang/rust/pull/106621, there is no longer a `T: 'a` annotation in the doc example, so update the text to match the code.