]> git.proxmox.com Git - rustc.git/blobdiff - library/alloc/tests/str.rs
New upstream version 1.65.0+dfsg1
[rustc.git] / library / alloc / tests / str.rs
index 7379569dd68fe4a189f4218c860fab7d482f9164..e30329aa1cb6c78e46c8952eae1f839763ec8df4 100644 (file)
@@ -1010,11 +1010,11 @@ fn test_as_bytes_fail() {
 fn test_as_ptr() {
     let buf = "hello".as_ptr();
     unsafe {
-        assert_eq!(*buf.offset(0), b'h');
-        assert_eq!(*buf.offset(1), b'e');
-        assert_eq!(*buf.offset(2), b'l');
-        assert_eq!(*buf.offset(3), b'l');
-        assert_eq!(*buf.offset(4), b'o');
+        assert_eq!(*buf.add(0), b'h');
+        assert_eq!(*buf.add(1), b'e');
+        assert_eq!(*buf.add(2), b'l');
+        assert_eq!(*buf.add(3), b'l');
+        assert_eq!(*buf.add(4), b'o');
     }
 }