Skip to content
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

Don't infer regions in type checking #68261

Open
matthewjasper opened this issue Jan 15, 2020 · 1 comment
Open

Don't infer regions in type checking #68261

matthewjasper opened this issue Jan 15, 2020 · 1 comment
Labels
A-inference Area: Type inference A-lifetimes Area: lifetime related A-NLL Area: Non Lexical Lifetimes (NLL) C-enhancement Category: An issue proposing an enhancement or a PR with one. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@matthewjasper
Copy link
Contributor

This is a tracking issue for avoiding region inference in item body type checking. The goal would be to use ReErased where we currently use ReVar as much as possible.

The motivations for this are:

  • It would avoid doing region inference twice (once in typeck, once in borrowck).
  • It might improve caching since there are fewer distinct types.
  • It ensures that region inference cannot affect later passes.

cc @nikomatsakis

@matthewjasper matthewjasper added C-enhancement Category: An issue proposing an enhancement or a PR with one. A-lifetimes Area: lifetime related A-inference Area: Type inference A-NLL Area: Non Lexical Lifetimes (NLL) labels Jan 15, 2020
@matthewjasper
Copy link
Contributor Author

matthewjasper commented Jan 15, 2020

The first steps towards this are #67681 and #65232

Some further steps are:

  • Erase regions in writeback.rs (Erase regions in writeback #69189)
  • Don't infer regions when checking function/const/static bodies, gated on -Zborrowck=mir
  • Don't visit expressions in regionck. This requires some work to ensure that we don't regress error messages.

Some related work would be

  • Remove ReScope ( Remove ReScope #72362)
  • Ensure that MIR doesn't contain unerased free regions (except for borrowck's copy)

@jonas-schievink jonas-schievink added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Jan 15, 2020
Centril added a commit to Centril/rust that referenced this issue Mar 12, 2020
…komatsakis

Erase regions in writeback

Regions in `TypeckTables` (except canonicalized user annotations) are now erased. Further, we no longer do lexical region solving on item bodies with `-Zborrowck=mir`.

cc rust-lang#68261
r? @nikomatsakis
Centril added a commit to Centril/rust that referenced this issue Mar 17, 2020
…komatsakis

Erase regions in writeback

Regions in `TypeckTables` (except canonicalized user annotations) are now erased. Further, we no longer do lexical region solving on item bodies with `-Zborrowck=mir`.

cc rust-lang#68261
r? @nikomatsakis
Manishearth added a commit to Manishearth/rust that referenced this issue Mar 17, 2020
…komatsakis

Erase regions in writeback

Regions in `TypeckTables` (except canonicalized user annotations) are now erased. Further, we no longer do lexical region solving on item bodies with `-Zborrowck=mir`.

cc rust-lang#68261
r? @nikomatsakis
Centril added a commit to Centril/rust that referenced this issue Mar 18, 2020
…komatsakis

Erase regions in writeback

Regions in `TypeckTables` (except canonicalized user annotations) are now erased. Further, we no longer do lexical region solving on item bodies with `-Zborrowck=mir`.

cc rust-lang#68261
r? @nikomatsakis
Centril added a commit to Centril/rust that referenced this issue Mar 18, 2020
…komatsakis

Erase regions in writeback

Regions in `TypeckTables` (except canonicalized user annotations) are now erased. Further, we no longer do lexical region solving on item bodies with `-Zborrowck=mir`.

cc rust-lang#68261
r? @nikomatsakis
Centril added a commit to Centril/rust that referenced this issue Mar 18, 2020
…komatsakis

Erase regions in writeback

Regions in `TypeckTables` (except canonicalized user annotations) are now erased. Further, we no longer do lexical region solving on item bodies with `-Zborrowck=mir`.

cc rust-lang#68261
r? @nikomatsakis
Centril added a commit to Centril/rust that referenced this issue Mar 18, 2020
…komatsakis

Erase regions in writeback

Regions in `TypeckTables` (except canonicalized user annotations) are now erased. Further, we no longer do lexical region solving on item bodies with `-Zborrowck=mir`.

cc rust-lang#68261
r? @nikomatsakis
RalfJung added a commit to RalfJung/rust that referenced this issue May 23, 2020
…omatsakis

Remove ReScope

`ReScope` is unnecessary now that AST borrowck is gone and we're erasing the results of region inference in function bodies. This removes about as much of the old regionck code as possible without having to enable NLL fully.

cc rust-lang#68261

r? @nikomatsakis
bors added a commit to rust-lang-ci/rust that referenced this issue May 24, 2020
…atsakis

Remove ReScope

`ReScope` is unnecessary now that AST borrowck is gone and we're erasing the results of region inference in function bodies. This removes about as much of the old regionck code as possible without having to enable NLL fully.

cc rust-lang#68261

r? @nikomatsakis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-inference Area: Type inference A-lifetimes Area: lifetime related A-NLL Area: Non Lexical Lifetimes (NLL) C-enhancement Category: An issue proposing an enhancement or a PR with one. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

2 participants