Skip to content

Commit d1f5099

Browse files
committed
fix ci on beta rust
1 parent c0de15d commit d1f5099

13 files changed

Lines changed: 25 additions & 29 deletions

File tree

cargo-pgrx/src/command/info.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ impl CommandExecute for Info {
7878
}
7979
}
8080

81-
fn version(ver: &str) -> Cow<str> {
81+
fn version(ver: &str) -> Cow<'_, str> {
8282
if ver.starts_with("pg") {
8383
Cow::Borrowed(ver)
8484
} else {

cargo-pgrx/src/command/schema.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,7 @@ fn compute_sql(package_name: &str, manifest: &Manifest) -> eyre::Result<()> {
594594
Ok(())
595595
}
596596

597-
fn parse_object(data: &[u8]) -> object::Result<object::File> {
597+
fn parse_object(data: &[u8]) -> object::Result<object::File<'_>> {
598598
let kind = object::FileKind::parse(data)?;
599599

600600
match kind {

pgrx-macros/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -967,7 +967,7 @@ fn impl_postgres_type(ast: DeriveInput) -> syn::Result<proc_macro2::TokenStream>
967967
#[::pgrx::pgrx_macros::pg_extern(immutable,parallel_safe)]
968968
pub fn #funcname_in #generics(input: Option<&::core::ffi::CStr>) -> Option<#name #generics> {
969969
input.map_or_else(|| {
970-
for m in <#name as ::pgrx::inoutfuncs::InOutFuncs>::NULL_ERROR_MESSAGE {
970+
if let Some(m) = <#name as ::pgrx::inoutfuncs::InOutFuncs>::NULL_ERROR_MESSAGE {
971971
::pgrx::pg_sys::error!("{m}");
972972
}
973973
None
@@ -990,7 +990,7 @@ fn impl_postgres_type(ast: DeriveInput) -> syn::Result<proc_macro2::TokenStream>
990990
#[::pgrx::pgrx_macros::pg_extern(immutable,parallel_safe)]
991991
pub fn #funcname_in #generics(input: Option<&::core::ffi::CStr>) -> Option<::pgrx::datum::PgVarlena<#name #generics>> {
992992
input.map_or_else(|| {
993-
for m in <#name as ::pgrx::inoutfuncs::PgVarlenaInOutFuncs>::NULL_ERROR_MESSAGE {
993+
if let Some(m) = <#name as ::pgrx::inoutfuncs::PgVarlenaInOutFuncs>::NULL_ERROR_MESSAGE {
994994
::pgrx::pg_sys::error!("{m}");
995995
}
996996
None

pgrx-pg-sys/src/include.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#[cfg(all(feature = "pg13", not(docsrs)))]
66
pub(crate) mod pg13 {
77
#![allow(clippy::all)]
8+
#![allow(unnecessary_transmutes)]
89
include!(concat!(env!("OUT_DIR"), "/pg13.rs"));
910
}
1011
#[cfg(all(feature = "pg13", docsrs))]
@@ -13,6 +14,7 @@ pub(crate) mod pg13;
1314
#[cfg(all(feature = "pg14", not(docsrs)))]
1415
pub(crate) mod pg14 {
1516
#![allow(clippy::all)]
17+
#![allow(unnecessary_transmutes)]
1618
include!(concat!(env!("OUT_DIR"), "/pg14.rs"));
1719
}
1820
#[cfg(all(feature = "pg14", docsrs))]
@@ -21,6 +23,7 @@ pub(crate) mod pg14;
2123
#[cfg(all(feature = "pg15", not(docsrs)))]
2224
pub(crate) mod pg15 {
2325
#![allow(clippy::all)]
26+
#![allow(unnecessary_transmutes)]
2427
include!(concat!(env!("OUT_DIR"), "/pg15.rs"));
2528
}
2629
#[cfg(all(feature = "pg15", docsrs))]
@@ -29,6 +32,7 @@ pub(crate) mod pg15;
2932
#[cfg(all(feature = "pg16", not(docsrs)))]
3033
pub(crate) mod pg16 {
3134
#![allow(clippy::all)]
35+
#![allow(unnecessary_transmutes)]
3236
include!(concat!(env!("OUT_DIR"), "/pg16.rs"));
3337
}
3438
#[cfg(all(feature = "pg16", docsrs))]
@@ -37,6 +41,7 @@ pub(crate) mod pg16;
3741
#[cfg(all(feature = "pg17", not(docsrs)))]
3842
pub(crate) mod pg17 {
3943
#![allow(clippy::all)]
44+
#![allow(unnecessary_transmutes)]
4045
include!(concat!(env!("OUT_DIR"), "/pg17.rs"));
4146
}
4247
#[cfg(all(feature = "pg17", docsrs))]
@@ -45,6 +50,7 @@ pub(crate) mod pg17;
4550
#[cfg(all(feature = "pg18", not(docsrs)))]
4651
pub(crate) mod pg18 {
4752
#![allow(clippy::all)]
53+
#![allow(unnecessary_transmutes)]
4854
include!(concat!(env!("OUT_DIR"), "/pg18.rs"));
4955
}
5056
#[cfg(all(feature = "pg18", docsrs))]

pgrx-tests/src/tests/trigger_tests.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,9 @@ mod tests {
7474
}
7575

7676
#[pg_trigger]
77-
fn signature_aliased_both(_trigger: AliasedBorrowedPgTrigger) -> AliasedTriggerResult<'_> {
77+
fn signature_aliased_both(
78+
_trigger: AliasedBorrowedPgTrigger<'_>,
79+
) -> AliasedTriggerResult<'_> {
7880
unimplemented!("Only testing signature compiles")
7981
}
8082
}

pgrx-tests/tests/compile-fail/table-iterators-arent-immortal.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use pgrx::prelude::*;
33
#[pg_extern]
44
fn returns_tuple_with_lifetime(
55
value: &'static str,
6-
) -> TableIterator<(name!(a, &'static str), name!(b, Option<&'static str>))> {
6+
) -> TableIterator<'static, (name!(a, &'static str), name!(b, Option<&'static str>))> {
77
TableIterator::once((value, Some(value)))
88
}
99

pgrx-tests/tests/compile-fail/table-iterators-arent-immortal.stderr

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,14 @@
1-
warning: elided lifetime has a name
2-
--> tests/compile-fail/table-iterators-arent-immortal.rs:6:19
3-
|
4-
6 | ) -> TableIterator<(name!(a, &'static str), name!(b, Option<&'static str>))> {
5-
| ^ this elided lifetime gets resolved as `'static`
6-
|
7-
= note: `#[warn(elided_named_lifetimes)]` on by default
8-
help: consider specifying it explicitly
9-
|
10-
6 | ) -> TableIterator<'static, (name!(a, &'static str), name!(b, Option<&'static str>))> {
11-
| ++++++++
12-
131
error[E0521]: borrowed data escapes outside of function
14-
--> tests/compile-fail/table-iterators-arent-immortal.rs:6:78
2+
--> tests/compile-fail/table-iterators-arent-immortal.rs:6:87
153
|
164
3 | #[pg_extern]
175
| ------------
186
| |
197
| lifetime `'fcx` defined here
208
| in this procedural macro expansion
219
...
22-
6 | ) -> TableIterator<(name!(a, &'static str), name!(b, Option<&'static str>))> {
23-
| ______________________________________________________________________________^
10+
6 | ) -> TableIterator<'static, (name!(a, &'static str), name!(b, Option<&'static str>))> {
11+
| _______________________________________________________________________________________^
2412
7 | | TableIterator::once((value, Some(value)))
2513
8 | | }
2614
| | ^

pgrx/src/datum/into.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ impl<'a> IntoDatum for &'a [u8] {
378378
// and the `dest` was freshly allocated, thus non-overlapping
379379
std::ptr::copy_nonoverlapping(
380380
self.as_ptr(),
381-
addr_of_mut!((*varattrib_4b).va_data).cast::<u8>(),
381+
addr_of_mut!((&mut *varattrib_4b).va_data).cast::<u8>(),
382382
self.len(),
383383
);
384384

pgrx/src/fn_call.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ fn lookup_fn(fname: &str, args: &[&dyn FnCallArg]) -> Result<pg_sys::Oid> {
410410

411411
/// Parses an arbitrary string as if it is a SQL identifier. If it's not, [`FnCallError::InvalidIdentifier`]
412412
/// is returned
413-
fn parse_sql_ident(ident: &str) -> Result<Array<&str>> {
413+
fn parse_sql_ident(ident: &str) -> Result<Array<'_, &str>> {
414414
unsafe {
415415
direct_function_call::<Array<&str>>(
416416
pg_sys::parse_ident,

pgrx/src/lwlock.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ impl<T> PgLwLock<T> {
5151
}
5252

5353
/// Obtain a shared lock (which comes with `&T` access)
54-
pub fn share(&self) -> PgLwLockShareGuard<T> {
54+
pub fn share(&self) -> PgLwLockShareGuard<'_, T> {
5555
unsafe {
5656
let shared = self.inner.get().read().as_ref().expect("PgLwLock was not initialized");
5757
pg_sys::LWLockAcquire((*shared).lock_ptr, pg_sys::LWLockMode::LW_SHARED);
@@ -60,7 +60,7 @@ impl<T> PgLwLock<T> {
6060
}
6161

6262
/// Obtain an exclusive lock (which comes with `&mut T` access)
63-
pub fn exclusive(&self) -> PgLwLockExclusiveGuard<T> {
63+
pub fn exclusive(&self) -> PgLwLockExclusiveGuard<'_, T> {
6464
unsafe {
6565
let shared = self.inner.get().read().as_ref().expect("PgLwLock was not initialized");
6666
pg_sys::LWLockAcquire((*shared).lock_ptr, pg_sys::LWLockMode::LW_EXCLUSIVE);

0 commit comments

Comments
 (0)