Rollup of 8 pull requests
Successful merges:
- #108022 (Support allocations with non-Box<[u8]> bytes)
- #108367 (Re-apply "switch to the macos-12-xl builder")
- #108557 (Point error span at Some constructor argument when trait resolution fails)
- #108573 (Explain compile-time vs run-time difference in env!() error message)
- #108584 (Put backtick content from rustdoc search errors into a `<code>` elements)
- #108624 (Make `ExprKind` the first field in `thir::Expr`)
- #108644 (Allow setting hashmap toml values in `./configure`)
- #108672 (Feed queries on impl side for RPITITs when using lower_impl_trait_in_trait_to_assoc_ty)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
Handle trait alias definitions
Part of #2773
This PR adds a bunch of structs and enum variants for trait aliases. Trait aliases should be handled as an independent item because they are semantically distinct from traits.
I basically started by adding `TraitAlias{Id, Loc}` to `hir_def::item_tree` and iterated adding necessary stuffs until compiler stopped complaining what's missing. Let me know if there's still anything I need to add.
I'm opening up this PR for early review and stuff. I'm planning to add tests for IDE functionalities in this PR, but not type-related support, for which I put FIXME notes.
This commit desugars the drop and replace deriving from an
assignment at MIR build, avoiding the construction of the
DropAndReplace terminator (which will be removed in a followign PR)
In order to retain the same error messages for replaces a new
DesugaringKind::Replace variant is introduced.
feat: allow `generate_function` to generate in different local crate
Closes#14224
This PR allows `generate_function` assist to generate in crates other than the current one. I took a step further from the original request and made it allow to generate in any local crates since it looked reasonable and IDE layer doesn't really know about packages.
(actually we have been checking which crate we're generating in only for methods and not for freestanding functions, so we were providing the assist for `std::foo$0()`; it's both feature and fix in a sense)
The first commit is a drive-by fix unrelated to the feature.
`mirror_expr_inner` calls `temporary_scope`. It then calls
`make_mirror_unadjusted` which makes an identical call to
`temporary_scope`.
This commit changes the `mirror_expr_inner` to get the `temp_lifetime`
out of the expression produced by `make_mirror_unadjusted`, similar to
how it currently gets the type.