Skip to content

Commit

Permalink
Address elided lifetimes lints (#1861)
Browse files Browse the repository at this point in the history
Not writing a lifetime in these positions triggers some recent nightly
lints. Seems harmless to just fix them.
  • Loading branch information
workingjubilee authored Sep 14, 2024
1 parent 729e70f commit 4bb1ccc
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pgrx-bindgen/src/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@ impl<'a> From<&'a [syn::Item]> for StructGraph<'a> {

impl<'a> StructDescriptor<'a> {
/// children returns an iterator over the children of this node in the graph
fn children(&'a self, graph: &'a StructGraph) -> StructDescriptorChildren {
fn children(&'a self, graph: &'a StructGraph) -> StructDescriptorChildren<'a> {
StructDescriptorChildren { offset: 0, descriptor: self, graph }
}
}
Expand Down
4 changes: 2 additions & 2 deletions pgrx-tests/src/tests/lifetime_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ fn returns_option_ref_with_lifetime() -> Option<&'static str> {
#[pg_extern]
fn returns_tuple_with_lifetime<'a>(
value: &'a str,
) -> TableIterator<(name!(a, &'a str), name!(b, Option<&'a str>))> {
) -> TableIterator<'a, (name!(a, &'a str), name!(b, Option<&'a str>))> {
TableIterator::once((value, Some(value)))
}

#[pg_extern]
fn returns_iterator_with_lifetime<'a>(value: &'a str) -> SetOfIterator<&'a str> {
fn returns_iterator_with_lifetime<'a>(value: &'a str) -> SetOfIterator<'a, &'a str> {
SetOfIterator::new(value.split_whitespace().into_iter())
}
2 changes: 1 addition & 1 deletion pgrx-tests/src/tests/trigger_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ mod tests {
#[pg_trigger]
fn field_species_fox_to_bear<'a>(
trigger: &'a pgrx::PgTrigger<'a>,
) -> Result<Option<PgHeapTuple<'_, impl WhoAllocated>>, TriggerError> {
) -> Result<Option<PgHeapTuple<'a, impl WhoAllocated>>, TriggerError> {
let mut new = trigger.new().ok_or(TriggerError::NullTriggerTuple)?.into_owned();

let field = "species";
Expand Down
2 changes: 1 addition & 1 deletion pgrx/src/datum/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ impl<'mcx, T: UnboxDatum> NullableContainer<'mcx, usize, <T as unbox::UnboxDatum
}

#[inline]
unsafe fn get_raw(&'mcx self, idx: usize) -> <T as unbox::UnboxDatum>::As<'_> {
unsafe fn get_raw(&'mcx self, idx: usize) -> <T as unbox::UnboxDatum>::As<'mcx> {
self.get_strict_inner(idx).expect(
"get_raw() called with an invalid index, bounds-checking\
*should* occur before calling this method.",
Expand Down

0 comments on commit 4bb1ccc

Please sign in to comment.