diff --git a/cc_bindings_from_rs/generate_bindings/lib.rs b/cc_bindings_from_rs/generate_bindings/lib.rs index fd37b51c0..eba93f37c 100644 --- a/cc_bindings_from_rs/generate_bindings/lib.rs +++ b/cc_bindings_from_rs/generate_bindings/lib.rs @@ -1905,11 +1905,22 @@ impl NodeSortKey { TemplateSpecialization::RsStdEnum(e) => { let ty = e.core.self_ty_rs; - use rustc_data_structures::stable_hasher::{HashStable, StableHasher}; + use rustc_data_structures::stable_hasher::StableHasher; + // Old name up to nightly 2026-05-02. + #[cfg_accessible(rustc_data_structures::stable_hasher::HashStable)] + use rustc_data_structures::stable_hasher::HashStable; + // New name since nightly 2026-05-03. + #[cfg_accessible(rustc_data_structures::stable_hasher::StableHash)] + use rustc_data_structures::stable_hasher::StableHash; let hash = tcx.with_stable_hashing_context(|mut hcx| { let mut hasher = StableHasher::new(); + // Old name up to nightly 2026-05-02. + #[cfg_accessible(rustc_data_structures::stable_hasher::HashStable)] ty.hash_stable(&mut hcx, &mut hasher); + // New name since nightly 2026-05-03. + #[cfg_accessible(rustc_data_structures::stable_hasher::StableHash)] + ty.stable_hash(&mut hcx, &mut hasher); hasher .finish::() .to_smaller_hash() diff --git a/cc_bindings_from_rs/lib.rs b/cc_bindings_from_rs/lib.rs index 624eda9e2..e49fae601 100644 --- a/cc_bindings_from_rs/lib.rs +++ b/cc_bindings_from_rs/lib.rs @@ -234,10 +234,10 @@ fn run_with_rmetas(cmdline: &Cmdline) -> Result<()> { // bindings for it and we'll generate the relevant error below. return Ok(()); }; - if rustc_hir::find_attr!(tcx, cnum.as_def_id(), AttributeKind::NoStd(_)) { + if rustc_hir::find_attr!(tcx, cnum.as_def_id(), AttributeKind::NoStd { .. }) { crate_attrs.push("#![no_std]"); } - if rustc_hir::find_attr!(tcx, cnum.as_def_id(), AttributeKind::NoCore(_)) { + if rustc_hir::find_attr!(tcx, cnum.as_def_id(), AttributeKind::NoCore { .. }) { crate_attrs.extend([ "#![allow(internal_features)]", "#![feature(no_core)]",