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

Issue 52057 — inference variable #52731

Merged
merged 8 commits into from
Jul 31, 2018

Conversation

nikomatsakis
Copy link
Contributor

Break out the computation of universal region relations and do it during the typeck, where we can handle the resulting constraints that arise.

r? @pnkfelix

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 26, 2018
@nikomatsakis
Copy link
Contributor Author

A note on naming: I want to rename universal_region to free_region (which was actually the name I used originally...) both because it's less awkward and because we have two kinds of universally quantified regions: free regions (lifetime parameters) and bound regions like the one in for<'a> fn(&'a u32). In particular, free regions appear free in the fn body, but bound regions do not.

I wound up not doing the rename in this PR though because it would conflict so badly with #52488

@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.

[00:03:26] travis_fold:start:tidy
travis_time:start:tidy
tidy check
[00:03:27] tidy error: /checkout/src/librustc_mir/borrow_check/nll/region_infer/mod.rs:911: line longer than 100 chars
[00:03:27] tidy error: /checkout/src/librustc_mir/borrow_check/nll/region_infer/mod.rs:918: line longer than 100 chars
[00:03:28] some tidy checks failed
[00:03:28] 
[00:03:28] 
[00:03:28] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/tidy" "/checkout/src" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "--no-vendor" "--quiet"
[00:03:28] 
[00:03:28] 
[00:03:28] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test src/tools/tidy
[00:03:28] Build completed unsuccessfully in 0:00:43
[00:03:28] Build completed unsuccessfully in 0:00:43
[00:03:28] Makefile:79: recipe for target 'tidy' failed
[00:03:28] make: *** [tidy] Error 1

The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:00bb3938
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
---
travis_time:end:0f3ef3d4:start=1532607911117991719,finish=1532607911123170053,duration=5178334
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:1510d9a6
$ 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 -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:075f869a
travis_time:start:075f869a
$ 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:12550024
$ 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)

@nikomatsakis
Copy link
Contributor Author

@bors p=1 -- this is a major blocker for NLL + EP2 in terms of causing ICEs and errors

@nikomatsakis nikomatsakis force-pushed the issue-52057-inference-variable branch from 5dbcb11 to 03ea954 Compare July 26, 2018 20:46
@pietroalbini
Copy link
Member

Ping from triage @pnkfelix! This PR needs your review.

/// normalize the input-output types, which we then need later. So we
/// return those. This vector consists of first the input types and
/// then the output type as the last element.
type NormalizedInputsAndOutput<'tcx> = Vec<Ty<'tcx>>;
Copy link
Member

Choose a reason for hiding this comment

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

I'll not block review on this, but I'm sort of surprised you went with a Vec<Ty> with special case info about the last element rather than a (Vec<Ty>, Ty) ...

@pnkfelix
Copy link
Member

r=me

since there are conflicts and niko is on PTO, I might take a shot at resolving the conflicts myself

@pnkfelix
Copy link
Member

conflicts! That's what you get for trying to opt into new features!

@pnkfelix pnkfelix force-pushed the issue-52057-inference-variable branch from 03ea954 to b9652ae Compare July 31, 2018 00:32
@pnkfelix
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Jul 31, 2018

📌 Commit b9652ae 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 Jul 31, 2018
@bors
Copy link
Contributor

bors commented Jul 31, 2018

⌛ Testing commit b9652ae with merge cc408fb...

bors added a commit that referenced this pull request Jul 31, 2018
…=pnkfelix

Issue 52057 — inference variable

Break out the computation of universal region relations and do it during the typeck, where we can handle the resulting constraints that arise.

r? @pnkfelix
@bors
Copy link
Contributor

bors commented Jul 31, 2018

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

@bors bors merged commit b9652ae into rust-lang:master Jul 31, 2018
@lqd lqd mentioned this pull request Jul 31, 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