-
Notifications
You must be signed in to change notification settings - Fork 13k
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 generic argument compatibility when projecting assoc ty #102488
Conversation
r? @oli-obk (rust-highfive has picked a reviewer for you, use r? to override) |
@bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit ee713f3 with merge 09ce9c766f77b0361214b3db82b0b1d18e258ca3... |
if let Some(parent) = generics.parent | ||
&& let parent_generics = tcx.generics_of(parent) | ||
&& !check_substs_compatible_inner(tcx, parent_generics, parent_args) { | ||
return false; |
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.
TIL githubs highlighting does not support let-chains 😆
☀️ Try build successful - checks-actions |
Queued 09ce9c766f77b0361214b3db82b0b1d18e258ca3 with parent 9f1a21a, future comparison URL. |
Finished benchmarking commit (09ce9c766f77b0361214b3db82b0b1d18e258ca3): 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.
CyclesResultsThis 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.
Footnotes |
@bors r+ rollup |
…iaskrgr Rollup of 6 pull requests Successful merges: - rust-lang#102241 (Package `rust-docs-json` into nightly components (take 3)) - rust-lang#102488 (Check generic argument compatibility when projecting assoc ty) - rust-lang#102647 (Only allow ~const bounds for traits with #[const_trait]) - rust-lang#102648 (Add test for rust-lang#102605) - rust-lang#102651 (It's not about types or consts, but the lack of regions) - rust-lang#102653 (resolve instance: missing value to `delay_span_bug`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Make sure that args are compatible in `resolve_associated_item` Implements a similar check to the one that we have in projection for GATs (rust-lang#102488, rust-lang#123240), where we check that the args of an impl item are compatible before returning it. This is done in `resolve_assoc_item`, which is backing `Instance::resolve`, so this is conceptually generalizing the check from GATs to methods/assoc consts. This is important to make sure that the inliner will only visit and substitute MIR bodies that are compatible w/ their trait definitions. This shouldn't happen in codegen, but there are a few ways to get the inliner to be invoked (via calls to `optimized_mir`) before codegen, namely polymorphization and CTFE. Fixes rust-lang#121957 Fixes rust-lang#120792 Fixes rust-lang#120793 Fixes rust-lang#121063
Fixes #102114