rust/src
Mazdak Farrokhzad 9e78bc5d4f
Rollup merge of #56594 - sdroege:c_void-is-not-never, r=TimNN
Remove confusing comment about ideally using `!` for `c_void`

Using `!` for `c_void` would have the problem that pointers and
potentially references to an uninhabited type would be created, and at
least for references this is UB.

In addition document that newtype wrappers around `c_void` can be used
safely in place of `extern type` until the latter is stabilized.

----

I'm not 100% sure about the usage for opaque types as the [nomicon](https://doc.rust-lang.org/nomicon/ffi.html#representing-opaque-structs) still recommends using `#[repr(C)] pub struct Foo { _private: [u8; 0] }` but it seems like these two should be equivalent in the end? Also the `#[repr(C)]` (in both cases) should be unneeded because such types never being passed by value, never being dereferenced but only passed around as pointer or reference, so the representation of (*values* of) the type itself should not matter at all?

Also in context of `c_void` and `!` the second unresolved question in the [`extern type`](https://github.com/rust-lang/rust/issues/43467) stabilization ticket seems relevant

> In [std's](164619a8cf/src/libstd/os/raw.rs (L59-L64)) source, it is mentioned that LLVM expects i8* for C's void*.
> We'd need to continue to hack this for the two c_voids in std and libc.
> But perhaps this should be done across-the-board for all extern types?
> Somebody should check what Clang does.

Please correct me if my understanding is wrong and everything's actually fine as is.
2019-01-18 18:06:26 +01:00
..
bootstrap Adding Build automation for x86_64-fortanix-unknown-sgx 2019-01-13 13:07:45 +05:30
build_helper Remove licenses 2018-12-25 21:08:33 -07:00
ci Revert "Auto merge of #57670 - rust-lang:beta-next, r=Mark-Simulacrum" 2019-01-17 10:48:10 +01:00
doc Auto merge of #57520 - alexreg:tidy-copyright-lint, r=Mark-Simulacrum 2019-01-17 07:36:37 +00:00
etc rustc: Remove platform intrinsics crate 2019-01-14 09:54:23 -08:00
grammar Remove licenses 2018-12-25 21:08:33 -07:00
liballoc Rollup merge of #57456 - fintelia:patch-4, r=dtolnay 2019-01-15 12:42:07 +01:00
libarena Check the correct arena 2019-01-01 20:06:50 +01:00
libcore Rollup merge of #56594 - sdroege:c_void-is-not-never, r=TimNN 2019-01-18 18:06:26 +01:00
libfmt_macros Point at correct span for arguments in format strings 2018-12-26 20:36:02 -08:00
libgraphviz Remove licenses 2018-12-25 21:08:33 -07:00
libpanic_abort Stabilize cfg_target_vendor, #29718 2019-01-14 14:33:04 +05:30
libpanic_unwind Remove licenses 2018-12-25 21:08:33 -07:00
libproc_macro Work-around for shadowing of variant names with assoc const names in libproc_macro/bridge/rpc.rs. 2018-12-26 21:40:21 +00:00
libprofiler_builtins Remove licenses 2018-12-25 21:08:33 -07:00
librustc Auto merge of #57065 - Zoxc:graph-tweaks, r=michaelwoerister 2019-01-18 11:34:11 +00:00
librustc_allocator Remove licenses 2018-12-25 21:08:33 -07:00
librustc_apfloat Fix repeated word typos 2019-01-03 21:33:37 +01:00
librustc_asan Remove licenses 2018-12-25 21:08:33 -07:00
librustc_borrowck Rollup merge of #57102 - davidtwco:issue-57100, r=nikomatsakis 2019-01-13 17:21:40 +01:00
librustc_codegen_llvm rustc: Remove platform intrinsics crate 2019-01-14 09:54:23 -08:00
librustc_codegen_ssa Querify local plugin_registrar_fn 2019-01-13 23:53:58 +01:00
librustc_codegen_utils Rollup merge of #57570 - Xanewok:querify-some, r=Zoxc 2019-01-14 20:31:56 +01:00
librustc_cratesio_shim Remove licenses 2018-12-25 21:08:33 -07:00
librustc_data_structures Optimize try_mark_green and eliminate the lock on dep node colors 2019-01-15 10:39:49 +01:00
librustc_driver Auto merge of #57392 - Xanewok:always-calc-glob-map, r=petrochenkov 2019-01-16 23:25:41 +00:00
librustc_errors Replace LockCell with atomic types 2018-12-29 12:46:37 +01:00
librustc_fs_util Remove licenses 2018-12-25 21:08:33 -07:00
librustc_incremental Clean up and optimize OpenTask / read_index 2018-12-31 16:24:22 +01:00
librustc_lint Auto merge of #57321 - petrochenkov:atokens, r=nikomatsakis 2019-01-16 15:01:20 +00:00
librustc_llvm Rollup merge of #57369 - petrhosek:llvm-libcxx, r=alexcrichton 2019-01-07 16:25:38 +01:00
librustc_lsan Remove licenses 2018-12-25 21:08:33 -07:00
librustc_metadata Querify local plugin_registrar_fn 2019-01-13 23:53:58 +01:00
librustc_mir Rollup merge of #56044 - matthewjasper:function-param-drop-order, r=cramertj 2019-01-15 12:42:04 +01:00
librustc_msan Remove licenses 2018-12-25 21:08:33 -07:00
librustc_passes Auto merge of #51487 - Zoxc:incr-passes, r=michaelwoerister 2019-01-13 19:43:46 +00:00
librustc_plugin Auto merge of #57321 - petrochenkov:atokens, r=nikomatsakis 2019-01-16 15:01:20 +00:00
librustc_privacy privacy: Fix private-in-public check for existential types 2019-01-13 00:41:11 +03:00
librustc_resolve Auto merge of #57392 - Xanewok:always-calc-glob-map, r=petrochenkov 2019-01-16 23:25:41 +00:00
librustc_save_analysis Auto merge of #57392 - Xanewok:always-calc-glob-map, r=petrochenkov 2019-01-16 23:25:41 +00:00
librustc_target Remove licenses 2018-12-25 21:08:33 -07:00
librustc_traits Auto merge of #56837 - arielb1:nonprincipal-trait-objects, r=nikomatsakis 2019-01-05 03:36:31 +00:00
librustc_tsan Remove licenses 2018-12-25 21:08:33 -07:00
librustc_typeck Auto merge of #57321 - petrochenkov:atokens, r=nikomatsakis 2019-01-16 15:01:20 +00:00
librustdoc Auto merge of #56869 - GuillaumeGomez:index-size-reduction, r=QuietMisdreavus 2019-01-17 02:12:17 +00:00
libserialize Cosmetic improvements 2019-01-13 19:47:02 +00:00
libstd Auto merge of #56996 - clarcharr:spin_loop_hint, r=KodrAus 2019-01-18 07:36:13 +00:00
libsyntax Auto merge of #57520 - alexreg:tidy-copyright-lint, r=Mark-Simulacrum 2019-01-17 07:36:37 +00:00
libsyntax_ext Auto merge of #57321 - petrochenkov:atokens, r=nikomatsakis 2019-01-16 15:01:20 +00:00
libsyntax_pos remove extern_in_paths. 2019-01-13 14:18:00 +01:00
libterm Implement basic input validation for built-in attributes 2019-01-13 14:17:19 +03:00
libtest Stabilize cfg_target_vendor, #29718 2019-01-14 14:33:04 +05:30
libunwind Stabilize cfg_target_vendor, #29718 2019-01-14 14:33:04 +05:30
llvm@f4728ed8fa Update LLVM submodule 2018-12-18 15:26:10 +05:30
llvm-emscripten@7f23313edf
rtstartup Remove licenses 2018-12-25 21:08:33 -07:00
rustc rustc: Fix regression where jemalloc isn't used 2019-01-03 13:52:36 -08:00
rustllvm Remove licenses 2018-12-25 21:08:33 -07:00
stdsimd@269d0ba959 Update stdsimd submodule 2019-01-08 20:24:15 +01:00
test Auto merge of #57520 - alexreg:tidy-copyright-lint, r=Mark-Simulacrum 2019-01-17 07:36:37 +00:00
tools Auto merge of #57694 - pietroalbini:revert-beta-on-master, r=pietroalbini 2019-01-17 10:15:57 +00:00
.gitignore
README.md
stage0.txt Revert "Auto merge of #57670 - rust-lang:beta-next, r=Mark-Simulacrum" 2019-01-17 10:48:10 +01: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: