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

Weaken bounds on Array impls #1355

Merged

Conversation

workingjubilee
Copy link
Member

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.

This weakens the bounds on various implementations for Array.
It's utterly useless because you still can't construct such an array.
Comment on lines 37 to 39
fn array_type_oid() -> pg_sys::Oid {
unsafe { pg_sys::get_array_type(Self::type_oid()) }
}
Copy link
Member Author

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.

@workingjubilee
Copy link
Member Author

Actually, I think I'll separate that out.

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;
Copy link
Contributor

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙈

@workingjubilee workingjubilee merged commit a9e3b14 into pgcentralfoundation:develop Oct 27, 2023
9 checks passed
@workingjubilee workingjubilee deleted the weaken-array-bounds branch October 27, 2023 23:21
workingjubilee added a commit that referenced this pull request Oct 28, 2023
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
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