rust/src
Ralf Jung c50b9d197f Centralize bounds, alignment and NULL checking for memory accesses in one function: memory.check_ptr_access
That function also takes care of converting a Scalar to a Pointer, should that be needed.  Not all accesses need that though: if the access has size 0, None is returned.
Everyone accessing memory based on a Scalar should use this method to get the Pointer they need.

All operations on the Allocation work on Pointer inputs and expect all the checks to have happened (and will ICE if the bounds are violated).
The operations on Memory work on Scalar inputs and do the checks themselves.

The only other public method to check pointers is memory.ptr_may_be_null, which is needed in a few places.
With this, we can make all the other methods (tests for a pointer being in-bounds and checking alignment) private helper methods, used to implement the two public methods.
That maks the public API surface much easier to use and harder to mis-use.

While I am at it, this also removes the assumption that the vtable part of a `dyn Trait`-fat-pointer is a `Pointer` (as opposed to a pointer cast to an integer, stored as raw bits).
2019-06-23 15:55:04 +02:00
..
bootstrap Update mdbook 2019-06-20 19:47:44 -07:00
build_helper Bump compiler-builtins to 0.1.15 2019-05-22 07:46:36 -07:00
ci Rollup merge of #61839 - alexcrichton:pr-and-master-builds, r=pietroalbini 2019-06-19 01:52:04 +02:00
doc Rollup merge of #61267 - michaelwoerister:update-xlto-table, r=alexcrichton 2019-06-22 01:42:33 +02:00
etc Auto merge of #61827 - golddranks:lldb_fix, r=nikomatsakis 2019-06-20 17:57:04 +00:00
grammar
liballoc Rollup merge of #61146 - czipperz:SliceConcatExt-connect-default-to-join, r=sfackler 2019-06-22 01:42:30 +02:00
libarena Make use of ptr::null(_mut) instead of casting zero 2019-06-17 10:52:46 +00:00
libcore Auto merge of #61929 - 95th:master, r=GuillaumeGomez 2019-06-20 12:18:25 +00:00
libfmt_macros Separate libfmt_macros module 2019-06-16 14:17:01 +03:00
libgraphviz Separate libgraphviz module 2019-06-16 13:08:09 +03:00
libpanic_abort
libpanic_unwind Make use of ptr::null(_mut) instead of casting zero 2019-06-17 10:52:46 +00:00
libproc_macro
libprofiler_builtins Ship profiler with windows-gnu 2019-05-23 13:32:30 +02:00
librustc Centralize bounds, alignment and NULL checking for memory accesses in one function: memory.check_ptr_access 2019-06-23 15:55:04 +02:00
librustc_allocator syntax: Introduce default/with_unstable constructors for ExpnInfo 2019-06-18 10:48:56 +03:00
librustc_apfloat ignore-tidy-filelength on all files with greater than 3000 lines 2019-04-25 21:39:09 +01:00
librustc_asan
librustc_borrowck rename hir::map::get_by_hir_id to get 2019-06-20 12:50:06 +02:00
librustc_codegen_llvm Rollup merge of #61984 - ljedrz:more_node_id_pruning, r=Zoxc 2019-06-22 01:42:38 +02:00
librustc_codegen_ssa Rollup merge of #61984 - ljedrz:more_node_id_pruning, r=Zoxc 2019-06-22 01:42:38 +02:00
librustc_codegen_utils rename hir::map::get_by_hir_id to get 2019-06-20 12:50:06 +02:00
librustc_cratesio_shim
librustc_data_structures Auto merge of #61347 - Centril:stabilize-underscore_const_names, r=petrochenkov 2019-06-16 20:33:55 +00:00
librustc_driver rename hir::map::get_by_hir_id to get 2019-06-20 12:50:06 +02:00
librustc_errors Make use of ptr::null(_mut) instead of casting zero 2019-06-17 10:52:46 +00:00
librustc_fs_util
librustc_incremental rename hir::map::get_by_hir_id to get 2019-06-20 12:50:06 +02:00
librustc_interface Run rustfmt --file-lines ... for changes from previous commits. 2019-06-14 18:58:32 +03:00
librustc_lint rename hir::map::get_by_hir_id to get 2019-06-20 12:50:06 +02:00
librustc_llvm Pass LLVM linker flags to librustc_llvm build 2019-06-10 19:50:34 -07:00
librustc_lsan
librustc_macros Unify all uses of 'gcx and 'tcx. 2019-06-14 18:58:23 +03:00
librustc_metadata Rollup merge of #61898 - petrochenkov:sekind, r=eddyb 2019-06-19 01:52:10 +02:00
librustc_mir Centralize bounds, alignment and NULL checking for memory accesses in one function: memory.check_ptr_access 2019-06-23 15:55:04 +02:00
librustc_msan
librustc_passes rename hir::map::expect_expr_by_hir_id to expect_expr 2019-06-20 12:47:26 +02:00
librustc_plugin syntax: Factor out common fields from SyntaxExtension variants 2019-06-18 10:48:56 +03:00
librustc_privacy rename hir::map::get_by_hir_id to get 2019-06-20 12:50:06 +02:00
librustc_resolve Rollup merge of #61898 - petrochenkov:sekind, r=eddyb 2019-06-19 01:52:10 +02:00
librustc_save_analysis revert the NodeId to HirId parameter change to get_path_res 2019-06-21 08:57:34 +02:00
librustc_target Rollup merge of #61844 - AaronKutch:master, r=Centril 2019-06-15 17:45:06 +02:00
librustc_traits rename hir::map::get_by_hir_id to get 2019-06-20 12:50:06 +02:00
librustc_tsan
librustc_typeck Rollup merge of #61984 - ljedrz:more_node_id_pruning, r=Zoxc 2019-06-22 01:42:38 +02:00
librustdoc Rollup merge of #61984 - ljedrz:more_node_id_pruning, r=Zoxc 2019-06-22 01:42:38 +02:00
libserialize rustc: remove 'x: 'y bounds (except from comments/strings). 2019-06-18 18:10:21 +03:00
libstd Rollup merge of #61900 - s3bk:master, r=sfackler 2019-06-20 22:14:24 +02:00
libsyntax Rollup merge of #61996 - Xanewok:unescape-raw-strings, r=matklad 2019-06-20 22:14:28 +02:00
libsyntax_ext Auto merge of #61172 - matthewjasper:cleanup-implied-bounds-lint, r=varkor 2019-06-19 12:41:38 +00:00
libsyntax_pos hygiene: Avoid some unnecessary ExpnInfo clones 2019-06-18 10:48:56 +03:00
libterm Remove unused #![feature(custom_attribute)]s 2019-06-08 23:55:24 +03:00
libtest Separate libtest module 2019-06-16 14:17:01 +03:00
libunwind std: Remove internal definitions of cfg_if! macro 2019-06-10 10:58:44 -07:00
llvm-emscripten@7f23313edf
llvm-project@1bbe0b3e1d Update LLVM to fix VS 2019 compilation 2019-06-21 08:31:41 +02:00
rtstartup
rustc Remove leading newlines 2019-04-22 17:01:33 +01:00
rustllvm Limit internalization in LLVM 8 ThinLTO 2019-04-26 08:58:14 -07:00
stdsimd@4bf456c35e Breaking update of stdsimd 2019-04-22 09:07:25 +02:00
test Auto merge of #62010 - ecstatic-morse:kill-borrows-of-proj, r=pnkfelix 2019-06-22 05:12:11 +00:00
tools submodules: Update clippy from 149a988 to 5a11ed7b 2019-06-21 11:54:50 +00:00
.gitignore
README.md
stage0.txt bump nightly to 1.37.0 2019-05-23 12:27:58 +02:00

This directory contains the source code of the rust project, including:

  • rustc and its tests
  • libstd
  • Various submodules for tools, like rustdoc, rls, etc.

For more information on how various parts of the compiler work, see the rustc guide.

There is also useful content in the following READMEs, which are gradually being moved over to the guide: