rust/src
Manish Goregaokar 5751c7f1db
Rollup merge of #74033 - ehuss:std-compile-all-platforms, r=Mark-Simulacrum
Add build support for Cargo's build-std feature.

This makes some changes to the standard library to make it easier to use with Cargo's build-std feature. The primary goal is to make it so that Cargo and its users do not need to know which crates to build and which features to use for every platform.

Conditional cfgs are adjusted so that there is usually a fall-through for unsupported platforms. Additionally, there is a "restricted-std" feature to mark `std` as unstable when used with build-std on no_std platforms. There is no intent to stabilize this feature for the foreseeable future.

This borrows some of the implementation for wasm which already does what this needs. More code sharing can be done with some other platforms (there is a lot of duplication with cloudabi, hermit, and sgx), but I figure that can be done in a future PR.

There are some small changes to stable behavior in this PR:
- `std::env::consts::ARCH` on asmjs now reports "wasm32", to match its actual architecture.
- Some of the wasm error messages for unsupported features report a slightly different error message so that the code can be reused.

There should otherwise not be any changes to how std is built for distribution via bootstrap.

This does not yet support all platforms when used with build-std.

- It doesn't work with 16-bit targets (hashbrown does not support that).
- It does not work with JSON spec targets.
    - In particular, all target triple snooping will need to be replaced with appropriate target option checking.
- Switching to gimli (#73441) will make cross-building *much* easier.
- There are still a ton of issues on the Cargo side to resolve. A big one is panic strategy support.

Future PRs are intended to address some of these issues.
2020-07-16 17:08:57 -07:00
..
bootstrap Rollup merge of #74352 - ehuss:fix-alloc-links, r=Mark-Simulacrum 2020-07-16 00:01:09 -07:00
build_helper
ci Set shell for github actions CI 2020-07-16 13:53:02 -04:00
doc Revert "Remove "important traits" feature" 2020-07-16 09:58:17 -07:00
etc Rollup merge of #73715 - MaulingMonkey:pr-natvis-tuples, r=Amanieu 2020-07-11 08:53:13 -07:00
liballoc Separate off BTreeMap support functions and loose their irrelevant bounds 2020-07-16 12:53:01 +02:00
libcore Rollup merge of #74390 - ColoredCarrot:patch-1, r=lcnr 2020-07-16 11:18:57 -07:00
libpanic_abort Tweak formatting. 2020-07-15 09:57:10 -07:00
libpanic_unwind Use an allow-list of platforms that support std. 2020-07-15 09:57:10 -07:00
libproc_macro Introduce restricted-std feature. 2020-07-15 09:57:05 -07:00
libprofiler_builtins Prepare for LLVM 11 2020-06-25 18:52:41 -07:00
librustc_apfloat Migrate to numeric associated consts 2020-06-10 01:35:47 +00:00
librustc_arena Rollup merge of #73378 - matthewjasper:arena-not-special, r=oli-obk 2020-06-20 14:45:00 -07:00
librustc_ast Remove lots of Symbol::as_str() calls. 2020-07-15 09:01:35 +10:00
librustc_ast_lowering Suggest borrowing in more unsized fn param cases 2020-07-14 10:50:24 -07:00
librustc_ast_passes Revert "Remove spotlight usage" 2020-07-16 09:58:34 -07:00
librustc_ast_pretty Auto merge of #74175 - nnethercote:more-static-symbols, r=oli-obk 2020-07-15 00:16:25 +00:00
librustc_attr Add and use more static symbols. 2020-07-15 08:42:59 +10:00
librustc_builtin_macros Add and use more static symbols. 2020-07-15 08:42:59 +10:00
librustc_codegen_llvm Undo the const_str changes from the previous commit. 2020-07-15 14:38:00 +10:00
librustc_codegen_ssa Auto merge of #74113 - lcnr:type-dependent-consts-2, r=eddyb 2020-07-15 12:49:25 +00:00
librustc_data_structures Rollup merge of #73984 - pierwill:pierwill-tarjan, r=jonas-schievink 2020-07-03 17:17:05 -07:00
librustc_driver Rollup merge of #74037 - JohnTitor:contributing-md, r=Mark-Simulacrum 2020-07-16 00:01:04 -07:00
librustc_error_codes Rollup merge of #74159 - lcnr:const-generic-ty-decl, r=varkor 2020-07-16 11:18:46 -07:00
librustc_errors Rollup merge of #74079 - nnethercote:session-globals, r=nikomatsakis 2020-07-09 11:50:32 -07:00
librustc_expand Remove lots of Symbol::as_str() calls. 2020-07-15 09:01:35 +10:00
librustc_feature Revert "Remove "important traits" feature" 2020-07-16 09:58:17 -07:00
librustc_fs_util
librustc_graphviz Rename the crates in source code 2020-06-02 20:42:54 +03:00
librustc_hir relax Node lt bounds 2020-07-16 11:13:05 +02:00
librustc_hir_pretty Remove lots of Symbol::as_str() calls. 2020-07-15 09:01:35 +10:00
librustc_incremental mir_built is a lie 2020-07-15 12:58:32 +02:00
librustc_index Use ArrayVec in SparseBitSet. 2020-07-14 10:31:54 +10:00
librustc_infer improve naming 2020-07-15 13:06:47 +02:00
librustc_interface Rollup merge of #73566 - jyn514:name-resolve-first, r=eddyb 2020-07-16 11:18:24 -07:00
librustc_lexer Rollup merge of #73856 - pierwill:pierwill-lexer-doc, r=jonas-schievink 2020-07-06 17:45:17 -07:00
librustc_lint Auto merge of #74175 - nnethercote:more-static-symbols, r=oli-obk 2020-07-15 00:16:25 +00:00
librustc_llvm RISC-V GNU/Linux as host platform 2020-07-11 17:30:02 +07:00
librustc_macros Enforce the static symbol order. 2020-07-16 16:53:24 +10:00
librustc_metadata Auto merge of #74113 - lcnr:type-dependent-consts-2, r=eddyb 2020-07-15 12:49:25 +00:00
librustc_middle Auto merge of #74202 - oli-obk:mir_const, r=RalfJung 2020-07-16 10:18:24 +00:00
librustc_mir Rollup merge of #74221 - oli-obk:const_prop_ice, r=wesleywiser 2020-07-16 11:18:50 -07:00
librustc_mir_build WithOptConstParam::dummy -> WithOptConstParam::unknown 2020-07-15 13:06:47 +02:00
librustc_parse Rollup merge of #74337 - estebank:ty-parse-recovery, r=varkor 2020-07-15 11:01:26 -07:00
librustc_parse_format Eliminate confusing "globals" terminology. 2020-07-09 14:11:44 +10:00
librustc_passes Rollup merge of #74033 - ehuss:std-compile-all-platforms, r=Mark-Simulacrum 2020-07-16 17:08:57 -07:00
librustc_plugin_impl Use for<'tcx> fn pointers in Providers, instead of having Providers<'tcx>. 2020-07-05 23:00:14 +03:00
librustc_privacy Use for<'tcx> fn pointers in Providers, instead of having Providers<'tcx>. 2020-07-05 23:00:14 +03:00
librustc_query_system Remove const_if_match feature gate from libraries 2020-06-28 10:08:09 -07:00
librustc_resolve unwrap() -> expect() 2020-07-16 18:26:57 -04:00
librustc_save_analysis Remove lots of Symbol::as_str() calls. 2020-07-15 09:01:35 +10:00
librustc_serialize Use min_specialization in the remaining rustc crates 2020-06-10 09:05:52 +01:00
librustc_session Remove lots of Symbol::as_str() calls. 2020-07-15 09:01:35 +10:00
librustc_span Revert "Remove spotlight usage" 2020-07-16 09:58:34 -07:00
librustc_symbol_mangling Change SymbolName::name to a &str. 2020-07-15 14:37:55 +10:00
librustc_target don't mark linux kernel module targets as a unix environment 2020-07-11 17:20:33 -04:00
librustc_trait_selection Rename sym::item_context as sym::ItemContext. 2020-07-16 16:53:31 +10:00
librustc_traits Use for<'tcx> fn pointers in Providers, instead of having Providers<'tcx>. 2020-07-05 23:00:14 +03:00
librustc_ty WithOptConstParam::dummy -> WithOptConstParam::unknown 2020-07-15 13:06:47 +02:00
librustc_typeck Rollup merge of #74159 - lcnr:const-generic-ty-decl, r=varkor 2020-07-16 11:18:46 -07:00
librustdoc Add more debugging 2020-07-16 18:26:58 -04:00
libstd Rollup merge of #74033 - ehuss:std-compile-all-platforms, r=Mark-Simulacrum 2020-07-16 17:08:57 -07:00
libterm
libtest Rollup merge of #74033 - ehuss:std-compile-all-platforms, r=Mark-Simulacrum 2020-07-16 17:08:57 -07:00
libunwind Use an allow-list of platforms that support std. 2020-07-15 09:57:10 -07:00
llvm-project@86b120e6f3 Update llvm-project to latest origin/rustc/10.0-2020-05-05 commit which includes LVI segfault fix 2020-07-12 18:49:14 +00:00
rtstartup
rustc
rustllvm Rollup merge of #73715 - MaulingMonkey:pr-natvis-tuples, r=Amanieu 2020-07-11 08:53:13 -07:00
stdarch@45340c0e2f Update stdarch submodule to latest head 2020-05-31 00:12:59 +02:00
test Rollup merge of #73269 - mzohreva:mz/sgx-wait-timeout, r=jethrogb 2020-07-16 17:08:56 -07:00
tools Rollup merge of #74033 - ehuss:std-compile-all-platforms, r=Mark-Simulacrum 2020-07-16 17:08:57 -07:00
README.md
stage0.txt Update bootstrap to rustc 1.45.0-beta.2 (1dc0f6d8e 2020-06-15) 2020-06-20 11:13:47 -07: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 dev guide.