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

Improve ty.needs_drop #68679

Merged
merged 9 commits into from
Feb 12, 2020
Merged

Improve ty.needs_drop #68679

merged 9 commits into from
Feb 12, 2020

Conversation

matthewjasper
Copy link
Contributor

  • Handle cycles in needs_drop correctly
  • Normalize types when computing needs_drop
  • Move queries from rustc to rustc_ty
  • Avoid query in simple cases

reopens #65918

@rust-highfive
Copy link
Collaborator

r? @varkor

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 30, 2020
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-7 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.
2020-01-30T20:32:06.7748153Z ========================== Starting Command Output ===========================
2020-01-30T20:32:06.7749635Z [command]/bin/bash --noprofile --norc /home/vsts/work/_temp/48bba453-eb8c-40db-aba1-8b1493e06fab.sh
2020-01-30T20:32:06.7749671Z 
2020-01-30T20:32:06.7752282Z ##[section]Finishing: Disable git automatic line ending conversion
2020-01-30T20:32:06.7758275Z ##[section]Starting: Checkout rust-lang/rust@refs/pull/68679/merge to s
2020-01-30T20:32:06.7759852Z Task         : Get sources
2020-01-30T20:32:06.7759888Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2020-01-30T20:32:06.7759924Z Version      : 1.0.0
2020-01-30T20:32:06.7760005Z Author       : Microsoft
---
2020-01-30T20:32:07.5430654Z ##[command]git remote add origin https://github.com/rust-lang/rust
2020-01-30T20:32:07.5580010Z ##[command]git config gc.auto 0
2020-01-30T20:32:07.5671595Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2020-01-30T20:32:07.5731918Z ##[command]git config --get-all http.proxy
2020-01-30T20:32:07.5871233Z ##[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/68679/merge:refs/remotes/pull/68679/merge
---
2020-01-30T20:56:43.1323160Z    Compiling byteorder v1.3.2
2020-01-30T20:56:43.3771219Z    Compiling log v0.4.8
2020-01-30T20:56:44.6206649Z    Compiling nodrop v0.1.12
2020-01-30T20:56:45.4234105Z    Compiling smallvec v1.0.0
2020-01-30T20:56:45.6702108Z error: internal compiler error: src/librustc_traits/normalize_erasing_regions.rs:34: could not fully normalize `<A as Array>::Item`
2020-01-30T20:56:45.6702598Z thread 'rustc' panicked at 'Box<Any>', src/librustc_errors/lib.rs:883:9
2020-01-30T20:56:45.6702693Z note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
2020-01-30T20:56:45.6702768Z 
2020-01-30T20:56:46.3748928Z note: the compiler unexpectedly panicked. this is a bug.
2020-01-30T20:56:46.3748928Z note: the compiler unexpectedly panicked. this is a bug.
2020-01-30T20:56:46.3749013Z 
2020-01-30T20:56:46.3752238Z note: we would appreciate a bug report: ***/blob/master/CONTRIBUTING.md#bug-reports
2020-01-30T20:56:46.3753388Z note: rustc 1.42.0-nightly (45a7b1537 2020-01-30) running on x86_64-unknown-linux-gnu
2020-01-30T20:56:46.3753764Z 
2020-01-30T20:56:46.3753764Z 
2020-01-30T20:56:46.3754390Z note: compiler flags: -Z external-macro-backtrace -Z unstable-options -Z binary-dep-depinfo -Z force-unstable-if-unmarked -C opt-level=2 -C debuginfo=0 -C link-args=-Wl,-rpath,$ORIGIN/../lib -C prefer-dynamic -C llvm-args=-import-instr-limit=10 -C debug-assertions=n --crate-type lib
2020-01-30T20:56:46.3754540Z note: some of the compiler flags provided by cargo are hidden
2020-01-30T20:56:46.3754580Z 
2020-01-30T20:56:46.3754896Z error: aborting due to previous error
2020-01-30T20:56:46.3754939Z 
---
2020-01-30T20:56:46.3757930Z   local time: Thu Jan 30 20:56:45 UTC 2020
2020-01-30T20:56:46.3757991Z   network time: Thu, 30 Jan 2020 20:56:45 GMT
2020-01-30T20:56:46.3758049Z == end clock drift check ==
2020-01-30T20:56:46.5462772Z 
2020-01-30T20:56:46.5520560Z ##[error]Bash exited with code '1'.
2020-01-30T20:56:46.5532491Z ##[section]Finishing: Run build
2020-01-30T20:56:46.5555108Z ##[section]Starting: Checkout rust-lang/rust@refs/pull/68679/merge to s
2020-01-30T20:56:46.5557269Z Task         : Get sources
2020-01-30T20:56:46.5557319Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2020-01-30T20:56:46.5557368Z Version      : 1.0.0
2020-01-30T20:56:46.5557430Z Author       : Microsoft
2020-01-30T20:56:46.5557430Z Author       : Microsoft
2020-01-30T20:56:46.5557479Z Help         : [More Information](https://go.microsoft.com/fwlink/?LinkId=798199)
2020-01-30T20:56:46.5557533Z ==============================================================================
2020-01-30T20:56:46.9391020Z Cleaning any cached credential from repository: rust-lang/rust (GitHub)
2020-01-30T20:56:46.9431647Z ##[section]Finishing: Checkout rust-lang/rust@refs/pull/68679/merge to s
2020-01-30T20:56:46.9538573Z Cleaning up task key
2020-01-30T20:56:46.9539592Z Start cleaning up orphan processes.
2020-01-30T20:56:46.9639229Z Terminate orphan process: pid (3624) (python)
2020-01-30T20:56:46.9837376Z ##[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 @TimNN. (Feature Requests)

src/librustc/ty/util.rs Outdated Show resolved Hide resolved
src/librustc/ty/util.rs Outdated Show resolved Hide resolved
src/librustc_ty/needs_drop.rs Outdated Show resolved Hide resolved
@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.
2020-01-31T22:25:42.1761432Z ========================== Starting Command Output ===========================
2020-01-31T22:25:42.1764489Z [command]/bin/bash --noprofile --norc /home/vsts/work/_temp/686747ad-7027-40b0-a169-592c741ff3b4.sh
2020-01-31T22:25:42.1764531Z 
2020-01-31T22:25:42.1769951Z ##[section]Finishing: Disable git automatic line ending conversion
2020-01-31T22:25:42.1776222Z ##[section]Starting: Checkout rust-lang/rust@refs/pull/68679/merge to s
2020-01-31T22:25:42.1778183Z Task         : Get sources
2020-01-31T22:25:42.1778213Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2020-01-31T22:25:42.1778258Z Version      : 1.0.0
2020-01-31T22:25:42.1778287Z Author       : Microsoft
---
2020-01-31T22:25:43.2257851Z ##[command]git remote add origin https://github.com/rust-lang/rust
2020-01-31T22:25:43.2270611Z ##[command]git config gc.auto 0
2020-01-31T22:25:43.2274170Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2020-01-31T22:25:43.2276207Z ##[command]git config --get-all http.proxy
2020-01-31T22:25:43.2282906Z ##[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/68679/merge:refs/remotes/pull/68679/merge
---
2020-01-31T22:33:59.8509618Z     Checking rustc_ty v0.0.0 (/checkout/src/librustc_ty)
2020-01-31T22:33:59.9687499Z error[E0425]: cannot find value `upvar_ty` in this scope
2020-01-31T22:33:59.9687882Z   --> src/librustc_ty/needs_drop.rs:86:41
2020-01-31T22:33:59.9688807Z    |
2020-01-31T22:33:59.9689193Z 86 |                 if this.seen_tys.insert(upvar_ty) {
2020-01-31T22:33:59.9689631Z 
2020-01-31T22:33:59.9719995Z error[E0425]: cannot find value `upvar_ty` in this scope
2020-01-31T22:33:59.9720349Z   --> src/librustc_ty/needs_drop.rs:87:46
2020-01-31T22:33:59.9720641Z    |
2020-01-31T22:33:59.9720641Z    |
2020-01-31T22:33:59.9721136Z 87 |                     this.unchecked_tys.push((upvar_ty, level + 1));
2020-01-31T22:33:59.9721555Z 
2020-01-31T22:33:59.9752190Z error[E0425]: cannot find value `upvar_ty` in this scope
2020-01-31T22:33:59.9752521Z    --> src/librustc_ty/needs_drop.rs:114:40
2020-01-31T22:33:59.9752771Z     |
2020-01-31T22:33:59.9752771Z     |
2020-01-31T22:33:59.9753054Z 114 | ...                   queue_type(upvar_ty);
2020-01-31T22:33:59.9753471Z 
2020-01-31T22:33:59.9788724Z error[E0425]: cannot find value `upvar_ty` in this scope
2020-01-31T22:33:59.9789117Z    --> src/librustc_ty/needs_drop.rs:126:40
2020-01-31T22:33:59.9789393Z     |
2020-01-31T22:33:59.9789393Z     |
2020-01-31T22:33:59.9789693Z 126 | ...                   queue_type(upvar_ty);
2020-01-31T22:33:59.9790115Z 
2020-01-31T22:34:00.1244474Z error: aborting due to 4 previous errors
2020-01-31T22:34:00.1245408Z 
2020-01-31T22:34:00.1247792Z For more information about this error, try `rustc --explain E0425`.
2020-01-31T22:34:00.1247792Z For more information about this error, try `rustc --explain E0425`.
2020-01-31T22:34:00.1289143Z error: could not compile `rustc_ty`.
2020-01-31T22:34:00.1289768Z warning: build failed, waiting for other jobs to finish...
2020-01-31T22:34:00.5944803Z error: build failed
2020-01-31T22:34:00.5968632Z command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "check" "-Zconfig-profile" "--target" "x86_64-unknown-linux-gnu" "-Zbinary-dep-depinfo" "-j" "2" "--release" "--color" "always" "--features" " llvm" "--manifest-path" "/checkout/src/rustc/Cargo.toml" "--message-format" "json-render-diagnostics"
2020-01-31T22:34:00.5981277Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap check
2020-01-31T22:34:00.5981527Z Build completed unsuccessfully in 0:05:43
2020-01-31T22:34:00.6039939Z == clock drift check ==
2020-01-31T22:34:00.6054262Z   local time: Fri Jan 31 22:34:00 UTC 2020
2020-01-31T22:34:00.6054262Z   local time: Fri Jan 31 22:34:00 UTC 2020
2020-01-31T22:34:00.8912552Z   network time: Fri, 31 Jan 2020 22:34:00 GMT
2020-01-31T22:34:00.8915008Z == end clock drift check ==
2020-01-31T22:34:01.3936986Z 
2020-01-31T22:34:01.4033413Z ##[error]Bash exited with code '1'.
2020-01-31T22:34:01.4046084Z ##[section]Finishing: Run build
2020-01-31T22:34:01.4102221Z ##[section]Starting: Checkout rust-lang/rust@refs/pull/68679/merge to s
2020-01-31T22:34:01.4103913Z Task         : Get sources
2020-01-31T22:34:01.4103952Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2020-01-31T22:34:01.4104007Z Version      : 1.0.0
2020-01-31T22:34:01.4104041Z Author       : Microsoft
2020-01-31T22:34:01.4104041Z Author       : Microsoft
2020-01-31T22:34:01.4104079Z Help         : [More Information](https://go.microsoft.com/fwlink/?LinkId=798199)
2020-01-31T22:34:01.4104135Z ==============================================================================
2020-01-31T22:34:01.8499226Z Cleaning any cached credential from repository: rust-lang/rust (GitHub)
2020-01-31T22:34:01.8544182Z ##[section]Finishing: Checkout rust-lang/rust@refs/pull/68679/merge to s
2020-01-31T22:34:01.8684997Z Cleaning up task key
2020-01-31T22:34:01.8685761Z Start cleaning up orphan processes.
2020-01-31T22:34:01.8804879Z Terminate orphan process: pid (3957) (python)
2020-01-31T22:34:01.9371665Z ##[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 @TimNN. (Feature Requests)

src/librustc/ty/util.rs Outdated Show resolved Hide resolved
@rust-highfive

This comment has been minimized.

@matthewjasper matthewjasper force-pushed the needs-type-op branch 3 times, most recently from ef8d4e2 to 802e184 Compare February 1, 2020 11:42
@matthewjasper
Copy link
Contributor Author

@bors try @rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion

@bors
Copy link
Contributor

bors commented Feb 1, 2020

⌛ Trying commit 802e184 with merge 2f9a0f5...

bors added a commit that referenced this pull request Feb 1, 2020
Improve `ty.needs_drop`

* Handle cycles in `needs_drop` correctly
* Normalize types when computing `needs_drop`
* Move queries from rustc to rustc_ty
* Avoid query in simple cases

reopens #65918
@bors
Copy link
Contributor

bors commented Feb 1, 2020

☀️ Try build successful - checks-azure
Build commit: 2f9a0f5 (2f9a0f5ea5f5a0dee754bcf9a04860409dbda290)

@rust-timer
Copy link
Collaborator

Queued 2f9a0f5 with parent 6c0b779, future comparison URL.

@Zoxc
Copy link
Contributor

Zoxc commented Feb 2, 2020

@bors try @rust-timer queue

@bors
Copy link
Contributor

bors commented Feb 2, 2020

⌛ Trying commit 802e184 with merge d596559b9cb2e0f3efe1e7a4bb8038dfde649f4c...

@Zoxc
Copy link
Contributor

Zoxc commented Feb 2, 2020

Checking performance impact after #68672

@bors
Copy link
Contributor

bors commented Feb 2, 2020

☀️ Try build successful - checks-azure
Build commit: d596559b9cb2e0f3efe1e7a4bb8038dfde649f4c (d596559b9cb2e0f3efe1e7a4bb8038dfde649f4c)

Union fields have the ParamEnv of the union.
* Handle cycles in `needs_drop` correctly
* Normalize types when computing `needs_drop`
* Move queries from rustc to rustc_ty
* Handle arrays with const-generic lengths
* Use closure for repeated code.
@matthewjasper
Copy link
Contributor Author

@bors r=varkor

@bors
Copy link
Contributor

bors commented Feb 10, 2020

📌 Commit c38b4b6 has been approved by varkor

@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-review Status: Awaiting review from the assignee but also interested parties. labels Feb 10, 2020
@jonas-schievink
Copy link
Contributor

@bors r-

Failed in #69056

@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 Feb 11, 2020
@matthewjasper
Copy link
Contributor Author

@bors r=varkor rollup=never

@bors
Copy link
Contributor

bors commented Feb 11, 2020

📌 Commit 30a8353 has been approved by varkor

@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 Feb 11, 2020
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Feb 12, 2020
Improve `ty.needs_drop`

* Handle cycles in `needs_drop` correctly
* Normalize types when computing `needs_drop`
* Move queries from rustc to rustc_ty
* Avoid query in simple cases

reopens rust-lang#65918
@Dylan-DPC-zz
Copy link

@bors p=1

@bors
Copy link
Contributor

bors commented Feb 12, 2020

⌛ Testing commit 30a8353 with merge a1912f2...

bors added a commit that referenced this pull request Feb 12, 2020
Improve `ty.needs_drop`

* Handle cycles in `needs_drop` correctly
* Normalize types when computing `needs_drop`
* Move queries from rustc to rustc_ty
* Avoid query in simple cases

reopens #65918
@bors
Copy link
Contributor

bors commented Feb 12, 2020

☀️ Test successful - checks-azure
Approved by: varkor
Pushing a1912f2 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Feb 12, 2020
@bors bors merged commit 30a8353 into rust-lang:master Feb 12, 2020
@matthewjasper matthewjasper deleted the needs-type-op branch February 12, 2020 23:06
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. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

10 participants