@@ -904,45 +904,51 @@ extern "rust-intrinsic" {
904
904
#[ rustc_nounwind]
905
905
pub fn prefetch_write_instruction < T > ( data : * const T , locality : i32 ) ;
906
906
907
- /// Magic intrinsic that derives its meaning from attributes
908
- /// attached to the function.
909
- ///
910
- /// For example, dataflow uses this to inject static assertions so
911
- /// that `rustc_peek(potentially_uninitialized)` would actually
912
- /// double-check that dataflow did indeed compute that it is
913
- /// uninitialized at that point in the control flow.
914
- ///
915
- /// This intrinsic should not be used outside of the compiler.
916
- #[ rustc_safe_intrinsic]
917
- #[ rustc_nounwind]
918
- pub fn rustc_peek < T > ( _: T ) -> T ;
919
-
920
- /// Aborts the execution of the process.
921
- ///
922
- /// Note that, unlike most intrinsics, this is safe to call;
923
- /// it does not require an `unsafe` block.
924
- /// Therefore, implementations must not require the user to uphold
925
- /// any safety invariants.
926
- ///
927
- /// [`std::process::abort`](../../std/process/fn.abort.html) is to be preferred if possible,
928
- /// as its behavior is more user-friendly and more stable.
929
- ///
930
- /// The current implementation of `intrinsics::abort` is to invoke an invalid instruction,
931
- /// on most platforms.
932
- /// On Unix, the
933
- /// process will probably terminate with a signal like `SIGABRT`, `SIGILL`, `SIGTRAP`, `SIGSEGV` or
934
- /// `SIGBUS`. The precise behavior is not guaranteed and not stable.
935
- #[ rustc_safe_intrinsic]
936
- #[ rustc_nounwind]
937
- pub fn abort ( ) -> !;
938
-
939
907
/// Executes a breakpoint trap, for inspection by a debugger.
940
908
///
941
909
/// This intrinsic does not have a stable counterpart.
942
910
#[ rustc_nounwind]
943
911
pub fn breakpoint ( ) ;
944
912
}
945
913
914
+ /// Magic intrinsic that derives its meaning from attributes
915
+ /// attached to the function.
916
+ ///
917
+ /// For example, dataflow uses this to inject static assertions so
918
+ /// that `rustc_peek(potentially_uninitialized)` would actually
919
+ /// double-check that dataflow did indeed compute that it is
920
+ /// uninitialized at that point in the control flow.
921
+ ///
922
+ /// This intrinsic should not be used outside of the compiler.
923
+ #[ rustc_nounwind]
924
+ #[ rustc_intrinsic]
925
+ #[ rustc_intrinsic_must_be_overridden]
926
+ pub fn rustc_peek < T > ( _: T ) -> T {
927
+ unreachable ! ( )
928
+ }
929
+
930
+ /// Aborts the execution of the process.
931
+ ///
932
+ /// Note that, unlike most intrinsics, this is safe to call;
933
+ /// it does not require an `unsafe` block.
934
+ /// Therefore, implementations must not require the user to uphold
935
+ /// any safety invariants.
936
+ ///
937
+ /// [`std::process::abort`](../../std/process/fn.abort.html) is to be preferred if possible,
938
+ /// as its behavior is more user-friendly and more stable.
939
+ ///
940
+ /// The current implementation of `intrinsics::abort` is to invoke an invalid instruction,
941
+ /// on most platforms.
942
+ /// On Unix, the
943
+ /// process will probably terminate with a signal like `SIGABRT`, `SIGILL`, `SIGTRAP`, `SIGSEGV` or
944
+ /// `SIGBUS`. The precise behavior is not guaranteed and not stable.
945
+ #[ rustc_nounwind]
946
+ #[ rustc_intrinsic]
947
+ #[ rustc_intrinsic_must_be_overridden]
948
+ pub fn abort ( ) -> ! {
949
+ unreachable ! ( )
950
+ }
951
+
946
952
/// Informs the optimizer that this point in the code is not reachable,
947
953
/// enabling further optimizations.
948
954
///
@@ -1512,19 +1518,22 @@ pub const unsafe fn arith_offset<T>(_dst: *const T, _offset: isize) -> *const T
1512
1518
unreachable ! ( )
1513
1519
}
1514
1520
1515
- extern "rust-intrinsic" {
1516
- /// Masks out bits of the pointer according to a mask.
1517
- ///
1518
- /// Note that, unlike most intrinsics, this is safe to call;
1519
- /// it does not require an `unsafe` block.
1520
- /// Therefore, implementations must not require the user to uphold
1521
- /// any safety invariants.
1522
- ///
1523
- /// Consider using [`pointer::mask`] instead.
1524
- #[ rustc_safe_intrinsic]
1525
- #[ rustc_nounwind]
1526
- pub fn ptr_mask < T > ( ptr : * const T , mask : usize ) -> * const T ;
1521
+ /// Masks out bits of the pointer according to a mask.
1522
+ ///
1523
+ /// Note that, unlike most intrinsics, this is safe to call;
1524
+ /// it does not require an `unsafe` block.
1525
+ /// Therefore, implementations must not require the user to uphold
1526
+ /// any safety invariants.
1527
+ ///
1528
+ /// Consider using [`pointer::mask`] instead.
1529
+ #[ rustc_nounwind]
1530
+ #[ rustc_intrinsic]
1531
+ #[ rustc_intrinsic_must_be_overridden]
1532
+ pub fn ptr_mask < T > ( _ptr : * const T , _mask : usize ) -> * const T {
1533
+ unreachable ! ( )
1534
+ }
1527
1535
1536
+ extern "rust-intrinsic" {
1528
1537
/// Equivalent to the appropriate `llvm.memcpy.p0i8.0i8.*` intrinsic, with
1529
1538
/// a size of `count` * `size_of::<T>()` and an alignment of
1530
1539
/// `min_align_of::<T>()`
@@ -2140,47 +2149,62 @@ extern "rust-intrinsic" {
2140
2149
#[ rustc_nounwind]
2141
2150
pub fn frem_fast < T : Copy > ( a : T , b : T ) -> T ;
2142
2151
2143
- /// Float addition that allows optimizations based on algebraic rules.
2152
+ /// Converts with LLVM’s fptoui/fptosi, which may return undef for values out of range
2153
+ /// (<https://github.com/rust-lang/rust/issues/10184>)
2144
2154
///
2145
- /// This intrinsic does not have a stable counterpart .
2155
+ /// Stabilized as [`f32::to_int_unchecked`] and [`f64::to_int_unchecked`] .
2146
2156
#[ rustc_nounwind]
2147
- # [ rustc_safe_intrinsic ]
2148
- pub fn fadd_algebraic < T : Copy > ( a : T , b : T ) -> T ;
2157
+ pub fn float_to_int_unchecked < Float : Copy , Int : Copy > ( value : Float ) -> Int ;
2158
+ }
2149
2159
2150
- /// Float subtraction that allows optimizations based on algebraic rules.
2151
- ///
2152
- /// This intrinsic does not have a stable counterpart.
2153
- #[ rustc_nounwind]
2154
- #[ rustc_safe_intrinsic]
2155
- pub fn fsub_algebraic < T : Copy > ( a : T , b : T ) -> T ;
2160
+ /// Float addition that allows optimizations based on algebraic rules.
2161
+ ///
2162
+ /// This intrinsic does not have a stable counterpart.
2163
+ #[ rustc_nounwind]
2164
+ #[ rustc_intrinsic]
2165
+ #[ rustc_intrinsic_must_be_overridden]
2166
+ pub fn fadd_algebraic < T : Copy > ( _a : T , _b : T ) -> T {
2167
+ unimplemented ! ( )
2168
+ }
2156
2169
2157
- /// Float multiplication that allows optimizations based on algebraic rules.
2158
- ///
2159
- /// This intrinsic does not have a stable counterpart.
2160
- #[ rustc_nounwind]
2161
- #[ rustc_safe_intrinsic]
2162
- pub fn fmul_algebraic < T : Copy > ( a : T , b : T ) -> T ;
2170
+ /// Float subtraction that allows optimizations based on algebraic rules.
2171
+ ///
2172
+ /// This intrinsic does not have a stable counterpart.
2173
+ #[ rustc_nounwind]
2174
+ #[ rustc_intrinsic]
2175
+ #[ rustc_intrinsic_must_be_overridden]
2176
+ pub fn fsub_algebraic < T : Copy > ( _a : T , _b : T ) -> T {
2177
+ unimplemented ! ( )
2178
+ }
2163
2179
2164
- /// Float division that allows optimizations based on algebraic rules.
2165
- ///
2166
- /// This intrinsic does not have a stable counterpart.
2167
- #[ rustc_nounwind]
2168
- #[ rustc_safe_intrinsic]
2169
- pub fn fdiv_algebraic < T : Copy > ( a : T , b : T ) -> T ;
2180
+ /// Float multiplication that allows optimizations based on algebraic rules.
2181
+ ///
2182
+ /// This intrinsic does not have a stable counterpart.
2183
+ #[ rustc_nounwind]
2184
+ #[ rustc_intrinsic]
2185
+ #[ rustc_intrinsic_must_be_overridden]
2186
+ pub fn fmul_algebraic < T : Copy > ( _a : T , _b : T ) -> T {
2187
+ unimplemented ! ( )
2188
+ }
2170
2189
2171
- /// Float remainder that allows optimizations based on algebraic rules.
2172
- ///
2173
- /// This intrinsic does not have a stable counterpart.
2174
- #[ rustc_nounwind]
2175
- #[ rustc_safe_intrinsic]
2176
- pub fn frem_algebraic < T : Copy > ( a : T , b : T ) -> T ;
2190
+ /// Float division that allows optimizations based on algebraic rules.
2191
+ ///
2192
+ /// This intrinsic does not have a stable counterpart.
2193
+ #[ rustc_nounwind]
2194
+ #[ rustc_intrinsic]
2195
+ #[ rustc_intrinsic_must_be_overridden]
2196
+ pub fn fdiv_algebraic < T : Copy > ( _a : T , _b : T ) -> T {
2197
+ unimplemented ! ( )
2198
+ }
2177
2199
2178
- /// Converts with LLVM’s fptoui/fptosi, which may return undef for values out of range
2179
- /// (<https://github.com/rust-lang/rust/issues/10184>)
2180
- ///
2181
- /// Stabilized as [`f32::to_int_unchecked`] and [`f64::to_int_unchecked`].
2182
- #[ rustc_nounwind]
2183
- pub fn float_to_int_unchecked < Float : Copy , Int : Copy > ( value : Float ) -> Int ;
2200
+ /// Float remainder that allows optimizations based on algebraic rules.
2201
+ ///
2202
+ /// This intrinsic does not have a stable counterpart.
2203
+ #[ rustc_nounwind]
2204
+ #[ rustc_intrinsic]
2205
+ #[ rustc_intrinsic_must_be_overridden]
2206
+ pub fn frem_algebraic < T : Copy > ( _a : T , _b : T ) -> T {
2207
+ unimplemented ! ( )
2184
2208
}
2185
2209
2186
2210
/// Returns the number of bits set in an integer type `T`
0 commit comments