Skip to content

Don't use lift to detect local types - #61871

Merged
bors merged 2 commits into
rust-lang:masterfrom
Zoxc:no-lift-branch
Jul 2, 2019
Merged

Don't use lift to detect local types#61871
bors merged 2 commits into
rust-lang:masterfrom
Zoxc:no-lift-branch

Conversation

@Zoxc

@ZoxcZoxc commented Jun 15, 2019

Copy link
Copy Markdown
Contributor

This overlaps with #61392.

r? @eddyb

@rust-highfiverust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 15, 2019
@rust-highfive

Copy link
Copy Markdown
Contributor

The job x86_64-gnu-llvm-6.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:05217f82:start=1560626469432056280,finish=1560626564629490044,duration=95197433764
$ 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
$ export GCP_CACHE_BUCKET=rust-lang-ci-cache
$ export AWS_ACCESS_KEY_ID=AKIA46X5W6CZEJZ6XT55
---
[00:03:49] travis_fold:start:tidy
travis_time:start:tidy
tidy check
[00:03:49] tidy error: /checkout/src/librustc/ty/context.rs: too many lines (3068) (add `// ignore-tidy-filelength` to the file to suppress this error)
[00:03:54] some tidy checks failed
[00:03:54] [00:03:54] [00:03:54] 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:54] [00:03:54] [00:03:54] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test src/tools/tidy
[00:03:54] Build completed unsuccessfully in 0:01:11
---
travis_time:end:150ef786:start=1560626809115496126,finish=1560626809120038297,duration=4542171
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:18c8ef24
$ 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:0e9e7588
travis_time:start:0e9e7588
$ 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:000f04a8
$ 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)

@rust-highfive

Copy link
Copy Markdown
Contributor

The job x86_64-gnu-llvm-6.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:047c93c4:start=1560627424950581360,finish=1560627514195892917,duration=89245311557
$ 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
$ export GCP_CACHE_BUCKET=rust-lang-ci-cache
$ export AWS_ACCESS_KEY_ID=AKIA46X5W6CZEJZ6XT55
---
[00:14:37] Compiling rustc_mir v0.0.0 (/checkout/src/librustc_mir)
[00:14:52] error: unused variable: `gcx`
[00:14:52] --> src/librustc_mir/borrow_check/nll/region_infer/mod.rs:812:13
[00:14:52] |
[00:14:52] 812 | let gcx = tcx.global_tcx();
[00:14:52] | ^^^ help: consider prefixing with an underscore: `_gcx`
[00:14:52] = note: `-D unused-variables` implied by `-D warnings`
[00:14:52] [00:15:01] Compiling rustc_typeck v0.0.0 (/checkout/src/librustc_typeck)
[00:15:02] error: aborting due to previous error
---
travis_time:end:2f83a7c6:start=1560628597803657351,finish=1560628597809069415,duration=5412064
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:12cc995e
$ 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:049b5600
travis_time:start:049b5600
$ 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:3241ba93
$ 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)

@Zoxc

Zoxc commented Jun 15, 2019

Copy link
Copy Markdown
ContributorAuthor

@bors try

@bors

bors commented Jun 15, 2019

Copy link
Copy Markdown
Collaborator

⌛ Trying commit 90fbfd7095ad0b022adb968bbc72ce51b55e2467 with merge 3e509e149d6644da28c5e2b642d164845e724047...

@ZoxcZoxc mentioned this pull request Jun 15, 2019
Comment threadsrc/librustc/infer/mod.rs Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

cc @rust-lang/compiler I think it might be better if we stop referring to these as "local values" and instead use something more like .has_infer_vars()?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

has_infer_types already exist and is a different property.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hmm, if self.infcx is None, this case should be impossible - it's plausible this code is unnecessarily defensive and lift_to_global's result could've been unwrap'd all along.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

I agree.

Comment threadsrc/librustc/traits/fulfill.rs Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I can't wait for this to use erasure and canonicalization instead (@oli-obk and @nikomatsakis are working on that, I think?).

Comment threadsrc/librustc/traits/mod.rs Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@rust-lang/wg-traits This is scary, can we do a crater run with a delay_span_bug in here?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@eddyb What happened to this?

Comment threadsrc/librustc/traits/project.rs Outdated
Comment threadsrc/librustc/traits/query/normalize.rs Outdated
Comment threadsrc/librustc_typeck/check/writeback.rs Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is it really that expensive? Anyway it should be impossible, given a correct Resolver.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

I don't know how expensive these are. They're not free though, so I'd prefer to not have them for release builds.

And yes, it should be impossible, that's why it's an assertion =P

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hmm, can we do a crater run with all of these assertions turned on by default, to confirm they're very likely never triggered, and then remove them?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

They're effectively turned on now, and they have caught at least one bug #46184.

I do think we should have these assertions somewhere though, to ensure that no infer types leaks out from typeck. I could just use debug_assert here instead of span_bug to make them more slim.

Comment threadsrc/librustc/traits/select.rs Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'd prefer if one of two things happened here (and in other places match-ing over lift_to_global results):

  • land a PR on master replacing the matches with if lets (you can just r=me that if you want)
  • keep the match and either use Option::filter or just match on the bool predicate

That is, I would prefer if indentation didn't change (and it only does because of the match -> if change).

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Why do you not want indention to change? I like less rightward drift, and I definitely don't like matching on bools.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It's fine to change, I just want to be able to read the diff without mentally pretending nothing changed without checking, where indentation is involved.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

I changed the indentation to reduce the diffs in this PR.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@eddyb you can append ?w=1 to the diff url to have whitespace insensitive diffs https://github.com/rust-lang/rust/pull/61871/files?w=1

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Nice. I also reordered some branches which that can't deal with though =P

Comment threadsrc/librustc/traits/fulfill.rs Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Same as the other match -> if change.

@Zoxc
Zoxcforce-pushed the no-lift-branch branch 3 times, most recently from a35c705 to fabe708CompareJune 16, 2019 13:32
@bors

bors commented Jun 19, 2019

Copy link
Copy Markdown
Collaborator

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

@rust-highfive

Copy link
Copy Markdown
Contributor

The job x86_64-gnu-llvm-6.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:1df9c270:start=1560968986542163132,finish=1560968987405713224,duration=863550092
$ 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
$ export GCP_CACHE_BUCKET=rust-lang-ci-cache
$ export AWS_ACCESS_KEY_ID=AKIA46X5W6CZEJZ6XT55
---
[00:04:52] travis_fold:start:tidy
travis_time:start:tidy
tidy check
[00:04:52] tidy error: /checkout/src/librustc/traits/fulfill.rs:480: line longer than 100 chars
[00:04:57] some tidy checks failed
[00:04:57] [00:04:57] [00:04:57] 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:04:57] [00:04:57] [00:04:57] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test src/tools/tidy
[00:04:57] Build completed unsuccessfully in 0:01:15
---
travis_time:end:24c77cd0:start=1560969296547077810,finish=1560969296551855472,duration=4777662
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:0e6f8794
$ 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:07441038
travis_time:start:07441038
$ 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:1d1a7b9f
$ 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)

@eddyb

eddyb commented Jul 1, 2019

Copy link
Copy Markdown
Contributor

@bors r+

@bors

bors commented Jul 1, 2019

Copy link
Copy Markdown
Collaborator

📌 Commit 8465daf has been approved by eddyb

@borsbors 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 1, 2019
@bors

bors commented Jul 1, 2019

Copy link
Copy Markdown
Collaborator

⌛ Testing commit 8465daf with merge ebe126b40db5acb422774453b0d9a2d821bb3755...

@emilyalbini

Copy link
Copy Markdown
Member

@bors retry

Yielding priority to the Azure migration.

Manishearth added a commit to Manishearth/rust that referenced this pull request Jul 2, 2019
Don't use lift to detect local types
This overlaps with rust-lang#61392.
r? @eddyb
@bors

bors commented Jul 2, 2019

Copy link
Copy Markdown
Collaborator

⌛ Testing commit 8465daf with merge ef064d2...

bors added a commit that referenced this pull request Jul 2, 2019
Don't use lift to detect local types
This overlaps with #61392.
r? @eddyb
@bors

bors commented Jul 2, 2019

Copy link
Copy Markdown
Collaborator

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

@borsbors added the merged-by-bors This PR was explicitly merged by bors. label Jul 2, 2019
@bors
bors merged commit 8465daf into rust-lang:masterJul 2, 2019
@Zoxc
Zoxc deleted the no-lift-branch branch July 2, 2019 11:46
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged-by-borsThis PR was explicitly merged by bors.S-waiting-on-borsStatus: 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.

7 participants

@Zoxc@rust-highfive@bors@eddyb@emilyalbini@Centril@estebank