Rollup of 5 pull requests
Successful merges:
- #112946 (Improve cgu naming and ordering)
- #113048 (Fix build on Solaris where fd-lock cannot be used.)
- #113100 (Fix display of long items in search results)
- #113107 (add check for ConstKind::Value(_) to in_operand())
- #113119 (rustdoc: Reduce internal function visibility.)
r? `@ghost`
`@rustbot` modify labels: rollup
Rollup of 7 pull requests
Successful merges:
- #112670 (privacy: Type privacy lints fixes and cleanups)
- #112929 (Test that we require implementing trait items whose bounds don't hold in the current impl)
- #113054 (Make `rustc_on_unimplemented` std-agnostic)
- #113137 (don't suggest `move` for borrows that aren't closures)
- #113139 (style-guide: Clarify let-else further)
- #113140 (style-guide: Add an example of formatting a multi-line attribute)
- #113143 (style-guide: Narrow guidance about references and dereferencing)
r? `@ghost`
`@rustbot` modify labels: rollup
style-guide: Narrow guidance about references and dereferencing
The style guide advises "prefer dereferencing to taking references", but
doesn't give guidance on when that "preference" should get overridden by
other considerations. Give an example of when it's fine to ignore
that advice.
style-guide: Add an example of formatting a multi-line attribute
We already say to format attributes like functions, but we didn't have
an example of formatting a multi-line attribute.
style-guide: Clarify let-else further
Give some additional examples with multi-line patterns.
Make it clearer to go on to the next case if the conditions aren't met.
Test that we require implementing trait items whose bounds don't hold in the current impl
I initially tried to make most of these pass, but that's a big can of worms, so I'm just adding them as tests, considering we have no tests for these things.
The style guide advises "prefer dereferencing to taking references", but
doesn't give guidance on when that "preference" should get overridden by
other considerations. Give an example of when it's fine to ignore
that advice.
Make associated type bounds in supertrait position implied
`trait A: B<Assoc: C> {}` should be able to imply both `Self: B` and `<Self as B>::Assoc: C`. Adjust the way that we collect implied predicates to do so.
Fixes#112573Fixes#112568
add check for ConstKind::Value(_) to in_operand()
Added check for valtree value to close#113012 which fixes the issue, although I am not sure if adding the check there is sound or not cc `@oli-obk`
Refactor metadata emission to avoid visiting HIR
This PR refactors metadata emission to be based on tables and iteration over definitions.
In a first part, this PR moves information from the `EntryKind` enum to tables, until removing the `EntryKind` enum.
In a second part, the iteration scheme is refactored to avoid fetching HIR unless strictly necessary.
r? `@ghost`
Rollup of 6 pull requests
Successful merges:
- #111571 (Implement proposed API for `proc_macro_span`)
- #112236 (Simplify computation of killed borrows)
- #112867 (More `ImplSource` nits)
- #113019 (add note for non-exhaustive matches with guards)
- #113094 (Fix invalid HTML DIV tag used in HEAD)
- #113111 (add myself to review for t-types stuff)
r? `@ghost`
`@rustbot` modify labels: rollup
add note for non-exhaustive matches with guards
Associated issue: #92197
When a match statement includes guards on every match arm (and is therefore necessarily non-exhaustive), add a note to the error E0004 diagnostic noting this.
Validate fluent variable references in tests
Closes#101109
Under `cfg(test)`, the `fluent_messages` macro will emit a list of variables referenced by each message and its attributes. The derive attribute will now emit a `#[test]` that checks that each referenced variable exists in the structure it's applied to.
mir opt + codegen: handle subtyping
fixes#107205
the same issue was caused in multiple places:
- mir opts: both copy and destination propagation
- codegen: assigning operands to locals (which also propagates values)
I changed codegen to always update the type in the operands used for locals which should guard against any new occurrences of this bug going forward. I don't know how to make mir optimizations more resilient here. Hopefully the added tests will be enough to detect any trivially wrong optimizations going forward.
Add tests impl via obj unless denied
Fixes#112737
Add simple tests to check feature change in #112320 is performing as expected.
Note:
- Unsure about filenames, locations & function signature names (tried to make them something sensible)
Make `UnwindAction::Continue` explicit in MIR dump
Makes it easier to spot unwinding related issues in MIR by making `UnwindAction::Continue` explicit, just like all other `UnwindAction`s.
Allow comparing `Box`es with different allocators
Currently, comparing `Box`es over different allocators is not allowed:
```Rust
error[E0308]: mismatched types
--> library/alloc/tests/boxed.rs:22:20
|
22 | assert_eq!(b1, b2);
| ^^ expected `Box<{integer}, ConstAllocator>`, found `Box<{integer}, AnotherAllocator>`
|
= note: expected struct `Box<{integer}, ConstAllocator>`
found struct `Box<{integer}, AnotherAllocator>`
For more information about this error, try `rustc --explain E0308`.
error: could not compile `alloc` (test "collectionstests") due to previous error
```
This PR lifts this limitation
Make compiletest aware of targets without dynamic linking
Some parts of the compiletest internals and some tests require dynamic linking to work, which is not supported by all targets. Before this PR, this was handled by if branches matching on the target name.
This PR loads whether a target supports dynamic linking or not from the target spec, and adds a `// needs-dynamic-linking` attribute for tests that require it. Note that I was not able to replace all the old conditions based on the target name, as some targets have `dynamic_linking: true` in their spec but pretend they don't have it in compiletest.
Also, to get this to work I had to *partially* revert #111472 (cc `@djkoloski` `@tmandry` `@bjorn3).` On one hand, only the target spec contains whether a target supports dynamic linking, but on the other hand a subset of the fields can be overridden through `-C` flags (as far as I'm aware only `-C panic=$strategy`). The solution I came up with is to take the target spec as the base, and then override the panic strategy based on `--print=cfg`. Hopefully that should not break y'all again.