Skip to content

No method enter on InferCtxtBuilder #1543

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

Closed
mejrs opened this issue Jan 5, 2023 · 3 comments · Fixed by #1571
Closed

No method enter on InferCtxtBuilder #1543

mejrs opened this issue Jan 5, 2023 · 3 comments · Fixed by #1571
Assignees
Labels
E-easy Difficulty: might be a good place for a beginner

Comments

@mejrs
Copy link
Contributor

mejrs commented Jan 5, 2023

see https://rustc-dev-guide.rust-lang.org/type-inference.html#creating-an-inference-context

This enter method was removed a while ago, but the documentation is still there

@fmease
Copy link
Member

fmease commented Jan 13, 2023

The enter method might have been moved to InheritedBuilder (see InheritedBuilder::enter) if I read things correctly.

@Noratrieb
Copy link
Member

tcx.infer_ctxt().enter(|infcx| {
    // Use the inference context `infcx` here.
})

is now used as

let infcx = tcx.infer_ctxt().build();
// Use the inference context `infcx` here.

@Noratrieb Noratrieb added the E-easy Difficulty: might be a good place for a beginner label Jan 30, 2023
@Noratrieb
Copy link
Member

It also doesn't have a lifetime anymore except for 'tcx.

@Noratrieb Noratrieb self-assigned this Jan 30, 2023
JohnTitor pushed a commit that referenced this issue Jan 30, 2023
Kobzol pushed a commit to Kobzol/rust that referenced this issue Dec 30, 2024
bors pushed a commit to rust-lang-ci/rust that referenced this issue Jan 2, 2025
Kobzol pushed a commit to Kobzol/rustc-dev-guide that referenced this issue Jan 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E-easy Difficulty: might be a good place for a beginner
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants