Skip to content

Add hypothetical lifetime parameters and arguments to function signatures#1000

Merged
oinoom merged 19 commits into
masterfrom
feat.rewrite.fns
Aug 1, 2023
Merged

Add hypothetical lifetime parameters and arguments to function signatures#1000
oinoom merged 19 commits into
masterfrom
feat.rewrite.fns

Conversation

@oinoom
Copy link
Copy Markdown
Contributor

@oinoom oinoom commented Jul 19, 2023

Fixes #921 and fixes #927

Base automatically changed from feat.static.origins to master July 22, 2023 00:37
@oinoom oinoom force-pushed the feat.rewrite.fns branch 9 times, most recently from 108e7b4 to d22ee19 Compare July 27, 2023 20:57
@oinoom oinoom changed the title wip function hypothetical lifetimes Add hypothetical lifetime parameters and arguments to function signatures Jul 27, 2023
@oinoom oinoom force-pushed the feat.rewrite.fns branch from 2bbefc8 to 07e133e Compare July 28, 2023 23:10
@oinoom oinoom requested a review from spernsteiner July 28, 2023 23:11
@oinoom oinoom marked this pull request as ready for review July 28, 2023 23:11
Comment thread c2rust-analyze/src/labeled_ty.rs Outdated
// 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
Copy Markdown
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

Comment thread c2rust-analyze/tests/filecheck/clone1.rs
Comment thread c2rust-analyze/src/context.rs Outdated
Comment thread c2rust-analyze/src/context.rs Outdated
Comment thread c2rust-analyze/src/rewrite/ty.rs Outdated
@oinoom oinoom requested a review from spernsteiner July 31, 2023 23:42
@oinoom oinoom force-pushed the feat.rewrite.fns branch from b03f205 to 3297742 Compare July 31, 2023 23:44
Comment thread c2rust-analyze/src/rewrite/ty.rs Outdated
Comment thread c2rust-analyze/src/rewrite/ty.rs Outdated
Comment thread c2rust-analyze/src/rewrite/ty.rs Outdated
@oinoom oinoom requested a review from spernsteiner August 1, 2023 01:09
Copy link
Copy Markdown
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.

@oinoom oinoom force-pushed the feat.rewrite.fns branch from 4a07a01 to 1c39f40 Compare August 1, 2023 20:51
@oinoom oinoom merged commit 333d8ed into master Aug 1, 2023
@oinoom oinoom deleted the feat.rewrite.fns branch August 1, 2023 21:40
@oinoom oinoom 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

Development

Successfully merging this pull request may close these issues.

rewriter: struct type parameter rewrites swallow constraints rewriter: hypothetical lifetime parameters not added to types in function signatures

2 participants