about summary refs log tree commit diff
path: root/compiler/rustc_trait_selection/src/solve/eval_ctxt.rs
AgeCommit message (Collapse)AuthorLines
2023-10-10reorder files in solvelcnr-1001/+0
2023-09-21proof trees: use for `intercrate_ambiguity_causes`lcnr-4/+5
2023-09-18Auto merge of #115748 - RalfJung:post-mono, r=oli-obkbors-2/+4
move required_consts check to general post-mono-check function This factors some code that is common between the interpreter and the codegen backends into shared helper functions. Also as a side-effect the interpreter now uses the same `eval` functions as everyone else to get the evaluated MIR constants. Also this is in preparation for another post-mono check that will be needed for (the current hackfix for) https://github.com/rust-lang/rust/issues/115709: ensuring that all locals are dynamically sized. I didn't expect this to change diagnostics, but it's just cycle errors that change. r? `@oli-obk`
2023-09-14move required_consts check to general post-mono-check functionRalf Jung-2/+4
2023-09-14differentiate root and nested goalslcnr-9/+16
2023-09-14inspect: explicitly store added goalslcnr-1/+1
2023-09-11inspect: strongly typed CandidateKindlcnr-1/+1
2023-09-11split GoalEvaluation and CanonicalGoalEvaluationlcnr-11/+15
the unnormalized goal is in the callers inference context, while anything inside of the `CanonicalGoalEvaluation` is inside of a new one.
2023-09-02Signed-off-by: cui fliter <imcusg@gmail.com>cui fliter-1/+1
remove the repetitive word Signed-off-by: cui fliter <imcusg@gmail.com>
2023-08-12lower `evaluate_goal` stability check to `warn`lcnr-33/+49
2023-08-05Also report when goals go from ok to errorMichael Goulet-2/+8
2023-08-03rewrite stack dependent overflow handlinglcnr-0/+2
2023-08-03handle overflow in the `EvalCtxt` separatelylcnr-97/+96
2023-08-03add `ensure_sufficient_stack` to the new solverlcnr-18/+21
2023-08-03fix `make_ambiguous_response_no_constraints`lcnr-10/+11
we previously had incorrect universes in the query response.
2023-08-03avoid more `ty::Binder:dummy`lcnr-2/+2
2023-07-31Rollup merge of #114169 - lcnr:unsize, r=compiler-errorsMatthias Krüger-3/+3
refactor builtin unsize handling, extend comments r? `@compiler-errors`
2023-07-28refactor builtin unsize handling, extend commentslcnr-3/+3
2023-07-27Consider a goal as NOT changed if its response is identity modulo regionsMichael Goulet-1/+1
2023-07-25Rollup merge of #113661 - oli-obk:tait_wtf, r=lcnrMatthias Krüger-0/+1
Double check that hidden types match the expected hidden type Fixes https://github.com/rust-lang/rust/issues/113278 specifically, but I left a TODO for where we should also add some hardening. It feels a bit like papering over the issue, but at least this way we don't get unsoundness, but just surprising errors. Errors will be improved and given spans before this PR lands. r? `@compiler-errors` `@lcnr`
2023-07-25Make everything builtin!Michael Goulet-0/+36
2023-07-21Double check that hidden types match the expected hidden typeOli Scherer-0/+1
2023-07-14refactor(rustc_middle): Substs -> GenericArgMahdi Dibaiee-21/+12
2023-07-10avoid building proof trees in selectlcnr-2/+3
2023-07-06Don't call type_of on TAIT in defining scope in new solverMichael Goulet-1/+1
2023-07-05Auto merge of #113329 - lcnr:probe_candidate, r=BoxyUwUbors-20/+14
add `ecx.probe_candidate` Not yet changing the candidate source to an enum because that would be more involved, but this by itself should already be a significant improvement imo r? `@BoxyUwU`
2023-07-04Auto merge of #113330 - matthiaskrgr:rollup-zm3owin, r=matthiaskrgrbors-13/+28
Rollup of 5 pull requests Successful merges: - #113192 (`assemble_candidates_after_normalizing_self_ty` docs) - #113251 (Use scoped-tls for SMIR to map between TyCtxt and SMIR datastructures) - #113282 (Update platform-support.md to improve ARM target descriptions) - #113296 (add flag for enabling global cache usage for proof trees and printing proof trees on error) - #113324 (implement `ConstEvaluatable` goals in new solver) r? `@ghost` `@rustbot` modify labels: rollup
2023-07-04Rollup merge of #113324 - lcnr:const-evaluatable-goal, r=BoxyUwUMatthias Krüger-6/+5
implement `ConstEvaluatable` goals in new solver this only supports stable const generics. `feature(generic_const_exprs)` needs to extend that function is non-trivial ways. Leaving this for someone else or some later date. r? `@BoxyUwU`
2023-07-04Rollup merge of #113296 - BoxyUwU:proof_trees_on_error, r=lcnrMatthias Krüger-7/+23
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`
2023-07-04add `ecx.probe_candidate`lcnr-20/+14
2023-07-04reviewsBoxy-9/+9
2023-07-04implement `ConstEvaluatable` goals in new solverlcnr-6/+5
we don't yet handle `generic_const_exprs`, someone else can do that :3
2023-07-04Replace `const_error` methods with `Const::new_error`Boxy-1/+1
2023-07-04move logic for flags into separate functionBoxy-29/+1
2023-07-04change flag nameBoxy-1/+1
2023-07-04reviewsBoxy-3/+1
2023-07-03remove TypeWellFormedFromEnvMichael Goulet-3/+0
2023-07-03add flag for disabling global cache and printing proof trees on errorBoxy-7/+53
2023-07-03Helpers for creating EvalCtxts, some commentsMichael Goulet-56/+94
2023-07-03Implement selection in new trait solverMichael Goulet-0/+2
2023-06-26TypeWellFormedInEnvMichael Goulet-1/+1
2023-06-21Rollup merge of #112772 - compiler-errors:clauses-1, r=lcnrNilstrieb-7/+7
Add a fully fledged `Clause` type, rename old `Clause` to `ClauseKind` Does two basic things before I put up a more delicate set of PRs (along the lines of #112714, but hopefully much cleaner) that migrate existing usages of `ty::Predicate` to `ty::Clause` (`predicates_of`/`item_bounds`/`ParamEnv::caller_bounds`). 1. Rename `Clause` to `ClauseKind`, so it's parallel with `PredicateKind`. 2. Add a new `Clause` type which is parallel to `Predicate`. * This type exposes `Clause::kind(self) -> Binder<'tcx, ClauseKind<'tcx>>` which is parallel to `Predicate::kind` 😸 The new `Clause` type essentially acts as a newtype wrapper around `Predicate` that asserts that it is specifically a `PredicateKind::Clause`. Turns out from experimentation[^1] that this is not negative performance-wise, which is wonderful, since this a much simpler design than something that requires encoding the discriminant into the alignment bits of a predicate kind, or something else like that... r? ``@lcnr`` or ``@oli-obk`` [^1]: https://github.com/rust-lang/rust/pull/112714#issuecomment-1595653910
2023-06-20Auto merge of #112835 - lcnr:proof-tree-nits, r=BoxyUwUbors-34/+12
proof tree nits r? `@BoxyUwU`
2023-06-20cleanup importslcnr-3/+3
2023-06-20split probe into 2 functions for better readabilitylcnr-31/+9
2023-06-19s/Clause/ClauseKindMichael Goulet-7/+7
2023-06-19Don't consider TAIT normalizable to hidden ty if it would result in ↵Michael Goulet-3/+10
impossible item bounds
2023-06-19create module so that RUSTC_LOG can filter to just proof treesBoxy-1/+2
2023-06-19allow caller to force proof tree generationBoxy-14/+25
2023-06-19show normalizes-to hack and response instantiation goalsBoxy-12/+19