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

NLL: Fix bug in associated constant type annotations. #57304

Merged
merged 1 commit into from Jan 7, 2019

Conversation

Projects
None yet
5 participants
@davidtwco
Copy link
Member

davidtwco commented Jan 3, 2019

Fixes #57280.

This PR reverses the variance used when relating types from the type
annotation of an associated constant - this matches the behaviour of the
lexical borrow checker and fixes a bug whereby matching a &'a str
against a &'static str would produce an error.

r? @nikomatsakis

@rust-highfive

This comment was marked as resolved.

Copy link
Collaborator

rust-highfive commented Jan 3, 2019

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:0542d420:start=1546526797984168220,finish=1546526799036624083,duration=1052455863
$ 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-6.0
---
travis_time:end:0f1965c3:start=1546530822152163238,finish=1546530822157505952,duration=5342714
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:0e17f40a
$ 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:1264f304
travis_time:start:1264f304
$ 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:110d2bf6
$ 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)

Show resolved Hide resolved src/librustc_mir/build/matches/mod.rs Outdated

@davidtwco davidtwco force-pushed the davidtwco:issue-57280 branch from c5cf810 to c601030 Jan 3, 2019

@davidtwco davidtwco force-pushed the davidtwco:issue-57280 branch from c601030 to a373ac1 Jan 3, 2019

Show resolved Hide resolved src/librustc_mir/hair/cx/block.rs Outdated
Show resolved Hide resolved src/librustc_mir/build/matches/mod.rs Outdated
Show resolved Hide resolved src/librustc_mir/hair/pattern/mod.rs
Show resolved Hide resolved src/librustc_mir/hair/pattern/mod.rs Outdated
Show resolved Hide resolved src/librustc_mir/hair/pattern/mod.rs
Show resolved Hide resolved src/librustc_mir/build/matches/mod.rs Outdated
Show resolved Hide resolved src/librustc_mir/build/matches/simplify.rs
Fix bug in associated constant type annotations.
This commit reverses the variance used when relating types from the type
annotation of an associated constant - this matches the behaviour of the
lexical borrow checker and fixes a bug whereby matching a `&'a str`
against a `&'static str` would produce an error.

@davidtwco davidtwco force-pushed the davidtwco:issue-57280 branch from a373ac1 to 4933793 Jan 3, 2019

@nikomatsakis

This comment has been minimized.

Copy link
Contributor

nikomatsakis commented Jan 4, 2019

@bors r+

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Jan 4, 2019

📌 Commit 4933793 has been approved by nikomatsakis

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Jan 6, 2019

⌛️ Testing commit 4933793 with merge 3553475...

bors added a commit that referenced this pull request Jan 6, 2019

Auto merge of #57304 - davidtwco:issue-57280, r=nikomatsakis
NLL: Fix bug in associated constant type annotations.

Fixes #57280.

This PR reverses the variance used when relating types from the type
annotation of an associated constant - this matches the behaviour of the
lexical borrow checker and fixes a bug whereby matching a `&'a str`
against a `&'static str` would produce an error.

r? @nikomatsakis
@bors

This comment has been minimized.

Copy link
Contributor

bors commented Jan 6, 2019

💔 Test failed - status-travis

@rust-highfive

This comment has been minimized.

Copy link
Collaborator

rust-highfive commented Jan 6, 2019

The job arm-android 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.
[01:48:24] test vec::test_splice_unbounded ... ok
[01:48:24] test vec::test_split_at_mut ... ok
[01:48:24] test vec::test_split_off ... ok
[01:48:24] test vec::test_swap_remove_empty ... ok
[01:48:25] died due to signal 11
[01:48:25] 
[01:48:25] 
[01:48:25] 
[01:48:25] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "test" "--target" "arm-linux-androideabi" "-j" "4" "--release" "--locked" "--color" "always" "--features" "panic-unwind backtrace" "--manifest-path" "/checkout/src/libstd/Cargo.toml" "-p" "alloc" "--"
[01:48:25] 
[01:48:25] 
[01:48:25] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test --target arm-linux-androideabi
[01:48:25] Build completed unsuccessfully in 1:38:05
---
travis_time:end:27dfa8f8:start=1546807109913681851,finish=1546807109930439636,duration=16757785
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:0fdbd5db
$ 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:04d4d9bc
travis_time:start:04d4d9bc
$ 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:0465b8f8
$ 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

This comment has been minimized.

Copy link
Contributor

nikomatsakis commented Jan 7, 2019

@bors retry

@nikomatsakis

This comment has been minimized.

Copy link
Contributor

nikomatsakis commented Jan 7, 2019

cc @rust-lang/infra -- this failure looked unrelated to the PR:

[01:48:24] test vec::test_splice_unbounded ... ok
[01:48:24] test vec::test_split_at_mut ... ok
[01:48:24] test vec::test_split_off ... ok
[01:48:24] test vec::test_swap_remove_empty ... ok
[01:48:25] died due to signal 11
@pietroalbini

This comment has been minimized.

Copy link
Member

pietroalbini commented Jan 7, 2019

cc #55861

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Jan 7, 2019

⌛️ Testing commit 4933793 with merge 21ac19d...

bors added a commit that referenced this pull request Jan 7, 2019

Auto merge of #57304 - davidtwco:issue-57280, r=nikomatsakis
NLL: Fix bug in associated constant type annotations.

Fixes #57280.

This PR reverses the variance used when relating types from the type
annotation of an associated constant - this matches the behaviour of the
lexical borrow checker and fixes a bug whereby matching a `&'a str`
against a `&'static str` would produce an error.

r? @nikomatsakis
@bors

This comment has been minimized.

Copy link
Contributor

bors commented Jan 7, 2019

☀️ Test successful - status-appveyor, status-travis
Approved by: nikomatsakis
Pushing 21ac19d to master...

@bors bors merged commit 4933793 into rust-lang:master Jan 7, 2019

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details

@davidtwco davidtwco deleted the davidtwco:issue-57280 branch Jan 8, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment