@@ -245,6 +245,8 @@ impl<'tcx, Tag: Copy, Extra: AllocationExtra<Tag>> Allocation<Tag, Extra> {
245
245
/// as a slice.
246
246
///
247
247
/// It is the caller's responsibility to check bounds and alignment beforehand.
248
+ /// Most likely, you want to use the `PlaceTy` and `OperandTy`-based methods
249
+ /// on `InterpCx` instead.
248
250
#[ inline]
249
251
pub fn get_bytes (
250
252
& self ,
@@ -275,6 +277,8 @@ impl<'tcx, Tag: Copy, Extra: AllocationExtra<Tag>> Allocation<Tag, Extra> {
275
277
/// so be sure to actually put data there!
276
278
///
277
279
/// It is the caller's responsibility to check bounds and alignment beforehand.
280
+ /// Most likely, you want to use the `PlaceTy` and `OperandTy`-based methods
281
+ /// on `InterpCx` instead.
278
282
pub fn get_bytes_mut (
279
283
& mut self ,
280
284
cx : & impl HasDataLayout ,
@@ -297,6 +301,8 @@ impl<'tcx, Tag: Copy, Extra: AllocationExtra<Tag>> Allocation<Tag, Extra> {
297
301
impl < ' tcx , Tag : Copy , Extra : AllocationExtra < Tag > > Allocation < Tag , Extra > {
298
302
/// Reads bytes until a `0` is encountered. Will error if the end of the allocation is reached
299
303
/// before a `0` is found.
304
+ ///
305
+ /// Most likely, you want to call `Memory::read_c_str` instead of this method.
300
306
pub fn read_c_str (
301
307
& self ,
302
308
cx : & impl HasDataLayout ,
@@ -342,6 +348,7 @@ impl<'tcx, Tag: Copy, Extra: AllocationExtra<Tag>> Allocation<Tag, Extra> {
342
348
/// Writes `src` to the memory starting at `ptr.offset`.
343
349
///
344
350
/// It is the caller's responsibility to check bounds and alignment beforehand.
351
+ /// Most likely, you want to call `Memory::write_bytes` instead of this method.
345
352
pub fn write_bytes (
346
353
& mut self ,
347
354
cx : & impl HasDataLayout ,
@@ -363,6 +370,7 @@ impl<'tcx, Tag: Copy, Extra: AllocationExtra<Tag>> Allocation<Tag, Extra> {
363
370
/// Sets `count` bytes starting at `ptr.offset` with `val`. Basically `memset`.
364
371
///
365
372
/// It is the caller's responsibility to check bounds and alignment beforehand.
373
+ /// Most likely, you want to call `Memory::write_bytes` instead of this method.
366
374
pub fn write_repeat (
367
375
& mut self ,
368
376
cx : & impl HasDataLayout ,
@@ -386,6 +394,7 @@ impl<'tcx, Tag: Copy, Extra: AllocationExtra<Tag>> Allocation<Tag, Extra> {
386
394
/// pointers being valid for ZSTs.
387
395
///
388
396
/// It is the caller's responsibility to check bounds and alignment beforehand.
397
+ /// Most likely, you want to call `InterpCx::read_scalar` instead of this method.
389
398
pub fn read_scalar (
390
399
& self ,
391
400
cx : & impl HasDataLayout ,
@@ -424,6 +433,7 @@ impl<'tcx, Tag: Copy, Extra: AllocationExtra<Tag>> Allocation<Tag, Extra> {
424
433
/// Reads a pointer-sized scalar.
425
434
///
426
435
/// It is the caller's responsibility to check bounds and alignment beforehand.
436
+ /// Most likely, you want to call `InterpCx::read_scalar` instead of this method.
427
437
pub fn read_ptr_sized (
428
438
& self ,
429
439
cx : & impl HasDataLayout ,
@@ -441,6 +451,7 @@ impl<'tcx, Tag: Copy, Extra: AllocationExtra<Tag>> Allocation<Tag, Extra> {
441
451
/// pointers being valid for ZSTs.
442
452
///
443
453
/// It is the caller's responsibility to check bounds and alignment beforehand.
454
+ /// Most likely, you want to call `InterpCx::write_scalar` instead of this method.
444
455
pub fn write_scalar (
445
456
& mut self ,
446
457
cx : & impl HasDataLayout ,
@@ -483,6 +494,7 @@ impl<'tcx, Tag: Copy, Extra: AllocationExtra<Tag>> Allocation<Tag, Extra> {
483
494
/// Writes a pointer-sized scalar.
484
495
///
485
496
/// It is the caller's responsibility to check bounds and alignment beforehand.
497
+ /// Most likely, you want to call `InterpCx::write_scalar` instead of this method.
486
498
pub fn write_ptr_sized (
487
499
& mut self ,
488
500
cx : & impl HasDataLayout ,
0 commit comments