Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a -Zdump-drop-tracking-cfg debugging flag #98533

Merged
merged 2 commits into from
Jul 8, 2022

Conversation

jyn514
Copy link
Member

@jyn514 jyn514 commented Jun 26, 2022

This is useful for debugging drop-tracking; previously, you had to recompile
rustc from source and manually add a call to write_graph_to_file. This
makes the option more discoverable and configurable at runtime.

I also took the liberty of making the labels for the CFG nodes much easier to read:
previously, they looked like id(2), local_id: 48, now they look like

expr from_config (hir_id=HirId { owner: DefId(0:10 ~ default_struct_update[79f9]::foo), local_id: 2})

r? @eholk

This is useful for debugging drop-tracking; previously, you had to recompile
rustc from source and manually add a call to `write_graph_to_file`. This
makes the option more discoverable and configurable at runtime.

I also took the liberty of making the labels for the CFG nodes much easier to read:
previously, they looked like `id(2), local_id: 48`, now they look like
```
expr from_config (hir_id=HirId { owner: DefId(0:10 ~ default_struct_update[79f9]::foo), local_id: 2})
```
@jyn514 jyn514 added T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. A-async-await Area: Async & Await A-contributor-roadblock Area: Makes things more difficult for new contributors to rust itself A-control-flow Area: Relating to control flow labels Jun 26, 2022
@jyn514
Copy link
Member Author

jyn514 commented Jun 26, 2022

@bors delegate=eholk

@bors
Copy link
Contributor

bors commented Jun 26, 2022

✌️ @eholk can now approve this pull request

Some of these are a little questionable because the output is so much longer, but I would really love to keep the bit that adds the pretty-printed expression to the generated CFG .dot file.

Before:
```
DEBUG rustc_typeck::check::generator_interior::drop_ranges::record_consumed_borrow consume PlaceWithHirId { hir_id: HirId { owner: DefId(0:7 ~ default_struct_update[79f9]::foo), local_id: 15 }, place: Place { base_ty: impl std::future::Future<Output = ()>, base: Rvalue, projections: [] } }; diag_expr_id=HirId { owner: DefId(0:7 ~ default_struct_update[79f9]::foo), local_id: 15 }, using parent expr HirId { owner: DefId(0:7 ~ default_struct_update[79f9]::foo), local_id: 49 }
```

After:
```
DEBUG rustc_typeck::check::generator_interior::drop_ranges::record_consumed_borrow consume PlaceWithHirId { hir_id: HirId { owner: DefId(0:7 ~ default_struct_update[79f9]::foo), local_id: 15 }, place: Place { base_ty: impl std::future::Future<Output = ()>, base: Rvalue, projections: [] } }; diag_expr_id=expr from_config(Config {
        nickname: None,
        ..Default::default()
    }) (hir_id=HirId { owner: DefId(0:7 ~ default_struct_update[79f9]::foo), local_id: 15 }), using parent expr
    .await (hir_id=HirId { owner: DefId(0:7 ~ default_struct_update[79f9]::foo), local_id: 49 })
```
@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu-llvm-12 failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)

---- [ui] src/test/rustdoc-ui/issue-83883-describe-lints.rs stdout ----
diff of stdout:

21     -W                           drop-tracking=val -- enables drop tracking in generators (default: no)
22     -W                        dual-proc-macros=val -- load proc macros for both target and host, but only link to the target (default: no)
23     -W                          dump-dep-graph=val -- dump the dependency graph to $RUST_DEP_GRAPH (default: /tmp/dep_graph.gv) (default: no)
+     -W                  dump-drop-tracking-cfg=val -- dump drop-tracking control-flow graph as a `.dot` file (default: no)
24     -W                                dump-mir=val -- dump MIR state to file.
25         `val` is used to select which passes and functions to dump. For example:
26         `all` matches all passes and functions,

The actual stdout differed from the expected stdout.
Actual stdout saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/rustdoc-ui/issue-83883-describe-lints/issue-83883-describe-lints.stdout
To update references, rerun the tests and pass the `--bless` flag
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args issue-83883-describe-lints.rs`

error: 1 errors occurred comparing output.
status: exit status: 0
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustdoc" "/checkout/src/test/rustdoc-ui/issue-83883-describe-lints.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Cstrip=debuginfo" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/rustdoc-ui/issue-83883-describe-lints" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-W" "help" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/rustdoc-ui/issue-83883-describe-lints/auxiliary"
--- stdout -------------------------------
-W                          allow-features=val -- only allow the listed language features to be enabled in code (space separated)
    -W                       always-encode-mir=val -- encode MIR of all functions into the crate metadata (default: no)
    -W               assume-incomplete-release=val -- make cfg(version) treat the current version as incomplete (default: no)
    -W                            asm-comments=val -- generate comments into the assembly (may change behavior) (default: no)
    -W                       assert-incr-state=val -- assert that the incremental cache is in given state: either `loaded` or `not-loaded`.
    -W                      binary-dep-depinfo=val -- include artifacts (sysroot, crate dependencies) used during compilation in dep-info (default: no)
    -W                       branch-protection=val -- set options for branch target identification and pointer authentication on AArch64
    -W                           cf-protection=val -- instrument control-flow architecture protection
    -W               cgu-partitioning-strategy=val -- the codegen unit partitioning strategy to use
    -W                                   chalk=val -- enable the experimental Chalk-based trait solving engine
    -W                         codegen-backend=val -- the backend to use
    -W                             combine-cgu=val -- combine CGUs into a single one
    -W                              crate-attr=val -- inject the given attribute in the crate
    -W                debug-info-for-profiling=val -- emit discriminators and other data necessary for AutoFDO
    -W                            debug-macros=val -- emit line numbers debug info inside macros (default: no)
    -W                 deduplicate-diagnostics=val -- deduplicate identical diagnostics (default: yes)
    -W                  dep-info-omit-d-target=val -- in dep-info output, omit targets for tracking dependencies of the dep-info files themselves (default: no)
    -W                               dep-tasks=val -- print tasks that execute and the color their dep node gets (requires debug build) (default: no)
    -W                                 dlltool=val -- import library generation tool (windows-gnu only)
    -W                 dont-buffer-diagnostics=val -- emit diagnostics rather than buffering (breaks NLL error downgrading, sorting) (default: no)
    -W                           drop-tracking=val -- enables drop tracking in generators (default: no)
    -W                        dual-proc-macros=val -- load proc macros for both target and host, but only link to the target (default: no)
    -W                          dump-dep-graph=val -- dump the dependency graph to $RUST_DEP_GRAPH (default: /tmp/dep_graph.gv) (default: no)
    -W                  dump-drop-tracking-cfg=val -- dump drop-tracking control-flow graph as a `.dot` file (default: no)
    -W                                dump-mir=val -- dump MIR state to file.
        `val` is used to select which passes and functions to dump. For example:
        `all` matches all passes and functions,
        `foo` matches all passes for functions whose name contains 'foo',
        `foo & ConstProp` only the 'ConstProp' pass for function names containing 'foo',
        `foo | bar` all passes for function names containing 'foo' or 'bar'.
    -W                       dump-mir-dataflow=val -- in addition to `.mir` files, create graphviz `.dot` files with dataflow results (default: no)
    -W                            dump-mir-dir=val -- the directory the MIR is dumped into (default: `mir_dump`)
    -W            dump-mir-exclude-pass-number=val -- exclude the pass number when dumping MIR (used in tests) (default: no)
    -W                       dump-mir-graphviz=val -- in addition to `.mir` files, create graphviz `.dot` files (and with `-Z instrument-coverage`, also create a `.dot` file for the MIR-derived coverage graph) (default: no)
    -W                       dump-mir-spanview=val -- in addition to `.mir` files, create `.html` files to view spans for all `statement`s (including terminators), only `terminator` spans, or computed `block` spans (one span encompassing a block's terminator and all statements). If `-Z instrument-coverage` is also enabled, create an additional `.html` file showing the computed coverage spans.
    -W                        emit-stack-sizes=val -- emit a section containing stack size metadata (default: no)
    -W                             fewer-names=val -- reduce memory use by retaining fewer names within compilation artifacts (LLVM-IR) (default: no)
    -W              force-unstable-if-unmarked=val -- force all crates to be `rustc_private` unstable (default: no)
    -W                                    fuel=val -- set the optimization fuel quota for a crate
    -W                       function-sections=val -- whether each function should go in its own section
    -W                    future-incompat-test=val -- forces all lints to be future incompatible, used for internal testing (default: no)
    -W                                  gcc-ld=val -- implementation of ld used by cc
    -W                      graphviz-dark-mode=val -- use dark-themed colors in graphviz output (default: no)
    -W                           graphviz-font=val -- use the given `fontname` in graphviz output; can be overridden by setting environment variable `RUSTC_GRAPHVIZ_FONT` (default: `Courier, monospace`)
    -W                               hir-stats=val -- print some statistics about AST and HIR (default: no)
    -W                human-readable-cgu-names=val -- generate human-readable, predictable names for codegen units (default: no)
    -W                        identify-regions=val -- display unnamed regions as `'<id>`, using a non-ident unique id (default: no)
    -W                incremental-ignore-spans=val -- ignore spans during ICH computation -- used for testing (default: no)
    -W                        incremental-info=val -- print high-level information about incremental reuse (or the lack thereof) (default: no)
    -W              incremental-relative-spans=val -- hash spans relative to their parent item for incr. comp. (default: no)
    -W                  incremental-verify-ich=val -- verify incr. comp. hashes of green query instances (default: no)
    -W                              inline-mir=val -- enable MIR inlining (default: no)
    -W                    inline-mir-threshold=val -- a default MIR inlining threshold (default: 50)
    -W               inline-mir-hint-threshold=val -- inlining threshold for functions with inline hint (default: 100)
    -W                      inline-in-all-cgus=val -- control whether `#[inline]` functions are in all CGUs
    -W                             input-stats=val -- gather statistics about the input (default: no)
    -W                     instrument-coverage=val -- instrument the generated code to support LLVM source-based code coverage reports (note, the compiler build config must include `profiler = true`); implies `-C symbol-mangling-version=v0`. Optional values are:
        `=all` (implicit value)
        `=except-unused-generics`
        `=except-unused-functions`
        `=off` (default)
    -W                       instrument-mcount=val -- insert function instrument code for mcount-based tracing (default: no)
    -W                       keep-hygiene-data=val -- keep hygiene data after analysis (default: no)
    -W                   link-native-libraries=val -- link native libraries in the linker invocation (default: yes)
    -W                               link-only=val -- link the `.rlink` file generated by `-Z no-link` (default: no)
    -W                            llvm-plugins=val -- a list LLVM plugins to enable (space separated)
    -W                         llvm-time-trace=val -- generate JSON tracing data file from LLVM data (default: no)
    -W                         location-detail=val -- comma separated list of location details to be tracked when using caller_location valid options are `file`, `line`, and `column` (default: all)
    -W                                      ls=val -- list the symbols defined by a library crate (default: no)
    -W                         macro-backtrace=val -- show macro backtraces (default: no)
    -W                         merge-functions=val -- control the operation of the MergeFunctions LLVM pass, taking the same values as the target option of the same name
    -W                              meta-stats=val -- gather metadata statistics (default: no)
    -W                          mir-emit-retag=val -- emit Retagging MIR statements, interpreted e.g., by miri; implies -Zmir-opt-level=0 (default: no)
    -W                       mir-enable-passes=val -- use like `-Zmir-enable-passes=+DestProp,-InstCombine`. Forces the specified passes to be enabled, overriding all other checks. Passes that are not specified are enabled or disabled by other flags as usual.
    -W                           mir-opt-level=val -- MIR optimization level (0-4; default: 1 in non optimized builds and 2 in optimized builds)
    -W                         move-size-limit=val -- the size at which the `large_assignments` lint starts to be emitted
    -W                         mutable-noalias=val -- emit noalias metadata for mutable references (default: yes)
    -W                   new-llvm-pass-manager=val -- use new LLVM pass manager (default: no)
    -W                               nll-facts=val -- dump facts from NLL analysis into side files (default: no)
    -W                           nll-facts-dir=val -- the directory the NLL facts are dumped into (default: `nll-facts`)
    -W                             no-analysis=val -- parse and expand the source, but run no analysis
    -W                              no-codegen=val -- run all passes except codegen; no output
    -W              no-generate-arange-section=val -- omit DWARF address ranges that give faster lookups
    -W                     no-interleave-lints=val -- execute lints separately; allows benchmarking individual lints
    -W                           no-leak-check=val -- disable the 'leak check' for subtyping; unsound, but useful for tests
    -W                                 no-link=val -- compile without linking
    -W                        no-parallel-llvm=val -- run LLVM in non-parallel mode (while keeping codegen-units and ThinLTO)
    -W                 no-unique-section-names=val -- do not use unique names for text and data sections when -Z function-sections is used
    -W                     no-profiler-runtime=val -- prevent automatic injection of the profiler_builtins crate
    -W                          normalize-docs=val -- normalize associated items in rustdoc when generating documentation
    -W                                     oom=val -- panic strategy for out-of-memory handling
    -W                  osx-rpath-install-name=val -- pass `-install_name @rpath/...` to the macOS linker (default: no)
    -W                       panic-abort-tests=val -- support compiling tests with panic=abort (default: no)
    -W                           panic-in-drop=val -- panic strategy for panics in drops
    -W                              parse-only=val -- parse only; do not compile, assemble, or link (default: no)
    -W                              perf-stats=val -- print some performance-related statistics (default: no)
    -W pick-stable-methods-before-any-unstable=val -- try to pick stable methods first before picking any unstable methods (default: yes)
    -W                                     plt=val -- whether to use the PLT when calling into shared libraries;
        only has effect for PIC code on systems with ELF binaries
        (default: PLT is disabled if full relro is enabled)
    -W                                polonius=val -- enable polonius-based borrow-checker (default: no)
    -W                            polymorphize=val -- perform polymorphization analysis
    -W                            pre-link-arg=val -- a single extra argument to prepend the linker invocation (can be used several times)
    -W                           pre-link-args=val -- extra arguments to prepend to the linker invocation (space separated)
    -W           precise-enum-drop-elaboration=val -- use a more precise version of drop elaboration for matches on enums (default: yes). This results in better codegen, but has caused miscompilations on some tier 2 platforms. See #77382 and #74551.
    -W                              print-fuel=val -- make rustc print the total optimization fuel used by a crate
    -W                       print-llvm-passes=val -- print the LLVM optimization passes being run (default: no)
    -W                        print-mono-items=val -- print the result of the monomorphization collection pass
    -W                        print-type-sizes=val -- print layout information for each type encountered (default: no)
    -W                    proc-macro-backtrace=val -- show backtraces for panics during proc-macro execution (default: no)
    -W                                 profile=val -- insert profiling code (default: no)
    -W                        profile-closures=val -- profile size of closures
    -W                            profile-emit=val -- file path to emit profiling data at runtime when using 'profile' (default based on relative source path)
    -W                        profiler-runtime=val -- name of the profiler runtime crate to automatically inject (default: `profiler_builtins`)
    -W                      profile-sample-use=val -- use the given `.prof` file for sampled profile-guided optimization (also known as AutoFDO)
    -W                         query-dep-graph=val -- enable queries of the dependency graph for regression testing (default: no)
    -W                        randomize-layout=val -- randomize the layout of types (default: no)
    -W                             layout-seed=val -- seed layout randomization
    -W                   relax-elf-relocations=val -- whether ELF relocations can be relaxed
    -W                             relro-level=val -- choose which RELRO level to use
    -W                        remap-cwd-prefix=val -- remap paths under the current working directory to this path prefix
    -W         simulate-remapped-rust-src-base=val -- simulate the effect of remap-debuginfo = true at bootstrapping by remapping path to rust's source base directory. only meant for testing purposes
    -W                     report-delayed-bugs=val -- immediately print bugs registered with `delay_span_bug` (default: no)
    -W                               sanitizer=val -- use a sanitizer
    -W          sanitizer-memory-track-origins=val -- enable origins tracking in MemorySanitizer
    -W                       sanitizer-recover=val -- enable recovery for selected sanitizers
    -W                  saturating-float-casts=val -- make float->int casts UB-free: numbers outside the integer type's range are clipped to the max/min integer respectively, and NaN is mapped to 0 (default: yes)
    -W                           save-analysis=val -- write syntax and type analysis (in JSON format) information, in addition to normal output (default: no)
    -W                            self-profile=val -- run the self profiler and output the raw event data
    -W                     self-profile-events=val -- specify the events recorded by the self profiler;
        for example: `-Z self-profile-events=default,query-keys`
        all options: none, all, default, generic-activity, query-provider, query-cache-hit
                     query-blocked, incr-cache-load, incr-result-hashing, query-keys, function-args, args, llvm, artifact-sizes
    -W                    self-profile-counter=val -- counter used by the self profiler (default: `wall-time`), one of:
        `wall-time` (monotonic clock, i.e. `std::time::Instant`)
        `instructions:u` (retired instructions, userspace-only)
        `instructions-minus-irqs:u` (subtracting hardware interrupt counts for extra accuracy)
    -W                          share-generics=val -- make the current crate share its generic instantiations
    -W                               show-span=val -- show spans for compiler debugging (expr|pat|ty)
    -W                              span-debug=val -- forward proc_macro::Span's `Debug` impl to `Span`
    -W                       span-free-formats=val -- exclude spans when debug-printing compiler state (default: no)
    -W                      src-hash-algorithm=val -- hash algorithm of source files in debug info (`md5`, `sha1`, or `sha256`)
    -W                         stack-protector=val -- control stack smash protection strategy (`rustc --print stack-protector-strategies` for details)
    -W                      strict-init-checks=val -- control if mem::uninitialized and mem::zeroed panic on more UB
    -W                                   strip=val -- tell the linker which information to strip (`none` (default), `debuginfo` or `symbols`)
    -W                        split-dwarf-kind=val -- split dwarf variant (only if -Csplit-debuginfo is enabled and on relevant platform)
        (default: `split`)

        `split`: sections which do not require relocation are written into a DWARF object (`.dwo`)
                 file which is ignored by the linker
        `single`: sections which do not require relocation are written into object file but ignored
                  by the linker
    -W                    split-dwarf-inlining=val -- provide minimal debug info in the object/executable to facilitate online symbolication/stack traces in the absence of .dwo/.dwp files when using Split DWARF
    -W                 symbol-mangling-version=val -- which mangling version to use for symbol names ('legacy' (default) or 'v0')
    -W                                   teach=val -- show extended diagnostic help (default: no)
    -W                               temps-dir=val -- the directory the intermediate files are written to
    -W                          terminal-width=val -- set the current terminal width
    -W                          translate-lang=val -- language identifier for diagnostic output
    -W                translate-additional-ftl=val -- additional fluent translation to preferentially use (for testing translation)
    -W        translate-directionality-markers=val -- emit directionality isolation markers in translated diagnostics
    -W                                tune-cpu=val -- select processor to schedule for (`rustc --print target-cpus` for details)
    -W                                 thinlto=val -- enable ThinLTO when possible
    -W                           thir-unsafeck=val -- use the THIR unsafety checker (default: no)
    -W                                 threads=val -- use a thread pool with N threads
    -W                                    time=val -- measure time of rustc processes (default: no)
    -W                        time-llvm-passes=val -- measure time of each LLVM pass (default: no)
    -W                             time-passes=val -- measure time of each rustc pass (default: no)
    -W                               tls-model=val -- choose the TLS model to use (`rustc --print tls-models` for details)
    -W                            trace-macros=val -- for every macro invocation, print its name and arguments (default: no)
    -W   translate-remapped-path-to-local-path=val -- translate remapped paths into local paths when possible (default: yes)
    -W                        trap-unreachable=val -- generate trap instructions for unreachable intrinsics (default: use target setting, usually yes)
    -W                        treat-err-as-bug=val -- treat error number `val` that occurs as bug
    -W                   trim-diagnostic-paths=val -- in diagnostics, use heuristics to shorten paths referring to items
    -W                              ui-testing=val -- emit compiler diagnostics in a form suitable for UI testing (default: no)
    -W            uninit-const-chunk-threshold=val -- allow generating const initializers with mixed init/uninit chunks, and set the maximum number of chunks for which this is allowed (default: 16)
    -W          unleash-the-miri-inside-of-you=val -- take the brakes off const evaluation. NOTE: this is unsound (default: no)
    -W                                unpretty=val -- present the input source, unstable (and less-pretty) variants;
        `normal`, `identified`,
        `expanded`, `expanded,identified`,
        `expanded,hygiene` (with internal representations),
        `ast-tree` (raw AST before expansion),
        `ast-tree,expanded` (raw AST after expansion),
        `hir` (the HIR), `hir,identified`,
        `hir,typed` (HIR with types for each node),
        `hir-tree` (dump the raw HIR),
        `mir` (the MIR), or `mir-cfg` (graphviz formatted MIR)
    -W                        unsound-mir-opts=val -- enable unsound and buggy MIR optimizations (default: no)
    -W                        unstable-options=val -- adds unstable command line options to rustc interface (default: no)
    -W                       use-ctors-section=val -- use legacy .ctors section for initializers rather than .init_array
    -W                            validate-mir=val -- validate MIR after each transformation
    -W                                 verbose=val -- in general, enable more debug printouts (default: no)
    -W                          verify-llvm-ir=val -- verify LLVM IR (default: no)
    -W            virtual-function-elimination=val -- enables dead virtual function elimination optimization. Requires `-Clto[=[fat,yes]]`
    -W                         wasi-exec-model=val -- whether to build a wasi command or reactor
stderr: none



@jyn514
Copy link
Member Author

jyn514 commented Jul 1, 2022

@rust-lang/rustdoc can we find some way to change this test so it doesn't have to be updated on each new flag? It doesn't test what you want since if the new flag isn't added to the help output no one will notice. I think grep "-Z.*allow-features" is probably enough.

also there seems to be a bug in rustdoc itself, it's printing -W instead of -Z

@jyn514
Copy link
Member Author

jyn514 commented Jul 1, 2022

oh I just noticed this is a UI test; that's not so bad. but the bug in rustdoc is real

@jyn514
Copy link
Member Author

jyn514 commented Jul 1, 2022

yeah this is printing -Z options on -W help, which is wrong

print_flag_list("-W", config::DB_OPTIONS);

it needs to call describe_lints instead
let (_, lint_store) = &*queries.register_plugins()?.peek();
// Lint plugins are registered; now we can process command line flags.
if sess.opts.describe_lints {
describe_lints(sess, lint_store, true);
return early_exit();
}

@GuillaumeGomez
Copy link
Member

Can you open an issue for this bug please? (And since you already have the fix, maybe a PR too? 😉 ) Thanks in advance!

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jul 3, 2022
…meGomez

Fix bug in `rustdoc -Whelp`

Previously, this printed the debugging options, not the lint options,
and only handled `-Whelp`, not `-A/-D/-F`.

This also fixes a few other misc issues:
- Fix `// check-stdout` for UI tests; previously it only worked for run-fail and compile-fail tests
- Add lint headers for tool lints, not just builtin lints

rust-lang#98533 (comment)

r? `@GuillaumeGomez`
RalfJung added a commit to RalfJung/rust that referenced this pull request Jul 3, 2022
…meGomez

Fix bug in `rustdoc -Whelp`

Previously, this printed the debugging options, not the lint options,
and only handled `-Whelp`, not `-A/-D/-F`.

This also fixes a few other misc issues:
- Fix `// check-stdout` for UI tests; previously it only worked for run-fail and compile-fail tests
- Add lint headers for tool lints, not just builtin lints

rust-lang#98533 (comment)

r? ``@GuillaumeGomez``
RalfJung added a commit to RalfJung/rust that referenced this pull request Jul 3, 2022
…meGomez

Fix bug in `rustdoc -Whelp`

Previously, this printed the debugging options, not the lint options,
and only handled `-Whelp`, not `-A/-D/-F`.

This also fixes a few other misc issues:
- Fix `// check-stdout` for UI tests; previously it only worked for run-fail and compile-fail tests
- Add lint headers for tool lints, not just builtin lints

rust-lang#98533 (comment)

r? ```@GuillaumeGomez```
@eholk
Copy link
Contributor

eholk commented Jul 6, 2022

Looks good to me, especially the new labels! This will be much nicer to use next time I or someone else has to debug a drop tracking issue!

@bors r+

@bors
Copy link
Contributor

bors commented Jul 6, 2022

📌 Commit 3164c2a has been approved by eholk

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 6, 2022
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jul 8, 2022
…holk

Add a `-Zdump-drop-tracking-cfg` debugging flag

This is useful for debugging drop-tracking; previously, you had to recompile
rustc from source and manually add a call to `write_graph_to_file`. This
makes the option more discoverable and configurable at runtime.

I also took the liberty of making the labels for the CFG nodes much easier to read:
previously, they looked like `id(2), local_id: 48`, now they look like
```
expr from_config (hir_id=HirId { owner: DefId(0:10 ~ default_struct_update[79f9]::foo), local_id: 2})
```

r? `@eholk`
bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 8, 2022
Rollup of 4 pull requests

Successful merges:

 - rust-lang#98533 (Add a `-Zdump-drop-tracking-cfg` debugging flag)
 - rust-lang#98654 (An optimization for `pest-2.1.3`)
 - rust-lang#98657 (Migrate some diagnostics from `rustc_const_eval` to `SessionDiagnostic`)
 - rust-lang#98794 (Highlight conflicting param-env candidates)

Failed merges:

 - rust-lang#98957 ( don't allow ZST in ScalarInt )

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 1ce8de3 into rust-lang:master Jul 8, 2022
@rustbot rustbot added this to the 1.64.0 milestone Jul 8, 2022
@jyn514 jyn514 deleted the drop-tracking-debugging branch February 25, 2023 18:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-async-await Area: Async & Await A-contributor-roadblock Area: Makes things more difficult for new contributors to rust itself A-control-flow Area: Relating to control flow S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants