| Message ID | 20261104111607.3871038-2-dkm+gcc@kataplop.net |
|---|---|
| State | New |
| Headers | show |
| Series | Upstreaming changes from Oct 29th to Nov 3rd | expand |
diff --git a/gcc/rust/typecheck/rust-hir-type-check-intrinsic.cc b/gcc/rust/typecheck/rust-hir-type-check-intrinsic.cc index 69424e053ce..882ba5debf6 100644 --- a/gcc/rust/typecheck/rust-hir-type-check-intrinsic.cc +++ b/gcc/rust/typecheck/rust-hir-type-check-intrinsic.cc @@ -315,8 +315,8 @@ const std::unordered_map<std::string, IntrinsicRules> // fn breakpoint() {IValue::BREAKPOINT, {0, {}, IRT::Unit}}, - // fn pref_align_of<T>() - {IValue::PREF_ALIGN_OF, {1, {}, IRT::Unit}}, + // fn pref_align_of<T>() -> usize + {IValue::PREF_ALIGN_OF, {1, {}, IRT::Usize}}, // pub fn assert_zero_valid<T>(); {IValue::ASSERT_ZERO_VALID, {1, {}, IRT::Unit}}, diff --git a/gcc/testsuite/rust/compile/pref_align_of.rs b/gcc/testsuite/rust/compile/pref_align_of.rs index 0387e9beed5..1654f4e10f7 100644 --- a/gcc/testsuite/rust/compile/pref_align_of.rs +++ b/gcc/testsuite/rust/compile/pref_align_of.rs @@ -7,7 +7,7 @@ trait Sized {} extern "rust-intrinsic" { - fn pref_align_of<T>(); + fn pref_align_of<T>() -> usize; } fn foo() {
From: Arthur Cohen <arthur.cohen@opensrcsec.com> gcc/rust/ChangeLog: * typecheck/rust-hir-type-check-intrinsic.cc: Make it return a usize instead of a unit type. gcc/testsuite/ChangeLog: * rust/compile/pref_align_of.rs: Likewise. Tested on x86_64-pc-linux-gnu. --- gcc/rust/typecheck/rust-hir-type-check-intrinsic.cc | 4 ++-- gcc/testsuite/rust/compile/pref_align_of.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)