Extract all instance shim variants into new ShimKind enum#158105
Extract all instance shim variants into new ShimKind enum#158105camelid wants to merge 3 commits into
ShimKind enum#158105Conversation
|
cc @bjorn3 Some changes occurred in compiler/rustc_sanitizers cc @rcvalle Some changes occurred to the CTFE / Miri interpreter cc @rust-lang/miri This PR changes rustc_public cc @oli-obk, @celinval, @ouz-a, @makai410 Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt Some changes occurred to the CTFE machinery |
|
Not sure if this should get an MCP; let me know. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
This comment has been minimized.
This comment has been minimized.
|
since it touches a fairly often called query and data structure, let's perf it first @bors try @rust-timer queue r=me with that clean or green |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Extract all instance shim variants into new `ShimKind` enum
This comment has been minimized.
This comment has been minimized.
They tend to have similar handling -- e.g., they should be the only input to the `mir_shims` query -- so it's cleaner to group them together. This will also make potential future refactorings easier, such as only carrying `GenericArgsRef` for instances that actually use it (e.g., `Item`) but not others (e.g., `CloneShim`). Many of the shim variants still have `Shim` at the end of their names. To make the refactoring easier and keep the diff clean, I will trim those suffixes off in the next commit.
It used to be much more prevalent before I extracted shims as their own enum.
|
Finished benchmarking commit (d347081): comparison URL. Overall result: ❌ regressions - no action neededBenchmarking means the PR may be perf-sensitive. Consider adding rollup=never if this change is not fit for rolling up. @rustbot label: -S-waiting-on-perf -perf-regression Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (primary -2.6%, secondary -2.3%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary -0.2%, secondary 2.3%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeResults (secondary 0.0%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Bootstrap: 505.379s -> 508.681s (0.65%) |
|
Perf looks good, just a small regression on one scenario for a secondary benchmark. Also fixed the commit history. @bors r=oli-obk |
Extract all instance shim variants into new `ShimKind` enum They tend to have similar handling -- e.g., they should be the only input to the `mir_shims` query -- so it's cleaner to group them together. This will also make potential future refactorings easier, such as only carrying `GenericArgsRef` for instances that actually use it (e.g., `Item`) but not others (e.g., `CloneShim`). cc https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/moving.20ty.3A.3AInstance.2Eargs.20into.20ty.3A.3AInstanceKind.20variants r? @oli-obk
Rollup of 6 pull requests Successful merges: - #157960 (delegation: add support for infers in generics) - #157983 (Lift the same-signature restriction for `extern "tail"`) - #158105 (Extract all instance shim variants into new `ShimKind` enum) - #158207 (Resolver: local/external split of `resolve_ident_in_module_non_globs_unadjusted` ) - #158222 (format: ignore println newline in foreign format hints) - #158252 (Use `cfg_select` in `std::os`)
Extract all instance shim variants into new `ShimKind` enum They tend to have similar handling -- e.g., they should be the only input to the `mir_shims` query -- so it's cleaner to group them together. This will also make potential future refactorings easier, such as only carrying `GenericArgsRef` for instances that actually use it (e.g., `Item`) but not others (e.g., `CloneShim`). cc https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/moving.20ty.3A.3AInstance.2Eargs.20into.20ty.3A.3AInstanceKind.20variants r? @oli-obk
Rollup of 6 pull requests Successful merges: - #157960 (delegation: add support for infers in generics) - #157983 (Lift the same-signature restriction for `extern "tail"`) - #158105 (Extract all instance shim variants into new `ShimKind` enum) - #158207 (Resolver: local/external split of `resolve_ident_in_module_non_globs_unadjusted` ) - #158222 (format: ignore println newline in foreign format hints) - #158274 (triagebot: Stop pinging myself)
Rollup of 6 pull requests Successful merges: - #157960 (delegation: add support for infers in generics) - #157983 (Lift the same-signature restriction for `extern "tail"`) - #158105 (Extract all instance shim variants into new `ShimKind` enum) - #158207 (Resolver: local/external split of `resolve_ident_in_module_non_globs_unadjusted` ) - #158222 (format: ignore println newline in foreign format hints) - #158274 (triagebot: Stop pinging myself)
Rollup of 6 pull requests Successful merges: - #157960 (delegation: add support for infers in generics) - #157983 (Lift the same-signature restriction for `extern "tail"`) - #158105 (Extract all instance shim variants into new `ShimKind` enum) - #158207 (Resolver: local/external split of `resolve_ident_in_module_non_globs_unadjusted` ) - #158222 (format: ignore println newline in foreign format hints) - #158274 (triagebot: Stop pinging myself)
Extract all instance shim variants into new `ShimKind` enum They tend to have similar handling -- e.g., they should be the only input to the `mir_shims` query -- so it's cleaner to group them together. This will also make potential future refactorings easier, such as only carrying `GenericArgsRef` for instances that actually use it (e.g., `Item`) but not others (e.g., `CloneShim`). cc https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/moving.20ty.3A.3AInstance.2Eargs.20into.20ty.3A.3AInstanceKind.20variants r? @oli-obk
Rollup of 6 pull requests Successful merges: - #157960 (delegation: add support for infers in generics) - #158105 (Extract all instance shim variants into new `ShimKind` enum) - #158207 (Resolver: local/external split of `resolve_ident_in_module_non_globs_unadjusted` ) - #158222 (format: ignore println newline in foreign format hints) - #158257 ( fix escaping placeholder check in next solver normalization folder) - #158274 (triagebot: Stop pinging myself)
Extract all instance shim variants into new `ShimKind` enum They tend to have similar handling -- e.g., they should be the only input to the `mir_shims` query -- so it's cleaner to group them together. This will also make potential future refactorings easier, such as only carrying `GenericArgsRef` for instances that actually use it (e.g., `Item`) but not others (e.g., `CloneShim`). cc https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/moving.20ty.3A.3AInstance.2Eargs.20into.20ty.3A.3AInstanceKind.20variants r? @oli-obk
Rollup of 8 pull requests Successful merges: - #157960 (delegation: add support for infers in generics) - #158105 (Extract all instance shim variants into new `ShimKind` enum) - #158207 (Resolver: local/external split of `resolve_ident_in_module_non_globs_unadjusted` ) - #158222 (format: ignore println newline in foreign format hints) - #158252 (Use `cfg_select` in `std::os`) - #158257 ( fix escaping placeholder check in next solver normalization folder) - #158274 (triagebot: Stop pinging myself) - #158282 (slice_split_once: bounds check optimization note)
Rollup of 8 pull requests Successful merges: - #157960 (delegation: add support for infers in generics) - #158105 (Extract all instance shim variants into new `ShimKind` enum) - #158207 (Resolver: local/external split of `resolve_ident_in_module_non_globs_unadjusted` ) - #158222 (format: ignore println newline in foreign format hints) - #158252 (Use `cfg_select` in `std::os`) - #158257 ( fix escaping placeholder check in next solver normalization folder) - #158274 (triagebot: Stop pinging myself) - #158282 (slice_split_once: bounds check optimization note)
Extract all instance shim variants into new `ShimKind` enum They tend to have similar handling -- e.g., they should be the only input to the `mir_shims` query -- so it's cleaner to group them together. This will also make potential future refactorings easier, such as only carrying `GenericArgsRef` for instances that actually use it (e.g., `Item`) but not others (e.g., `CloneShim`). cc https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/moving.20ty.3A.3AInstance.2Eargs.20into.20ty.3A.3AInstanceKind.20variants r? @oli-obk
…uwer Rollup of 16 pull requests Successful merges: - #156885 (Fix misattributed type inference error span for index expressions) - #157271 (simplify some `proc_macro` things) - #157883 (Remove strict invariant node_type on hir_type during ty privacy visit) - #157921 (trait solver: Resolve region vars in max universe) - #157960 (delegation: add support for infers in generics) - #158105 (Extract all instance shim variants into new `ShimKind` enum) - #158207 (Resolver: local/external split of `resolve_ident_in_module_non_globs_unadjusted` ) - #158279 (Follow goto and drop when linting unreachable code) - #157807 (don't ice on non-lifetime binders under `-Zassumptions-on-binders`) - #158020 (Update mingw-w64 C toolchain) - #158222 (format: ignore println newline in foreign format hints) - #158223 (Move target checking for #[lang] to the attribute parser) - #158252 (Use `cfg_select` in `std::os`) - #158257 ( fix escaping placeholder check in next solver normalization folder) - #158274 (triagebot: Stop pinging myself) - #158282 (slice_split_once: bounds check optimization note) Failed merges: - #158256 (Avoid parser panics bubbling out to proc macros)
Extract all instance shim variants into new `ShimKind` enum They tend to have similar handling -- e.g., they should be the only input to the `mir_shims` query -- so it's cleaner to group them together. This will also make potential future refactorings easier, such as only carrying `GenericArgsRef` for instances that actually use it (e.g., `Item`) but not others (e.g., `CloneShim`). cc https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/moving.20ty.3A.3AInstance.2Eargs.20into.20ty.3A.3AInstanceKind.20variants r? @oli-obk
Extract all instance shim variants into new `ShimKind` enum They tend to have similar handling -- e.g., they should be the only input to the `mir_shims` query -- so it's cleaner to group them together. This will also make potential future refactorings easier, such as only carrying `GenericArgsRef` for instances that actually use it (e.g., `Item`) but not others (e.g., `CloneShim`). cc https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/moving.20ty.3A.3AInstance.2Eargs.20into.20ty.3A.3AInstanceKind.20variants r? @oli-obk
…uwer Rollup of 23 pull requests Successful merges: - #158315 (`rust-analyzer` subtree update) - #155739 (Add temporary scope to assert_eq and assert_ne) - #156885 (Fix misattributed type inference error span for index expressions) - #157271 (simplify some `proc_macro` things) - #157883 (Remove strict invariant node_type on hir_type during ty privacy visit) - #157921 (trait solver: Resolve region vars in max universe) - #157960 (delegation: add support for infers in generics) - #157983 (Lift the same-signature restriction for `extern "tail"`) - #158105 (Extract all instance shim variants into new `ShimKind` enum) - #158207 (Resolver: local/external split of `resolve_ident_in_module_non_globs_unadjusted` ) - #158279 (Follow goto and drop when linting unreachable code) - #157527 (Move derive tests into their dedicated folder) - #157807 (don't ice on non-lifetime binders under `-Zassumptions-on-binders`) - #158020 (Update mingw-w64 C toolchain) - #158222 (format: ignore println newline in foreign format hints) - #158223 (Move target checking for #[lang] to the attribute parser) - #158252 (Use `cfg_select` in `std::os`) - #158257 ( fix escaping placeholder check in next solver normalization folder) - #158263 (Only load the feature list once in the entire resolver) - #158274 (triagebot: Stop pinging myself) - #158282 (slice_split_once: bounds check optimization note) - #158300 (Improve unknown crate_type diagnostic suggestions) - #158304 (mailmap: update mu001999) Failed merges: - #158256 (Avoid parser panics bubbling out to proc macros)
Extract all instance shim variants into new `ShimKind` enum They tend to have similar handling -- e.g., they should be the only input to the `mir_shims` query -- so it's cleaner to group them together. This will also make potential future refactorings easier, such as only carrying `GenericArgsRef` for instances that actually use it (e.g., `Item`) but not others (e.g., `CloneShim`). cc https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/moving.20ty.3A.3AInstance.2Eargs.20into.20ty.3A.3AInstanceKind.20variants r? @oli-obk
Rollup of 27 pull requests Successful merges: - #158315 (`rust-analyzer` subtree update) - #155739 (Add temporary scope to assert_eq and assert_ne) - #156885 (Fix misattributed type inference error span for index expressions) - #157271 (simplify some `proc_macro` things) - #157883 (Remove strict invariant node_type on hir_type during ty privacy visit) - #157921 (trait solver: Resolve region vars in max universe) - #157960 (delegation: add support for infers in generics) - #157983 (Lift the same-signature restriction for `extern "tail"`) - #158053 (Optimize network address parser) - #158105 (Extract all instance shim variants into new `ShimKind` enum) - #158207 (Resolver: local/external split of `resolve_ident_in_module_non_globs_unadjusted` ) - #158279 (Follow goto and drop when linting unreachable code) - #157527 (Move derive tests into their dedicated folder) - #157807 (don't ice on non-lifetime binders under `-Zassumptions-on-binders`) - #158020 (Update mingw-w64 C toolchain) - #158039 (c-variadic: test that we use equality up to free lifetimes) - #158222 (format: ignore println newline in foreign format hints) - #158223 (Move target checking for #[lang] to the attribute parser) - #158252 (Use `cfg_select` in `std::os`) - #158257 ( fix escaping placeholder check in next solver normalization folder) - #158263 (Only load the feature list once in the entire resolver) - #158267 (FromUtf8Error::into_utf8_lossy better example and suggest use) - #158274 (triagebot: Stop pinging myself) - #158282 (slice_split_once: bounds check optimization note) - #158300 (Improve unknown crate_type diagnostic suggestions) - #158304 (mailmap: update mu001999) - #158309 (Update `rustc-literal-escaper` version to `0.0.8`) Failed merges: - #158256 (Avoid parser panics bubbling out to proc macros)
Extract all instance shim variants into new `ShimKind` enum They tend to have similar handling -- e.g., they should be the only input to the `mir_shims` query -- so it's cleaner to group them together. This will also make potential future refactorings easier, such as only carrying `GenericArgsRef` for instances that actually use it (e.g., `Item`) but not others (e.g., `CloneShim`). cc https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/moving.20ty.3A.3AInstance.2Eargs.20into.20ty.3A.3AInstanceKind.20variants r? @oli-obk
They tend to have similar handling -- e.g., they should be the only
input to the
mir_shimsquery -- so it's cleaner to group themtogether. This will also make potential future refactorings easier, such
as only carrying
GenericArgsReffor instances that actually use it(e.g.,
Item) but not others (e.g.,CloneShim).cc https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/moving.20ty.3A.3AInstance.2Eargs.20into.20ty.3A.3AInstanceKind.20variants
r? @oli-obk