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

[Test] Add lifetime marker to make error message consistent. #1963

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
[Test] Add lifetime marker to make error message consistent.
This patch adds a lifetime marker to TableIterator to make error message
consistent between different versions of rustc.
higuoxing committed Dec 23, 2024
commit 4471b13cabec7ed72ae0321f9e8f162d5357dbf1
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@ use pgrx::prelude::*;
#[pg_extern]
fn returns_tuple_with_lifetime(
value: &'static str,
) -> TableIterator<(name!(a, &'static str), name!(b, Option<&'static str>))> {
) -> TableIterator<'static, (name!(a, &'static str), name!(b, Option<&'static str>))> {
TableIterator::once((value, Some(value)))
}

Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
error[E0521]: borrowed data escapes outside of function
--> tests/compile-fail/table-iterators-arent-immortal.rs:6:78
--> tests/compile-fail/table-iterators-arent-immortal.rs:6:87
|
3 | #[pg_extern]
| ------------
| |
| lifetime `'fcx` defined here
| in this procedural macro expansion
...
6 | ) -> TableIterator<(name!(a, &'static str), name!(b, Option<&'static str>))> {
| ______________________________________________________________________________^
6 | ) -> TableIterator<'static, (name!(a, &'static str), name!(b, Option<&'static str>))> {
| _______________________________________________________________________________________^
7 | | TableIterator::once((value, Some(value)))
8 | | }
| | ^