From: Arthur Cohen <[email protected]>
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.
---
This change was merged into the gccrs repository and is posted here for
upstream visibility and potential drive-by review, as requested by GCC
release managers.
Each commit email contains a link to its details on github from where you can
find the Pull-Request and associated discussions.
Commit on github:
https://github.com/Rust-GCC/gccrs/commit/d2951e4c83ec26a05114ebee366ac508806043fa
The commit has NOT been mentioned in any issue.
The commit has been mentioned in the following pull-request(s):
- https://github.com/Rust-GCC/gccrs/pull/5035
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(-)
diff --git a/gcc/rust/typecheck/rust-hir-type-check-intrinsic.cc
b/gcc/rust/typecheck/rust-hir-type-check-intrinsic.cc
index 69424e053..882ba5deb 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 0387e9bee..1654f4e10 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() {
base-commit: 6c5c434d363898bce179377df1f020539d8ba068
--
2.56.0