Skip to content

use closure def-id in returns, but base def-id in locals #54599

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

Merged
merged 1 commit into from
Sep 29, 2018

Conversation

nikomatsakis
Copy link
Contributor

The refactorings to handle let x: impl Trait wound up breaking impl Trait in closure return types. I think there are some deeper problems with the code in question, but this a least should make @eddyb's example work.

Fixes #54593

r? @eddyb

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 26, 2018
Using the `closure_base_def_id` indiscriminantely, as we were doing
before, winds up "going wrong" if the closure type includes the `impl
Trait` from the parent. The problem arises because the return value
for closures is inferred and meant to treat the return
type *opaquely*, so we don't want to be "desugaring" it into the
underlying type.
@eddyb
Copy link
Member

eddyb commented Sep 27, 2018

@bors r+

@bors
Copy link
Collaborator

bors commented Sep 27, 2018

📌 Commit bcfdfe4 has been approved by eddyb

@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 Sep 27, 2018
@bors
Copy link
Collaborator

bors commented Sep 28, 2018

⌛ Testing commit bcfdfe4 with merge 4ef6e9410d8920c12e31e5337962076b77722d66...

@bors
Copy link
Collaborator

bors commented Sep 28, 2018

💔 Test failed - status-travis

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Sep 28, 2018
@rust-highfive
Copy link
Contributor

The job dist-aarch64-linux 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.
151412 ./src/tools/clang
149116 ./src/llvm-emscripten/test
148656 ./obj/build/bootstrap/debug/incremental
134216 ./obj/build/bootstrap/debug/incremental/bootstrap-2zc4gzhr0d54q
134212 ./obj/build/bootstrap/debug/incremental/bootstrap-2zc4gzhr0d54q/s-f58eoporaz-wy13vc-abll1u66rzrn
104700 ./src/tools/lldb
98940 ./obj/build/x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/codegen-backends
93748 ./src/tools/clang/test
72532 ./src/llvm/lib
---
travis_time:end:0e580ad0:start=1538164969513627654,finish=1538164969521606946,duration=7979292
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:04243eaa
$ ln -s . checkout && for CORE in obj/cores/core.*; do EXE=$(echo $CORE | sed 's|obj/cores/core\.[0-9]*\.!checkout!\(.*\)|\1|;y|!|/|'); if [ -f "$EXE" ]; then printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" "$CORE"; gdb --batch -q -c "$CORE" "$EXE" -iex 'set auto-load off' -iex 'dir src/' -iex 'set sysroot .' -ex bt -ex q; echo travis_fold":"end:crashlog; fi; done || true
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:25a8ee9d
travis_time:start:25a8ee9d
$ cat ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers || true
cat: ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers: No such file or directory
travis_fold:end:after_failure.5
travis_fold:start:after_failure.6
travis_time:start:02a8d8e0
$ dmesg | grep -i kill

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)

@alexcrichton
Copy link
Member

@bors: retry

@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 Sep 28, 2018
@bors
Copy link
Collaborator

bors commented Sep 29, 2018

⌛ Testing commit bcfdfe4 with merge eb50e75...

bors added a commit that referenced this pull request Sep 29, 2018
use closure def-id in returns, but base def-id in locals

The refactorings to  handle `let x: impl Trait`  wound up breaking `impl Trait` in closure return types. I think there are some deeper problems with the code in question, but this a least should make @eddyb's example work.

Fixes #54593

r? @eddyb
@bors
Copy link
Collaborator

bors commented Sep 29, 2018

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

@bors bors merged commit bcfdfe4 into rust-lang:master Sep 29, 2018
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants