diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-10-02 08:41:38 +1000 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-10-07 09:50:51 +1100 |
| commit | deeb0c5cf3737d2a681334befee694cc5aa005b8 (patch) | |
| tree | 3d4b1a8d37f4bf30bd5f266320752b89410c256a | |
| parent | 0ca4784c45665a0267314ddd2a12c6710fbbe2c0 (diff) | |
| download | rust-deeb0c5cf3737d2a681334befee694cc5aa005b8.tar.gz rust-deeb0c5cf3737d2a681334befee694cc5aa005b8.zip | |
Inline and remove `InferCtxtBuilder::with_defining_opaque_types`.
It has a single use.
| -rw-r--r-- | compiler/rustc_infer/src/infer/mod.rs | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/compiler/rustc_infer/src/infer/mod.rs b/compiler/rustc_infer/src/infer/mod.rs index dbdcc3e2a8a..7238c670be9 100644 --- a/compiler/rustc_infer/src/infer/mod.rs +++ b/compiler/rustc_infer/src/infer/mod.rs @@ -569,14 +569,6 @@ impl<'tcx> InferCtxtBuilder<'tcx> { self } - pub fn with_defining_opaque_types( - mut self, - defining_opaque_types: &'tcx ty::List<LocalDefId>, - ) -> Self { - self.defining_opaque_types = defining_opaque_types; - self - } - pub fn with_next_trait_solver(mut self, next_trait_solver: bool) -> Self { self.next_trait_solver = next_trait_solver; self @@ -605,14 +597,15 @@ impl<'tcx> InferCtxtBuilder<'tcx> { /// the bound values in `C` to their instantiated values in `V` /// (in other words, `S(C) = V`). pub fn build_with_canonical<T>( - self, + mut self, span: Span, canonical: &Canonical<'tcx, T>, ) -> (InferCtxt<'tcx>, T, CanonicalVarValues<'tcx>) where T: TypeFoldable<TyCtxt<'tcx>>, { - let infcx = self.with_defining_opaque_types(canonical.defining_opaque_types).build(); + self.defining_opaque_types = canonical.defining_opaque_types; + let infcx = self.build(); let (value, args) = infcx.instantiate_canonical(span, canonical); (infcx, value, args) } |
