diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2024-04-23 20:17:51 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-04-23 20:17:51 +0200 |
| commit | 79d217fcf1d6b9ebc7b847aa01c7a816767ff64b (patch) | |
| tree | 40f943a7f5679227557f638769b3c5f06321a101 /example | |
| parent | 224285d9fcd48bf3703d7ed1e895c8c6353747a0 (diff) | |
| parent | dd50f454c8090c65ee6c551facf8d3dbf0de79c9 (diff) | |
| download | rust-79d217fcf1d6b9ebc7b847aa01c7a816767ff64b.tar.gz rust-79d217fcf1d6b9ebc7b847aa01c7a816767ff64b.zip | |
Rollup merge of #124003 - WaffleLapkin:dellvmization, r=scottmcm,RalfJung,antoyo
Dellvmize some intrinsics (use `u32` instead of `Self` in some integer intrinsics) This implements https://github.com/rust-lang/compiler-team/issues/693 minus what was implemented in #123226. Note: I decided to _not_ change `shl`/... builder methods, as it just doesn't seem worth it. r? ``@scottmcm``
Diffstat (limited to 'example')
| -rw-r--r-- | example/example.rs | 7 | ||||
| -rw-r--r-- | example/mini_core.rs | 2 |
2 files changed, 5 insertions, 4 deletions
diff --git a/example/example.rs b/example/example.rs index 5878e8548d9..7c21b73b630 100644 --- a/example/example.rs +++ b/example/example.rs @@ -153,9 +153,10 @@ fn array_as_slice(arr: &[u8; 3]) -> &[u8] { arr } -unsafe fn use_ctlz_nonzero(a: u16) -> u16 { - intrinsics::ctlz_nonzero(a) -} +// FIXME: fix the intrinsic implementation to work with the new ->u32 signature +// unsafe fn use_ctlz_nonzero(a: u16) -> u32 { +// intrinsics::ctlz_nonzero(a) +// } fn ptr_as_usize(ptr: *const u8) -> usize { ptr as usize diff --git a/example/mini_core.rs b/example/mini_core.rs index 4665009e191..8ffa66a4894 100644 --- a/example/mini_core.rs +++ b/example/mini_core.rs @@ -593,7 +593,7 @@ pub mod intrinsics { pub fn min_align_of_val<T: ?Sized>(val: *const T) -> usize; pub fn copy<T>(src: *const T, dst: *mut T, count: usize); pub fn transmute<T, U>(e: T) -> U; - pub fn ctlz_nonzero<T>(x: T) -> T; + pub fn ctlz_nonzero<T>(x: T) -> u32; #[rustc_safe_intrinsic] pub fn needs_drop<T: ?Sized>() -> bool; #[rustc_safe_intrinsic] |
