diff options
| author | bors <bors@rust-lang.org> | 2024-11-27 07:38:21 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-11-27 07:38:21 +0000 |
| commit | 5f8a2405a6a7ea0ff85072b3bf90f4cff1144e85 (patch) | |
| tree | 5275a6bcad0c65a14315bb6422bc78cd0e6d2c52 /compiler | |
| parent | 83965efe6ad57a2baf3b5d5678d094bf9cd936dd (diff) | |
| parent | 762a661705c52a6d99e8af37fc06aca573e35659 (diff) | |
| download | rust-5f8a2405a6a7ea0ff85072b3bf90f4cff1144e85.tar.gz rust-5f8a2405a6a7ea0ff85072b3bf90f4cff1144e85.zip | |
Auto merge of #133527 - matthiaskrgr:rollup-kyre1df, r=matthiaskrgr
Rollup of 6 pull requests Successful merges: - #132979 (use `--exact` on `--skip` to avoid unintended substring matches) - #133248 (CI: split x86_64-msvc-ext job) - #133449 (std: expose `const_io_error!` as `const_error!`) - #133453 (Commit license-metadata.json to git and check it's correct in CI) - #133457 (miri: implement `TlsFree`) - #133493 (do not constrain infer vars in `find_best_leaf_obligation`) r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/rustc_trait_selection/src/solve/fulfill.rs | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/compiler/rustc_trait_selection/src/solve/fulfill.rs b/compiler/rustc_trait_selection/src/solve/fulfill.rs index 311dc214de6..0f90c45d032 100644 --- a/compiler/rustc_trait_selection/src/solve/fulfill.rs +++ b/compiler/rustc_trait_selection/src/solve/fulfill.rs @@ -346,12 +346,21 @@ fn find_best_leaf_obligation<'tcx>( consider_ambiguities: bool, ) -> PredicateObligation<'tcx> { let obligation = infcx.resolve_vars_if_possible(obligation.clone()); + // FIXME: we use a probe here as the `BestObligation` visitor does not + // check whether it uses candidates which get shadowed by where-bounds. + // + // We should probably fix the visitor to not do so instead, as this also + // means the leaf obligation may be incorrect. infcx - .visit_proof_tree(obligation.clone().into(), &mut BestObligation { - obligation: obligation.clone(), - consider_ambiguities, + .fudge_inference_if_ok(|| { + infcx + .visit_proof_tree(obligation.clone().into(), &mut BestObligation { + obligation: obligation.clone(), + consider_ambiguities, + }) + .break_value() + .ok_or(()) }) - .break_value() .unwrap_or(obligation) } |
