mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-06 20:13:42 +00:00
fix slice comparison
Co-Authored-By: Aleksey Kladov <aleksey.kladov@gmail.com>
This commit is contained in:
parent
4e51ef7ccd
commit
90b95cf53f
@ -163,7 +163,7 @@ fn test_as_mut() {
|
|||||||
// Pointers to unsized types -- slices
|
// Pointers to unsized types -- slices
|
||||||
let s: &mut [u8] = &mut [1, 2, 3];
|
let s: &mut [u8] = &mut [1, 2, 3];
|
||||||
let ms: *mut [u8] = s;
|
let ms: *mut [u8] = s;
|
||||||
assert_eq!(ms.as_mut(), Some(&mut [1, 2, 3]));
|
assert_eq!(ms.as_mut(), Some(&mut [1, 2, 3][..]));
|
||||||
|
|
||||||
let mz: *mut [u8] = &mut [];
|
let mz: *mut [u8] = &mut [];
|
||||||
assert_eq!(mz.as_mut(), Some(&mut [][..]));
|
assert_eq!(mz.as_mut(), Some(&mut [][..]));
|
||||||
|
Loading…
Reference in New Issue
Block a user