-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Check that the ABI of the instance we are inlining is correct #120944
Conversation
Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt |
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
Check that the ABI of the instance we are inlining is correct When computing the `CallSite` in the mir inliner, double check that the instance of the function that we are inlining is compatible with the signature from the trait definition that we acquire from the MIR. Fixes rust-lang#120940 r? `@oli-obk` or `@cjgillot`
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (0e5e3ae): comparison URL. Overall result: no relevant changes - no action neededBenchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf. @bors rollup=never Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 663.621s -> 663.575s (-0.01%) |
@bors r+ rollup |
// Additionally, check that the body that we're inlining actually agrees | ||
// with the ABI of the trait that the item comes from. | ||
if let InstanceDef::Item(instance_def_id) = callee.def | ||
&& self.tcx.def_kind(instance_def_id) == DefKind::AssocFn | ||
&& let instance_fn_sig = self.tcx.fn_sig(instance_def_id).skip_binder() | ||
&& instance_fn_sig.abi() != fn_sig.abi() | ||
{ | ||
return None; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could probably check that errors have been reported, but 🤷
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought we wanted to avoid depending on global state?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
still figuring out the exact details on that. But we can probably invoke the wfcheck query responsible for this 😆 not really necessary tho.
…-obk Check that the ABI of the instance we are inlining is correct When computing the `CallSite` in the mir inliner, double check that the instance of the function that we are inlining is compatible with the signature from the trait definition that we acquire from the MIR. Fixes rust-lang#120940 r? `@oli-obk` or `@cjgillot`
…iaskrgr Rollup of 11 pull requests Successful merges: - rust-lang#120765 (Reorder diagnostics API) - rust-lang#120833 (More internal emit diagnostics cleanups) - rust-lang#120899 (Gracefully handle non-WF alias in `assemble_alias_bound_candidates_recur`) - rust-lang#120917 (Remove a bunch of dead parameters in functions) - rust-lang#120928 (Add test for recently fixed issue) - rust-lang#120933 (check_consts: fix duplicate errors, make importance consistent) - rust-lang#120936 (improve `btree_cursors` functions documentation) - rust-lang#120944 (Check that the ABI of the instance we are inlining is correct) - rust-lang#120956 (Clean inlined type alias with correct param-env) - rust-lang#120962 (Add myself to library/std review) - rust-lang#120972 (fix ICE for deref coercions with type errors) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#120944 - compiler-errors:inliner-abi, r=oli-obk Check that the ABI of the instance we are inlining is correct When computing the `CallSite` in the mir inliner, double check that the instance of the function that we are inlining is compatible with the signature from the trait definition that we acquire from the MIR. Fixes rust-lang#120940 r? ``@oli-obk`` or ``@cjgillot``
…iaskrgr Rollup of 11 pull requests Successful merges: - rust-lang#120765 (Reorder diagnostics API) - rust-lang#120833 (More internal emit diagnostics cleanups) - rust-lang#120899 (Gracefully handle non-WF alias in `assemble_alias_bound_candidates_recur`) - rust-lang#120917 (Remove a bunch of dead parameters in functions) - rust-lang#120928 (Add test for recently fixed issue) - rust-lang#120933 (check_consts: fix duplicate errors, make importance consistent) - rust-lang#120936 (improve `btree_cursors` functions documentation) - rust-lang#120944 (Check that the ABI of the instance we are inlining is correct) - rust-lang#120956 (Clean inlined type alias with correct param-env) - rust-lang#120962 (Add myself to library/std review) - rust-lang#120972 (fix ICE for deref coercions with type errors) r? `@ghost` `@rustbot` modify labels: rollup
When computing the
CallSite
in the mir inliner, double check that the instance of the function that we are inlining is compatible with the signature from the trait definition that we acquire from the MIR.Fixes #120940
r? @oli-obk or @cjgillot