Skip to content
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

Add hypothetical lifetime parameters and arguments to function signatures #1000

Merged
merged 19 commits into from
Aug 1, 2023

Conversation

aneksteind
Copy link
Contributor

@aneksteind aneksteind commented Jul 19, 2023

Fixes #921 and fixes #927

Base automatically changed from feat.static.origins to master July 22, 2023 00:37
@aneksteind aneksteind force-pushed the feat.rewrite.fns branch 9 times, most recently from 108e7b4 to d22ee19 Compare July 27, 2023 20:57
@aneksteind aneksteind changed the title wip function hypothetical lifetimes Add hypothetical lifetime parameters and arguments to function signatures Jul 27, 2023
@aneksteind aneksteind requested a review from spernsteiner July 28, 2023 23:11
@aneksteind aneksteind marked this pull request as ready for review July 28, 2023 23:11
@@ -61,9 +61,9 @@ struct HypoWrapper {

// CHECK-LABEL: final labeling for "_field_access"
// CHECK-DAG: ([[@LINE+3]]: ppd): addr_of = UNIQUE, type = READ | WRITE | UNIQUE
// CHECK-DAG: ([[@LINE+2]]: ra): &mut A
// CHECK-DAG: ([[@LINE+2]]: ra): &'d mut A<'d>
// CHECK-DAG: ([[@LINE+1]]: ppd): &mut &mut Data
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In another PR I'd like to add hypothetical params to this label

c2rust-analyze/src/context.rs Outdated Show resolved Hide resolved
c2rust-analyze/src/context.rs Outdated Show resolved Hide resolved
c2rust-analyze/src/rewrite/ty.rs Outdated Show resolved Hide resolved
@aneksteind aneksteind requested a review from spernsteiner August 1, 2023 01:09
Copy link
Collaborator

@spernsteiner spernsteiner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks about right to me.

Regarding the conflict: in #1005 (merged yesterday), I pulled the struct rewriting logic out of HirTyVisitor::visit_item to avoid O(N^2) behavior (each time we ran rewriting on a function, it also generated all struct rewrites) and give main.rs more control over what gets rewritten. You'll probably have to move the new gen_generics_rws calls out of visit_item as well.

@aneksteind aneksteind merged commit 333d8ed into master Aug 1, 2023
@aneksteind aneksteind deleted the feat.rewrite.fns branch August 1, 2023 21:40
@aneksteind aneksteind mentioned this pull request Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants