rust/src
Ariel Ben-Yehuda 9d074473da Rollup merge of #40943 - Amanieu:offset_to, r=alexcrichton
Add ptr::offset_to

This PR adds a method to calculate the signed distance (in number of elements) between two pointers. The resulting value can then be passed to `offset` to get one pointer from the other. This is similar to pointer subtraction in C/C++.

There are 2 special cases:

- If the distance is not a multiple of the element size then the result is rounded towards zero. (in C/C++ this is UB)
-  ZST return `None`, while normal types return `Some(isize)`. This forces the user to handle the ZST case in unsafe code. (C/C++ doesn't have ZSTs)
2017-04-05 23:01:08 +00:00
..
bootstrap Fixes other targets rustlibs installation 2017-04-04 17:16:42 -07:00
build_helper rustbuild: Assert directory creation succeeds 2017-03-07 15:24:36 -08:00
ci travis: Update sccache binaries 2017-04-04 15:55:23 -07:00
compiler-rt@d30da544a8 sanitizer support 2017-02-08 18:51:43 -05:00
doc Rollup merge of #40943 - Amanieu:offset_to, r=alexcrichton 2017-04-05 23:01:08 +00:00
driver
etc Reduce a table used for Debug impl of str. 2017-04-05 09:13:19 -07:00
grammar Fix various useless derefs and slicings 2017-03-27 08:58:00 +02:00
jemalloc@11bfb0dcf8
liballoc Fix up various links 2017-03-20 10:10:16 -04:00
liballoc_jemalloc Update usages of 'OSX' (and other old names) to 'macOS'. 2017-03-12 14:59:04 -04:00
liballoc_system
libarena
libbacktrace libbacktrace: Fix uninitialized variable 2017-02-04 01:18:10 +03:00
libcollections Rollup merge of #40943 - Amanieu:offset_to, r=alexcrichton 2017-04-05 23:01:08 +00:00
libcollectionstest Rollup merge of #40947 - stjepang:test-sort-random-cmp, r=alexcrichton 2017-03-31 16:48:29 -04:00
libcompiler_builtins make shift builtins panic-free with new unchecked_sh* intrinsics 2017-03-15 06:59:09 +01:00
libcore Rollup merge of #40943 - Amanieu:offset_to, r=alexcrichton 2017-04-05 23:01:08 +00:00
libcoretest Test sort algorithms using a random cmp function 2017-03-31 17:00:24 +02:00
libflate Add/remove rerun-if-changed when necessary 2017-03-04 21:38:26 +03:00
libfmt_macros
libgetopts
libgraphviz Fix various useless derefs and slicings 2017-03-27 08:58:00 +02:00
liblibc@05a2d19735 Update libc to 0.2.21 2017-03-25 11:03:06 -03:00
libpanic_abort
libpanic_unwind std: Remove cfg(cargobuild) annotations 2017-02-06 08:42:54 -08:00
libproc_macro Add doc attributes to proc_macro crate 2017-03-12 02:54:43 +00:00
libproc_macro_plugin Improve the TokenStream quoter. 2017-03-15 23:05:02 +00:00
librand
librustc Replace ^ with <sup> html balise 2017-04-03 21:17:47 +02:00
librustc_asan rustbuild: Update bootstrap compiler 2017-03-29 08:55:15 -07:00
librustc_back Remove internal liblog 2017-03-23 11:28:00 -07:00
librustc_bitflags
librustc_borrowck Rollup merge of #40841 - arielb1:immutable-blame, r=pnkfelix 2017-03-29 08:57:06 -04:00
librustc_const_eval Fix various useless derefs and slicings 2017-03-27 08:58:00 +02:00
librustc_const_math rustc_const_eval: always demand typeck_tables for evaluating constants. 2017-02-25 18:35:26 +02:00
librustc_data_structures Auto merge of #40524 - alexcrichton:update-bootstrap, r=alexcrichton 2017-03-30 17:10:11 +00:00
librustc_driver Properly adjust filenames when multiple emissions 2017-04-05 19:02:25 +03:00
librustc_errors Merge ExpnId and SyntaxContext. 2017-03-29 00:41:10 +00:00
librustc_incremental Auto merge of #40524 - alexcrichton:update-bootstrap, r=alexcrichton 2017-03-30 17:10:11 +00:00
librustc_lint Make overlapping_inherent_impls lint a hard error 2017-03-29 13:27:00 +09:00
librustc_llvm Fix various useless derefs and slicings 2017-03-27 08:58:00 +02:00
librustc_lsan rustbuild: Update bootstrap compiler 2017-03-29 08:55:15 -07:00
librustc_metadata Auto merge of #40524 - alexcrichton:update-bootstrap, r=alexcrichton 2017-03-30 17:10:11 +00:00
librustc_mir Auto merge of #40524 - alexcrichton:update-bootstrap, r=alexcrichton 2017-03-30 17:10:11 +00:00
librustc_msan rustbuild: Update bootstrap compiler 2017-03-29 08:55:15 -07:00
librustc_passes Remove internal liblog 2017-03-23 11:28:00 -07:00
librustc_platform_intrinsics Auto merge of #38561 - nagisa:rdrandseed, r=alexcrichton 2017-02-14 01:26:10 +00:00
librustc_plugin Merge ExpnId and SyntaxContext. 2017-03-29 00:41:10 +00:00
librustc_privacy rustbuild: Update bootstrap compiler 2017-03-29 08:55:15 -07:00
librustc_resolve Move syntax::ext::hygiene to syntax_pos::hygiene. 2017-03-29 00:41:08 +00:00
librustc_save_analysis rebased 2017-04-04 16:08:00 +12:00
librustc_trans Auto merge of #40524 - alexcrichton:update-bootstrap, r=alexcrichton 2017-03-30 17:10:11 +00:00
librustc_tsan rustbuild: Update bootstrap compiler 2017-03-29 08:55:15 -07:00
librustc_typeck Do not recommend private fields called as method 2017-04-04 08:58:27 -07:00
librustdoc Handle ordered lists as well 2017-04-04 00:24:08 +02:00
libserialize Only SwitchInt over integers, not all consts 2017-02-10 19:42:41 +02:00
libstd Rollup merge of #40561 - arthurprs:hm-adapt2, r=pczarn 2017-04-05 23:01:04 +00:00
libstd_unicode Remove parentheses in method references 2017-03-30 18:33:23 -04:00
libsyntax Rollup merge of #40815 - estebank:issue-40006, r=GuillaumeGomez 2017-04-05 23:01:06 +00:00
libsyntax_ext Refactor how spans are combined in the parser. 2017-03-29 11:17:59 +00:00
libsyntax_pos Rollup merge of #40815 - estebank:issue-40006, r=GuillaumeGomez 2017-04-05 23:01:06 +00:00
libterm Update usages of 'OSX' (and other old names) to 'macOS'. 2017-03-12 14:59:04 -04:00
libtest Fix links 2017-04-04 15:39:44 -04:00
libunwind Add/remove rerun-if-changed when necessary 2017-03-04 21:38:26 +03:00
llvm@2e951c3ae3 update LLVM with fix for PR32379 2017-03-24 00:54:23 +02:00
rt End of pulldown switch and remove completely hoedown 2017-03-28 11:38:55 -06:00
rtstartup
rust-installer@4f99485080
rustc Fix plain_summary_line function 2017-03-28 11:38:56 -06:00
rustllvm update LLVM with fix for PR32379 2017-03-24 00:54:23 +02:00
test Rollup merge of #40815 - estebank:issue-40006, r=GuillaumeGomez 2017-04-05 23:01:06 +00:00
tools Auto merge of #40919 - GuillaumeGomez:fix-new-rustdoc, r=frewsxcv,steveklabnik 2017-04-02 18:16:09 +00:00
Cargo.lock Sync all unstable features with Unstable Book; add tidy lint. 2017-03-31 11:40:44 -04:00
Cargo.toml Don't put Cargo into the rustc workspace 2017-03-10 14:49:19 -08:00
stage0.txt rustbuild: Update bootstrap compiler 2017-03-29 08:55:15 -07:00