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

Lifetimes mentioned in return type also matter #48

Merged
merged 1 commit into from
Feb 7, 2025

Conversation

spastorino
Copy link
Owner

@tmandry
Copy link
Collaborator

tmandry commented Feb 7, 2025

'dynosaur is meant to be the intersection of all input lifetimes. So I don't think we should include lifetimes in the return type. Instead I think we should treat trait lifetime params as input parameters in all cases.

In other words if there is a trait SomeTrait<'a, 'b> {}, there should always be 'a: 'dynosaur, 'b: 'dynosaur bounds.

The output of this particular test should remain the same.

@spastorino spastorino force-pushed the properly-handle-trait-lifetimes branch from 6902953 to 549f962 Compare February 7, 2025 01:29
a: &'d u32,
b: &'e u32,
c: &'f u32,
) -> (&'a u32, &'b u32)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Actually, just return &'a u32 so the most recent change is load bearing

@spastorino spastorino force-pushed the properly-handle-trait-lifetimes branch from 549f962 to 4ba5da0 Compare February 7, 2025 01:39
@tmandry tmandry merged commit c14a47e into main Feb 7, 2025
1 check passed
@tmandry tmandry deleted the properly-handle-trait-lifetimes branch February 7, 2025 01:59
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.

2 participants