Skip to content

Commit fb1d2d1

Browse files
committed
refactor: Update 'fn allocate_bytes()' return type and restore comments
- Modify allocate_bytes() to return more appropriate pointer type - Revert dedup function documentation to original version per review Signed-off-by: shamb0 <r.raajey@gmail.com>
1 parent d0856d8 commit fb1d2d1

File tree

1 file changed

+3
-3
lines changed
  • compiler/rustc_const_eval/src/interpret

1 file changed

+3
-3
lines changed

compiler/rustc_const_eval/src/interpret/place.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1053,13 +1053,13 @@ where
10531053
let bytes = str.as_bytes();
10541054
let ptr = self.allocate_bytes(bytes, Align::ONE, kind, mutbl)?;
10551055

1056-
// Create length metadata for the string
1056+
// Create length metadata for the string.
10571057
let meta = Scalar::from_target_usize(u64::try_from(bytes.len()).unwrap(), self);
10581058

1059-
// Get layout for Rust's str type
1059+
// Get layout for Rust's str type.
10601060
let layout = self.layout_of(self.tcx.types.str_).unwrap();
10611061

1062-
// Combine pointer and metadata into a wide pointer
1062+
// Combine pointer and metadata into a wide pointer.
10631063
interp_ok(self.ptr_with_meta_to_mplace(
10641064
ptr.into(),
10651065
MemPlaceMeta::Meta(meta),

0 commit comments

Comments
 (0)