Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion cc_bindings_from_rs/generate_bindings/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<rustc_data_structures::fingerprint::Fingerprint>()
.to_smaller_hash()
Expand Down
4 changes: 2 additions & 2 deletions cc_bindings_from_rs/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]",
Expand Down
Loading