Skip to content

Commit fed50a2

Browse files
Remove deprecated enum##member constants (pgcentralfoundation#2170)
This was added as a mercy in pgcentralfoundation#1748 to help migration but time is up: It has been over a year now.
1 parent c5fbaa4 commit fed50a2

1 file changed

Lines changed: 1 addition & 26 deletions

File tree

pgrx-bindgen/src/build.rs

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -835,33 +835,8 @@ fn run_bindgen(
835835
.wrap_static_fns_suffix("__pgrx_cshim")
836836
.generate()
837837
.wrap_err_with(|| format!("Unable to generate bindings for pg{major_version}"))?;
838-
let mut binding_str = bindings.to_string();
839-
drop(bindings); // So the Rc::into_inner can unwrap
840-
841-
// FIXME: do this for the Node graph instead of reparsing?
842-
let enum_names: EnumMap = Rc::into_inner(enum_names).unwrap().into_inner();
843-
binding_str.extend(enum_names.into_iter().flat_map(|(name, variants)| {
844-
const MIN_I32: i64 = i32::MIN as _;
845-
const MAX_I32: i64 = i32::MAX as _;
846-
const MAX_U32: u64 = u32::MAX as _;
847-
variants.into_iter().map(move |(variant, value)| {
848-
let (ty, value) = match value {
849-
EnumVariantValue::Boolean(b) => ("bool", b.to_string()),
850-
EnumVariantValue::Signed(v @ MIN_I32..=MAX_I32) => ("i32", v.to_string()),
851-
EnumVariantValue::Signed(v) => ("i64", v.to_string()),
852-
EnumVariantValue::Unsigned(v @ 0..=MAX_U32) => ("u32", v.to_string()),
853-
EnumVariantValue::Unsigned(v) => ("u64", v.to_string()),
854-
};
855-
format!(
856-
r#"
857-
#[deprecated(since = "0.12.0", note = "you want pg_sys::{module}::{variant}")]
858-
pub const {module}_{variant}: {ty} = {value};"#,
859-
module = &*name, // imprecise closure capture
860-
)
861-
})
862-
}));
863838

864-
Ok(binding_str)
839+
Ok(bindings.to_string())
865840
}
866841

867842
fn add_blocklists(bind: bindgen::Builder) -> bindgen::Builder {

0 commit comments

Comments
 (0)