-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Don't drop parent substs when we have no generic parameters in create_substs_for_ast_path
#100865
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
r? @jackh726 (rust-highfive has picked a reviewer for you, use r? to override) |
@bors r+ |
☀️ Test successful - checks-actions |
Finished benchmarking commit (4652f5e): comparison URL. Overall result: ✅ improvements - no action needed@rustbot label: -perf-regression Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
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 |
…n-assoc-ty-binding, r=cjgillot Deny associated type bindings within associated type bindings Fixes rust-lang#102335 This was made worse by rust-lang#100865, which unified the way we generate substs for GATs and non-generic associated types. However, the issue was not _caused_ by rust-lang#100865, evidenced by the test I added for GATs: ```rust trait T { type A: S<C<(), i32 = ()> = ()>; //~^ ERROR associated type bindings are not allowed here } trait Q {} trait S { type C<T>: Q; } fn main() {} ``` ^ which passes on beta (where GATs are stable) and presumably ever since GATs support was added to `create_substs_for_associated_item` in astconv.
…n-assoc-ty-binding, r=cjgillot Deny associated type bindings within associated type bindings Fixes rust-lang#102335 This was made worse by rust-lang#100865, which unified the way we generate substs for GATs and non-generic associated types. However, the issue was not _caused_ by rust-lang#100865, evidenced by the test I added for GATs: ```rust trait T { type A: S<C<(), i32 = ()> = ()>; //~^ ERROR associated type bindings are not allowed here } trait Q {} trait S { type C<T>: Q; } fn main() {} ``` ^ which passes on beta (where GATs are stable) and presumably ever since GATs support was added to `create_substs_for_associated_item` in astconv.
This bug is being shadowed by an explicit check for
generics.params.is_empty()
in the only parent caller that could trigger it (create_substs_for_associated_item
). I triggered it on another branch where I'm messing around with astconv stuff.Also, the second commit simplifies
create_substs_for_associated_item
. Removing that explicit check I mentioned above^ and also the special case call toAstconv::prohibit_generics
causes the UI testsrc/test/ui/structs/struct-path-associated-type.stderr
to change, but I think that it's clearer now. The suggestion to remove the generics is actually useful.