Commit graph

21 commits

Author SHA1 Message Date
Ralf Jung
90b95cf53f
fix slice comparison
Co-Authored-By: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-08-05 15:30:08 +02:00
Ralf Jung
4e51ef7ccd
Test content, not value
Co-Authored-By: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-08-05 11:21:15 +02:00
Ralf Jung
0d1584507b fix UB in a test 2019-08-04 14:43:02 +02:00
Ralf Jung
4dd5edc76d enable a few more tests in Miri and update the comment for others 2019-07-03 19:58:59 +02:00
Konrad Borowski
0cf1a912e3 Remove UB in test_ptr_subtraction test 2019-02-17 13:04:48 +01:00
Konrad Borowski
3281e62188 Remove UB in test_is_null test 2019-02-17 12:58:48 +01:00
Ralf Jung
72be9a607b review or fix remaining miri failures in libcore 2019-02-13 18:21:13 +01:00
Ralf Jung
81613ad7cf disable tests in Miri 2019-02-07 18:24:10 +01:00
Mark Rousskov
2a663555dd Remove licenses 2018-12-25 21:08:33 -07:00
Tatsuyuki Ishi
66c4dc9769 Add missing dyn 2018-07-25 10:24:31 +09:00
Simonas Kazlauskas
59bb0fe66e Fix align_offset_stride1 & align_to_simple tests 2018-05-17 23:13:43 +03:00
Simonas Kazlauskas
680031b016 Implement [T]::align_to 2018-05-17 23:13:08 +03:00
Simon Sapin
c97c1f7dc3 Mark Unique as perma-unstable, with the feature renamed to ptr_internals. 2018-01-20 11:09:23 +01:00
Josh Stone
e0f58c6a11
Remove T: Sized on ptr::is_null()
This reverts commit 604f049cd5.

This is purely a revert of cuviper's revert "Restore `T: Sized` on
`ptr::is_null`". So double revert means this is code written by cuviper!
2017-11-19 00:33:56 -08:00
Josh Stone
604f049cd5 Restore T: Sized on ptr::is_null
The exact semantics of `is_null` on unsized pointers are still debatable,
especially for trait objects.  It may be legal to call `*mut self`
methods on a trait object someday, as with Go interfaces, so `is_null`
might need to validate the vtable pointer too.

For `as_ref` and `as_mut`, we're assuming that you cannot have a non-null
data pointer with a null vtable, so casting the unsized check is fine.
2017-10-10 11:35:41 -07:00
Josh Stone
40a678d8db Use unsized coercions for null ptr tests 2017-09-30 14:45:18 -07:00
Josh Stone
8b2e09ffbb Avoid the UB of a null reference to a slice 2017-09-29 13:19:20 -07:00
Josh Stone
3580c4c589 Remove T: Sized on ptr::is_null(), as_ref(), as_mut()
`NonZero::is_zero()` was already casting all pointers to thin `*mut u8`
to check for null.  It seems reasonable to apply that for `is_null()` in
general, and then unsized fat pointers can also be used with `as_ref()`
and `as_mut()` to get fat references.
2017-09-29 12:36:32 -07:00
Simon Sapin
0a08ad0443 Rename {NonZero,Shared,Unique}::new to new_unchecked 2017-07-22 20:38:16 +02:00
Alexis Beingessner
4ff583b116 fallout from NonZero/Unique/Shared changes 2017-05-04 23:54:54 -04:00
Stjepan Glavina
13c744f30d Move libXtest into libX/tests
This change moves:

1. `libcoretest` into `libcore/tests`
2. `libcollectionstest` into `libcollections/tests`

This is a follow-up to #39561.
2017-04-03 20:49:39 +02:00
Renamed from src/libcoretest/ptr.rs (Browse further)