rust/src
Rich Kadel a6f8b8a211 Generating the coverage map
rustc now generates the coverage map and can support (limited)
coverage report generation, at the function level.

Example:

$ BUILD=$HOME/rust/build/x86_64-unknown-linux-gnu
$ $BUILD/stage1/bin/rustc -Zinstrument-coverage \
$HOME/rust/src/test/run-make-fulldeps/instrument-coverage/main.rs
$ LLVM_PROFILE_FILE="main.profraw" ./main
called
$ $BUILD/llvm/bin/llvm-profdata merge -sparse main.profraw -o main.profdata
$ $BUILD/llvm/bin/llvm-cov show --instr-profile=main.profdata main
    1|      1|pub fn will_be_called() {
    2|      1|    println!("called");
    3|      1|}
    4|       |
    5|      0|pub fn will_not_be_called() {
    6|      0|    println!("should not have been called");
    7|      0|}
    8|       |
    9|      1|fn main() {
   10|      1|    let less = 1;
   11|      1|    let more = 100;
   12|      1|
   13|      1|    if less < more {
   14|      1|        will_be_called();
   15|      1|    } else {
   16|      1|        will_not_be_called();
   17|      1|    }
   18|      1|}
2020-07-17 11:49:35 -07:00
..
bootstrap Generating the coverage map 2020-07-17 11:49:35 -07:00
build_helper
ci Auto merge of #74395 - Mark-Simulacrum:stage0-next, r=pietroalbini 2020-07-17 03:51:35 +00:00
doc Revert "Remove "important traits" feature" 2020-07-16 09:58:17 -07:00
etc
liballoc Auto merge of #74395 - Mark-Simulacrum:stage0-next, r=pietroalbini 2020-07-17 03:51:35 +00:00
libcore Generating the coverage map 2020-07-17 11:49:35 -07:00
libpanic_abort Auto merge of #74395 - Mark-Simulacrum:stage0-next, r=pietroalbini 2020-07-17 03:51:35 +00:00
libpanic_unwind Auto merge of #74395 - Mark-Simulacrum:stage0-next, r=pietroalbini 2020-07-17 03:51:35 +00:00
libproc_macro Introduce restricted-std feature. 2020-07-15 09:57:05 -07:00
libprofiler_builtins
librustc_apfloat
librustc_arena
librustc_ast apply bootstrap cfgs 2020-07-16 19:36:49 -04: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 Remove ExtCtxt::ident_of. 2020-07-17 08:28:19 +10:00
librustc_codegen_llvm Generating the coverage map 2020-07-17 11:49:35 -07:00
librustc_codegen_ssa Generating the coverage map 2020-07-17 11:49:35 -07:00
librustc_data_structures
librustc_driver apply bootstrap cfgs 2020-07-16 19:36:49 -04:00
librustc_error_codes Rollup merge of #74398 - GuillaumeGomez:cleanup-e0723, r=Dylan-DPC 2020-07-16 17:09:06 -07:00
librustc_errors apply bootstrap cfgs 2020-07-16 19:36:49 -04:00
librustc_expand Remove ExtCtxt::ident_of. 2020-07-17 08:28:19 +10:00
librustc_feature Revert "Remove "important traits" feature" 2020-07-16 09:58:17 -07:00
librustc_fs_util
librustc_graphviz
librustc_hir Generating the coverage map 2020-07-17 11:49:35 -07: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 apply bootstrap cfgs 2020-07-16 19:36:49 -04:00
librustc_infer apply bootstrap cfgs 2020-07-16 19:36:49 -04:00
librustc_interface Generating the coverage map 2020-07-17 11:49:35 -07:00
librustc_lexer
librustc_lint apply bootstrap cfgs 2020-07-16 19:36:49 -04:00
librustc_llvm Generating the coverage map 2020-07-17 11:49:35 -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 Generating the coverage map 2020-07-17 11:49:35 -07:00
librustc_mir Generating the coverage map 2020-07-17 11:49:35 -07:00
librustc_mir_build apply bootstrap cfgs 2020-07-16 19:36:49 -04:00
librustc_parse Rollup merge of #74337 - estebank:ty-parse-recovery, r=varkor 2020-07-15 11:01:26 -07:00
librustc_parse_format
librustc_passes Generating the coverage map 2020-07-17 11:49:35 -07:00
librustc_plugin_impl
librustc_privacy apply bootstrap cfgs 2020-07-16 19:36:49 -04:00
librustc_query_system apply bootstrap cfgs 2020-07-16 19:36:49 -04:00
librustc_resolve unwrap() -> expect() 2020-07-16 18:26:57 -04:00
librustc_save_analysis apply bootstrap cfgs 2020-07-16 19:36:49 -04:00
librustc_serialize
librustc_session Generating the coverage map 2020-07-17 11:49:35 -07:00
librustc_span Auto merge of #74395 - Mark-Simulacrum:stage0-next, r=pietroalbini 2020-07-17 03:51:35 +00:00
librustc_symbol_mangling Change SymbolName::name to a &str. 2020-07-15 14:37:55 +10:00
librustc_target apply bootstrap cfgs 2020-07-16 19:36:49 -04:00
librustc_trait_selection Remove some Symbol:as_str() calls. 2020-07-17 08:29:58 +10:00
librustc_traits
librustc_ty WithOptConstParam::dummy -> WithOptConstParam::unknown 2020-07-15 13:06:47 +02:00
librustc_typeck Generating the coverage map 2020-07-17 11:49:35 -07:00
librustdoc Record visibility of reexports for all items, not just type items 2020-07-16 22:22:40 -07:00
libstd Auto merge of #74395 - Mark-Simulacrum:stage0-next, r=pietroalbini 2020-07-17 03:51:35 +00: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
rtstartup
rustc
rustllvm Generating the coverage map 2020-07-17 11:49:35 -07:00
stdarch@45340c0e2f
test Generating the coverage map 2020-07-17 11:49:35 -07:00
tools Generating the coverage map 2020-07-17 11:49:35 -07:00
README.md
stage0.txt Bump to 1.47 2020-07-16 19:36:49 -04: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.