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

Propagate all closure requirements to the caller #56486

Merged
merged 2 commits into from
Dec 4, 2018

Conversation

matthewjasper
Copy link
Contributor

Closes #56477

This should be backported to 1.32 if it doesn't make the cut.

r? @pnkfelix
cc @nikomatsakis

@matthewjasper matthewjasper added the beta-nominated Nominated for backporting to the compiler in the beta channel. label Dec 3, 2018
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Dec 3, 2018
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-5.0 of your PR failed on Travis (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.
travis_time:end:0932e2f0:start=1543879274842536031,finish=1543879276088840360,duration=1246304329
$ git checkout -qf FETCH_HEAD
travis_fold:end:git.checkout

Encrypted environment variables have been removed for security reasons.
See https://docs.travis-ci.com/user/pull-requests/#Pull-Requests-and-Security-Restrictions
$ export SCCACHE_BUCKET=rust-lang-ci-sccache2
$ export SCCACHE_REGION=us-west-1
Setting environment variables from .travis.yml
$ export IMAGE=x86_64-gnu-llvm-5.0
---
[00:29:15] error: unsatisfied lifetime constraints
[00:29:15]    --> src/librustc_typeck/check/wfcheck.rs:358:5
[00:29:15]     |
[00:29:15] 350 | fn check_item_type<'a, 'tcx>(
[00:29:15]     |                    --  ---- lifetime `'tcx` defined here
[00:29:15]     |                    lifetime `'a` defined here
[00:29:15] ...
[00:29:15] ...
[00:29:15] 358 |     for_id(tcx, item_id, ty_span).with_fcx(|fcx, _this| {
[00:29:15]     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ argument requires that `'a` must outlive `'tcx`
[00:29:15] 
[00:29:15] error[E0716]: temporary value dropped while borrowed
[00:29:15]    --> src/librustc_typeck/check/wfcheck.rs:358:5
[00:29:15] 350 |   fn check_item_type<'a, 'tcx>(
[00:29:15] 350 |   fn check_item_type<'a, 'tcx>(
[00:29:15]     |                          ---- lifetime `'tcx` defined here
[00:29:15] ...
[00:29:15] 358 |       for_id(tcx, item_id, ty_span).with_fcx(|fcx, _this| {
[00:29:15]     |       -^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[00:29:15]     |       |
[00:29:15]     |  _____creates a temporary which is freed while still in use
[00:29:15]     | |
[00:29:15] 359 | |         let ty = fcx.tcx.type_of(fcx.tcx.hir.local_def_id(item_id));
[00:29:15] 360 | |         let item_ty = fcx.normalize_associated_types_in(ty_span, &ty);
[00:29:15] ...   |
[00:29:15] ...   |
[00:29:15] 378 | |         vec![] // no implied bounds in a const etc
[00:29:15] 379 | |     });
[00:29:15]     | |      -- temporary value is freed at the end of this statement
[00:29:15]     | |______|
[00:29:15]     |        argument requires that borrow lasts for `'tcx`
[00:29:17] error: aborting due to 2 previous errors
[00:29:17] 
[00:29:17] For more information about this error, try `rustc --explain E0716`.
[00:29:17] error: Could not compile `rustc_typeck`.

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)

@pnkfelix
Copy link
Member

pnkfelix commented Dec 4, 2018

oh wow what a bug!

@pnkfelix
Copy link
Member

pnkfelix commented Dec 4, 2018

@bors r+ p=1

@bors
Copy link
Contributor

bors commented Dec 4, 2018

📌 Commit d748712 has been approved by pnkfelix

@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 Dec 4, 2018
@matthewjasper
Copy link
Contributor Author

@bors r- investigating build failure.

@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 Dec 4, 2018
There are two `TyCtxt`s, one global, one local. Methods must be called
on the right one, as they differ by invariant lifetimes.
@matthewjasper
Copy link
Contributor Author

@bors r=pnkfelix

@bors
Copy link
Contributor

bors commented Dec 4, 2018

📌 Commit b2e6da7 has been approved by pnkfelix

@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 Dec 4, 2018
@bors
Copy link
Contributor

bors commented Dec 4, 2018

⌛ Testing commit b2e6da7 with merge b3af092...

bors added a commit that referenced this pull request Dec 4, 2018
…pnkfelix

Propagate all closure requirements to the caller

Closes #56477

This should be backported to 1.32 if it doesn't make the cut.

r? @pnkfelix
cc @nikomatsakis
@pietroalbini pietroalbini added the stable-nominated Nominated for backporting to the compiler in the stable channel. label Dec 4, 2018
@Mark-Simulacrum
Copy link
Member

@bors p=10

@pietroalbini pietroalbini removed the beta-nominated Nominated for backporting to the compiler in the beta channel. label Dec 4, 2018
@pietroalbini
Copy link
Member

This is going to be included in the 1.31.0 release: #56518

@pietroalbini pietroalbini added stable-accepted Accepted for backporting to the compiler in the stable channel. and removed stable-nominated Nominated for backporting to the compiler in the stable channel. labels Dec 4, 2018
@bors
Copy link
Contributor

bors commented Dec 4, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: pnkfelix
Pushing b3af092 to master...

@bors bors merged commit b2e6da7 into rust-lang:master Dec 4, 2018
bors added a commit that referenced this pull request Dec 4, 2018
[stable] Add a few critical fixes to the 1.31.0 release

This PR cherry-picks the following PRs to stable:

* #56467: Bump stack size to 32MB
* #56486: Propagate all closure requirements to the caller
* #56519: update edition guide

The changes will be included in the final 1.31.0 binary (to avoid a point release). To deploy the build to dev-static the old manifest needs to be removed from the bucket after the PR is merged.

cc @rust-lang/core @rust-lang/release @rust-lang/compiler
r? @alexcrichton
@matthewjasper matthewjasper deleted the propagate-all-closure-bounds branch December 8, 2018 18:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. stable-accepted Accepted for backporting to the compiler in the stable channel.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants