Skip to content

Commit 95834ce

Browse files
committed
remove pref_align_of intrinsic handling, rename {min_=>}align_of{,_val}
1 parent 8715e6f commit 95834ce

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

crates/hir-ty/src/consteval/tests/intrinsics.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -112,28 +112,28 @@ fn size_of_val() {
112112
}
113113

114114
#[test]
115-
fn min_align_of_val() {
115+
fn align_of_val() {
116116
check_number(
117117
r#"
118118
//- minicore: coerce_unsized
119119
#[rustc_intrinsic]
120-
pub fn min_align_of_val<T: ?Sized>(_: *const T) -> usize;
120+
pub fn align_of_val<T: ?Sized>(_: *const T) -> usize;
121121
122122
struct X(i32, u8);
123123
124-
const GOAL: usize = min_align_of_val(&X(1, 2));
124+
const GOAL: usize = align_of_val(&X(1, 2));
125125
"#,
126126
4,
127127
);
128128
check_number(
129129
r#"
130130
//- minicore: coerce_unsized
131131
#[rustc_intrinsic]
132-
pub fn min_align_of_val<T: ?Sized>(_: *const T) -> usize;
132+
pub fn align_of_val<T: ?Sized>(_: *const T) -> usize;
133133
134134
const GOAL: usize = {
135135
let x: &[i32] = &[1, 2, 3];
136-
min_align_of_val(x)
136+
align_of_val(x)
137137
};
138138
"#,
139139
4,

crates/hir-ty/src/mir/eval/shim.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -761,7 +761,7 @@ impl Evaluator<'_> {
761761
let size = self.size_of_sized(ty, locals, "size_of arg")?;
762762
destination.write_from_bytes(self, &size.to_le_bytes()[0..destination.size])
763763
}
764-
"min_align_of" | "pref_align_of" => {
764+
"align_of" => {
765765
let Some(ty) =
766766
generic_args.as_slice(Interner).first().and_then(|it| it.ty(Interner))
767767
else {
@@ -793,17 +793,17 @@ impl Evaluator<'_> {
793793
destination.write_from_bytes(self, &size.to_le_bytes())
794794
}
795795
}
796-
"min_align_of_val" => {
796+
"align_of_val" => {
797797
let Some(ty) =
798798
generic_args.as_slice(Interner).first().and_then(|it| it.ty(Interner))
799799
else {
800800
return Err(MirEvalError::InternalError(
801-
"min_align_of_val generic arg is not provided".into(),
801+
"align_of_val generic arg is not provided".into(),
802802
));
803803
};
804804
let [arg] = args else {
805805
return Err(MirEvalError::InternalError(
806-
"min_align_of_val args are not provided".into(),
806+
"align_of_val args are not provided".into(),
807807
));
808808
};
809809
if let Some((_, align)) = self.size_align_of(ty, locals)? {

0 commit comments

Comments
 (0)