1
Fork 0

Rollup merge of #113296 - BoxyUwU:proof_trees_on_error, r=lcnr

add flag for enabling global cache usage for proof trees and printing proof trees on error

This adds a few new things:
- `-Zdump-solver-proof-tree=always/never/on-error`
    - `always`/`never` were previosuly specifiable by whether the flag exists or not, th new flag is `on_error` which reruns obligations of fulfillment and selection errors with proof tree generation enabled and prints them out
- `-Zdump-solver-proof-tree-uses-cache`
    - allows forcing global cache to be used or unused for all generated proof trees, global cache is enabled by default for `always` so that it accurately represents what happend. This flag currently would affect misc uses of `GenerateProofTree::Yes` which will be added in the future for things like diagnostics logic and rustdoc's auto_trait file. We can fix this when we start using proof tree generation for those use cases if it's desirable.

I also changed the output to go straight to stdout instead of going through `debug!` so that `-Zdump-solver-proof-tree` can be adequately used on `nightly` not just a locally built toolchain.

The idea for `on-error` is that it should hopefully make it easier to quickly figure out "why doesnt this code compile"- you just pass in `-Zdump-solver-proof-tree=on-error` and you'll only get proof trees you care about.

---

r? `@lcnr` `@compiler-errors`
This commit is contained in:
Matthias Krüger 2023-07-04 17:46:28 +02:00 committed by GitHub
commit 494e67c63c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 159 additions and 34 deletions

View file

@ -743,6 +743,14 @@ pub enum TraitSolver {
NextCoherence,
}
#[derive(Default, Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum DumpSolverProofTree {
Always,
OnError,
#[default]
Never,
}
pub enum Input {
/// Load source code from a file.
File(PathBuf),