-
-
Notifications
You must be signed in to change notification settings - Fork 249
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
Weaken bounds on Array impls #1355
Weaken bounds on Array impls #1355
Conversation
This weakens the bounds on various implementations for Array. It's utterly useless because you still can't construct such an array.
pgrx/src/datum/into.rs
Outdated
fn array_type_oid() -> pg_sys::Oid { | ||
unsafe { pg_sys::get_array_type(Self::type_oid()) } | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is technically a breaking change.
Actually, I think I'll separate that out. |
c74010e
to
cca0bc2
Compare
let Array { raw, .. } = self; | ||
// Wrap the Toast<RawArray> to prevent it from deallocating itself | ||
let mut raw = core::mem::ManuallyDrop::new(raw); | ||
let ptr = raw.deref_mut().deref_mut() as *mut RawArray; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you didn't add this, but lol.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🙈
This does more cleanup in the vein of weakening needless bounds. - #1355 The "main point" is some no-op "make clippy happy" refactoring. This permits running `cargo clippy` without getting *errors* (it still issues literally hundreds of warnings) on most of the repository's crates. It does not solve this for `pgrx` itself, as clippy detected a more serious issue there, and that issue is instead its own PR: - #1357
Weaken the bounds on various implementations for Array, to make things easier to refactor. In that vein, clean up a function from on IntoDatum that can be inside Array's IntoDatum impl.
This weakening is mostly irrelevant because you still can't construct such an Array.