@@ -265,71 +265,67 @@ pub unsafe fn atomic_singlethreadfence<const ORD: AtomicOrdering>();
265
265
/// Prefetches have no effect on the behavior of the program but can change its performance
266
266
/// characteristics.
267
267
///
268
- /// The `locality ` argument must be a constant integer and is a temporal locality specifier
269
- /// ranging from (0) - no locality, to (3) - extremely local keep in cache.
268
+ /// The `LOCALITY ` argument is a temporal locality specifier ranging from (0) - no locality,
269
+ /// to (3) - extremely local keep in cache.
270
270
///
271
271
/// This intrinsic does not have a stable counterpart.
272
272
#[ rustc_intrinsic]
273
273
#[ rustc_nounwind]
274
274
#[ miri:: intrinsic_fallback_is_spec]
275
- pub unsafe fn prefetch_read_data < T > ( data : * const T , locality : i32 ) {
275
+ pub const fn prefetch_read_data < T , const LOCALITY : i32 > ( data : * const T ) {
276
276
// This operation is a no-op, unless it is overridden by the backend.
277
277
let _ = data;
278
- let _ = locality;
279
278
}
280
279
281
280
/// The `prefetch` intrinsic is a hint to the code generator to insert a prefetch instruction
282
281
/// for the given address if supported; otherwise, it is a no-op.
283
282
/// Prefetches have no effect on the behavior of the program but can change its performance
284
283
/// characteristics.
285
284
///
286
- /// The `locality ` argument must be a constant integer and is a temporal locality specifier
287
- /// ranging from (0) - no locality, to (3) - extremely local keep in cache.
285
+ /// The `LOCALITY ` argument is a temporal locality specifier ranging from (0) - no locality,
286
+ /// to (3) - extremely local keep in cache.
288
287
///
289
288
/// This intrinsic does not have a stable counterpart.
290
289
#[ rustc_intrinsic]
291
290
#[ rustc_nounwind]
292
291
#[ miri:: intrinsic_fallback_is_spec]
293
- pub unsafe fn prefetch_write_data < T > ( data : * const T , locality : i32 ) {
292
+ pub const fn prefetch_write_data < T , const LOCALITY : i32 > ( data : * const T ) {
294
293
// This operation is a no-op, unless it is overridden by the backend.
295
294
let _ = data;
296
- let _ = locality;
297
295
}
298
296
299
297
/// The `prefetch` intrinsic is a hint to the code generator to insert a prefetch instruction
300
298
/// for the given address if supported; otherwise, it is a no-op.
301
299
/// Prefetches have no effect on the behavior of the program but can change its performance
302
300
/// characteristics.
303
301
///
304
- /// The `locality ` argument must be a constant integer and is a temporal locality specifier
305
- /// ranging from (0) - no locality, to (3) - extremely local keep in cache.
302
+ /// The `LOCALITY ` argument is a temporal locality specifier ranging from (0) - no locality,
303
+ /// to (3) - extremely local keep in cache.
306
304
///
307
305
/// This intrinsic does not have a stable counterpart.
308
306
#[ rustc_intrinsic]
309
307
#[ rustc_nounwind]
310
308
#[ miri:: intrinsic_fallback_is_spec]
311
- pub unsafe fn prefetch_read_instruction < T > ( data : * const T , locality : i32 ) {
309
+ pub const fn prefetch_read_instruction < T , const LOCALITY : i32 > ( data : * const T ) {
312
310
// This operation is a no-op, unless it is overridden by the backend.
313
311
let _ = data;
314
- let _ = locality;
315
312
}
316
313
317
314
/// The `prefetch` intrinsic is a hint to the code generator to insert a prefetch instruction
318
315
/// for the given address if supported; otherwise, it is a no-op.
319
316
/// Prefetches have no effect on the behavior of the program but can change its performance
320
317
/// characteristics.
321
318
///
322
- /// The `locality ` argument must be a constant integer and is a temporal locality specifier
323
- /// ranging from (0) - no locality, to (3) - extremely local keep in cache.
319
+ /// The `LOCALITY ` argument is a temporal locality specifier ranging from (0) - no locality,
320
+ /// to (3) - extremely local keep in cache.
324
321
///
325
322
/// This intrinsic does not have a stable counterpart.
326
323
#[ rustc_intrinsic]
327
324
#[ rustc_nounwind]
328
325
#[ miri:: intrinsic_fallback_is_spec]
329
- pub unsafe fn prefetch_write_instruction < T > ( data : * const T , locality : i32 ) {
326
+ pub const fn prefetch_write_instruction < T , const LOCALITY : i32 > ( data : * const T ) {
330
327
// This operation is a no-op, unless it is overridden by the backend.
331
328
let _ = data;
332
- let _ = locality;
333
329
}
334
330
335
331
/// Executes a breakpoint trap, for inspection by a debugger.
0 commit comments