Skip to content

Commit 7a0c167

Browse files
committed
Elaborate safety comment;
1 parent a52a941 commit 7a0c167

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

library/core/src/char/methods.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1788,7 +1788,7 @@ pub const fn encode_utf8_raw(code: u32, dst: &mut [u8]) -> &mut [u8] {
17881788
// Note that the original message is not const-compatible due to formatting.
17891789
_ => panic!("encode_utf8: buffer does not have enough bytes to encode code point"),
17901790
};
1791-
// SAFETY: `<&mut [u8]>::as_mut_ptr` returns a valid pointer and `len` has been tested to be valid.
1791+
// SAFETY: `<&mut [u8]>::as_mut_ptr` is guaranteed to return a valid pointer and `len` has been tested to be within bounds.
17921792
unsafe { slice::from_raw_parts_mut(dst.as_mut_ptr(), len) }
17931793
}
17941794

library/core/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,8 @@
118118
#![feature(const_array_into_iter_constructors)]
119119
#![feature(const_bigint_helper_methods)]
120120
#![feature(const_black_box)]
121-
#![feature(const_char_encode_utf8)]
122121
#![feature(const_cell_into_inner)]
122+
#![feature(const_char_encode_utf8)]
123123
#![feature(const_eval_select)]
124124
#![feature(const_exact_div)]
125125
#![feature(const_float_classify)]

0 commit comments

Comments
 (0)