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

Remove ReScope #72362

Merged
merged 8 commits into from
May 24, 2020
Merged

Remove ReScope #72362

merged 8 commits into from
May 24, 2020

Conversation

matthewjasper
Copy link
Contributor

@matthewjasper matthewjasper commented May 19, 2020

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 #68261

r? @nikomatsakis

@rust-highfive
Copy link
Collaborator

The job mingw-check of your PR failed (pretty log, raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
##[section]Starting: Linux mingw-check
##[section]Starting: Initialize job
Agent name: 'Azure Pipelines 10'
Agent machine name: 'fv-az578'
Current agent version: '2.168.2'
##[group]Operating System
16.04.6
LTS
LTS
##[endgroup]
##[group]Virtual Environment
Environment: ubuntu-16.04
Version: 20200512.2
Included Software: https://github.com/actions/virtual-environments/blob/ubuntu16/20200512.2/images/linux/Ubuntu1604-README.md
##[endgroup]
Agent running as: 'vsts'
Prepare build directory.
Set build variables.
Download all required tasks.
Download all required tasks.
Downloading task: Bash (3.163.2)
Checking job knob settings.
   Knob: AgentToolsDirectory = /opt/hostedtoolcache Source: ${AGENT_TOOLSDIRECTORY} 
   Knob: AgentPerflog = /home/vsts/perflog Source: ${VSTS_AGENT_PERFLOG} 
Start tracking orphan processes.
##[section]Finishing: Initialize job
##[section]Starting: Configure Job Name
==============================================================================
---
========================== Starting Command Output ===========================
[command]/bin/bash --noprofile --norc /home/vsts/work/_temp/4326dff7-0e9c-45c1-8be3-3a50bbbd9b55.sh

##[section]Finishing: Disable git automatic line ending conversion
##[section]Starting: Checkout rust-lang/rust@refs/pull/72362/merge to s
Task         : Get sources
Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
Version      : 1.0.0
Author       : Microsoft
---
##[command]git remote add origin https://github.com/rust-lang/rust
##[command]git config gc.auto 0
##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
##[command]git config --get-all http.proxy
##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/72362/merge:refs/remotes/pull/72362/merge
---
 ---> 3adb0605cc65
Step 6/7 : ENV RUN_CHECK_WITH_PARALLEL_QUERIES 1
 ---> Using cache
 ---> 28dbc326cb7f
Step 7/7 : ENV SCRIPT python3 ../x.py test src/tools/expand-yaml-anchors &&            python3 ../x.py check --target=i686-pc-windows-gnu --host=i686-pc-windows-gnu &&            python3 ../x.py build --stage 0 src/tools/build-manifest &&            python3 ../x.py test --stage 0 src/tools/compiletest &&            python3 ../x.py test src/tools/tidy &&            python3 ../x.py doc --stage 0 src/libstd &&            /scripts/validate-toolstate.sh
 ---> 537a01811900
Successfully built 537a01811900
Successfully tagged rust-ci:latest
Built container sha256:537a018119009dc218456238dec90b5530050db1e2a1e166550c218003f6159d
---
    Checking rustc_feature v0.0.0 (/checkout/src/librustc_feature)
    Checking fmt_macros v0.0.0 (/checkout/src/libfmt_macros)
    Checking rustc_ast_pretty v0.0.0 (/checkout/src/librustc_ast_pretty)
    Checking rustc_hir v0.0.0 (/checkout/src/librustc_hir)
    Checking rustc_query_system v0.0.0 (/checkout/src/librustc_query_system)
    Checking chalk-rust-ir v0.10.0
    Checking rustc_parse v0.0.0 (/checkout/src/librustc_parse)
    Checking rustc_hir_pretty v0.0.0 (/checkout/src/librustc_hir_pretty)
    Checking rustc_ast_lowering v0.0.0 (/checkout/src/librustc_ast_lowering)
---
    Checking url v2.1.0
    Checking toml v0.5.3
    Checking cargo_metadata v0.9.1
    Checking clippy_lints v0.0.212 (/checkout/src/tools/clippy/clippy_lints)
error[E0599]: no method named `is_subscope_of` found for reference `&rustc_middle::middle::region::ScopeTree` in the current scope
     |
     |
1054 |                     if region_scope_tree.is_subscope_of(indexed_extent, pat_extent) {
     |                                          ^^^^^^^^^^^^^^ method not found in `&rustc_middle::middle::region::ScopeTree`
error: aborting due to previous error

For more information about this error, try `rustc --explain E0599`.
error: could not compile `clippy_lints`.
---
  local time: Tue May 19 21:41:26 UTC 2020
  network time: Tue, 19 May 2020 21:41:26 GMT
== end clock drift check ==

##[error]Bash exited with code '1'.
##[section]Finishing: Run build
##[section]Starting: Checkout rust-lang/rust@refs/pull/72362/merge to s
Task         : Get sources
Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
Version      : 1.0.0
Author       : Microsoft
Author       : Microsoft
Help         : [More Information](https://go.microsoft.com/fwlink/?LinkId=798199)
==============================================================================
Cleaning any cached credential from repository: rust-lang/rust (GitHub)
##[section]Finishing: Checkout rust-lang/rust@refs/pull/72362/merge to s
Cleaning up task key
Start cleaning up orphan processes.
Terminate orphan process: pid (4008) (python)
##[section]Finishing: Finalize Job

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @rust-lang/infra. (Feature Requests)

Copy link
Contributor

@nikomatsakis nikomatsakis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Left some questions and nits. Wow, it's nice to see the old code get deleted. I guess we kept enough of the scope tree to still handle the generators code that uses it.

@nikomatsakis
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented May 21, 2020

📌 Commit c8033e7146a43b7ebe1515f643dec726aa45ea2b has been approved by nikomatsakis

@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label May 21, 2020
@bors
Copy link
Contributor

bors commented May 22, 2020

☔ The latest upstream changes (presumably #72433) made this pull request unmergeable. Please resolve the merge conflicts.

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels May 22, 2020
@matthewjasper
Copy link
Contributor Author

@bors r=nikomatsakis

@bors
Copy link
Contributor

bors commented May 22, 2020

📌 Commit 9754b3f has been approved by nikomatsakis

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels May 22, 2020
@bors
Copy link
Contributor

bors commented May 22, 2020

⌛ Testing commit 9754b3f with merge 1dccabac15f9026a3afec072feea9959cea48fa1...

@Dylan-DPC-zz
Copy link

@bors retry yield

@matthewjasper
Copy link
Contributor Author

Type checking still has to infer the values of regions. Before this pr this included ensuring that regions inferred in function bodies outlived various scopes. This pr is removing the logic for generating those predicates, because they can't be expressed any more.

RalfJung added a commit to RalfJung/rust that referenced this pull request 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
Copy link
Contributor

bors commented May 23, 2020

⌛ Testing commit 9754b3f with merge e09c65e40789dc68465dfd855d4be570aa0e2163...

@Dylan-DPC-zz
Copy link

@bors retry yield

@bors
Copy link
Contributor

bors commented May 24, 2020

⌛ Testing commit 9754b3f with merge 52b605c...

@bors bors mentioned this pull request May 24, 2020
@bors
Copy link
Contributor

bors commented May 24, 2020

☀️ Test successful - checks-azure
Approved by: nikomatsakis
Pushing 52b605c to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label May 24, 2020
@bors bors merged commit 52b605c into rust-lang:master May 24, 2020
@matthewjasper matthewjasper deleted the remove-rescope branch May 24, 2020 08:25
@ecstatic-morse
Copy link
Contributor

@matthewjasper This PR led to substantial perf wins on check builds for real-world crates. Nice work!

@nnethercote
Copy link
Contributor

Good news! This was a significant perf win. Instruction counts dropped by up to 7.7%.

Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request May 29, 2020
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request May 29, 2020
@@ -5,7 +5,6 @@

use rustc_data_structures::transitive_relation::TransitiveRelation;
use rustc_hir::def_id::DefId;
use rustc_middle::middle::region;
use rustc_middle::ty::{self, Lift, Region, TyCtxt};

/// Combines a `region::ScopeTree` (which governs relationships between
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missed reference to region::ScopeTree.

(don't mind me, I came across this PR from perf results, enjoying the diff)

@jonas-schievink jonas-schievink added relnotes-perf Performance improvements that should be mentioned in the release notes. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jun 22, 2020
@jonas-schievink jonas-schievink added this to the 1.45 milestone Jun 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. relnotes-perf Performance improvements that should be mentioned in the release notes. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.