Skip to content

Conversation

@gottesmm
Copy link
Contributor

@gottesmm gottesmm commented Aug 2, 2023

This PR contains 3 commits that together ensure that if:

  1. The base value of an accessor is noncopyable.
  2. The return value of an accessor is noncopyable.

We properly nest the borrows. This has the affect of ensuring that /all/ cases in tree where we emit copy of noncopyable error due to us emitting the base incorrectly as an rvalue (causing us to emit copies since the lifetime ends early) are eliminated.

It of course handles corourtines/etc correctly as well.

gottesmm added 3 commits July 27, 2023 10:00
…types.

We want these to be borrowed in most cases and to create an appropriate onion
wrapping. Since we are doing this in more cases now, we fix a bunch of cases
where we used to be forced to insert a copy since a coroutine or access would
end too early.
…n-tuple.

This prevents another type of copy of noncopyable value error.

I also as a small change, changed the tuple version to use a formal access
temporary since we are projecting a component out implying that the lifetime of
the temporary must end within the formal access. Otherwise, we cause the
lifetime of the temporary to outlive the access. This can be seen in the change
to read_accessor.swift where we used to extend the lifetime of the destroy_addr
outside of the coroutine access we are performing.
… borrowing.

Also, the store_borrow work in the previous patch caused some additional issues
to crop up. I fixed them in this PR and added some tests in the process.
@gottesmm gottesmm requested a review from jckarter August 2, 2023 18:19
@gottesmm
Copy link
Contributor Author

gottesmm commented Aug 2, 2023

@swift-ci test

1 similar comment
@gottesmm
Copy link
Contributor Author

gottesmm commented Aug 2, 2023

@swift-ci test

@gottesmm
Copy link
Contributor Author

gottesmm commented Aug 2, 2023

@swift-ci test macOS platform

@gottesmm
Copy link
Contributor Author

gottesmm commented Aug 2, 2023

@swift-ci test

@gottesmm gottesmm merged commit c9be4bd into swiftlang:main Aug 4, 2023
@gottesmm gottesmm deleted the borrowed-base-silgenlvalue branch August 4, 2023 19:26
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