Skip to content

Commit

Permalink
change docs to avoid into
Browse files Browse the repository at this point in the history
  • Loading branch information
estebank committed Aug 19, 2024
1 parent 124ff7d commit bd05c40
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion library/alloc/src/rc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1714,7 +1714,7 @@ impl<T: ?Sized, A: Allocator> Rc<T, A> {
/// let x: Rc<&str> = Rc::new("Hello, world!");
/// {
/// let s = String::from("Oh, no!");
/// let mut y: Rc<&str> = x.clone().into();
/// let mut y: Rc<&str> = x.clone();
/// unsafe {
/// // this is Undefined Behavior, because x's inner type
/// // is &'long str, not &'short str
Expand Down
4 changes: 2 additions & 2 deletions library/alloc/src/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2392,7 +2392,7 @@ impl<T: ?Sized, A: Allocator> Arc<T, A> {
/// use std::sync::Arc;
///
/// let x: Arc<str> = Arc::from("Hello, world!");
/// let mut y: Arc<[u8]> = x.clone().into();
/// let mut y: Arc<[u8]> = x.clone();
/// unsafe {
/// // this is Undefined Behavior, because x's inner type is str, not [u8]
/// Arc::get_mut_unchecked(&mut y).fill(0xff); // 0xff is invalid in UTF-8
Expand All @@ -2408,7 +2408,7 @@ impl<T: ?Sized, A: Allocator> Arc<T, A> {
/// let x: Arc<&str> = Arc::new("Hello, world!");
/// {
/// let s = String::from("Oh, no!");
/// let mut y: Arc<&str> = x.clone().into();
/// let mut y: Arc<&str> = x.clone();
/// unsafe {
/// // this is Undefined Behavior, because x's inner type
/// // is &'long str, not &'short str
Expand Down

0 comments on commit bd05c40

Please sign in to comment.