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

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

Merged
merged 1 commit into from
Jan 7, 2019

Conversation

davidtwco
Copy link
Member

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 rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 3, 2019
@nikomatsakis nikomatsakis mentioned this pull request Jan 3, 2019
@rust-highfive

This comment has been minimized.

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 Show resolved Hide resolved
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.
@nikomatsakis
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Jan 4, 2019

📌 Commit 4933793 has been approved by nikomatsakis

@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 Jan 4, 2019
@bors
Copy link
Contributor

bors commented Jan 6, 2019

⌛ Testing commit 4933793 with merge 355347541f176f38a81dc67b36bbdcb81d758b7c...

@bors
Copy link
Contributor

bors commented Jan 6, 2019

💔 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 Jan 6, 2019
@rust-highfive
Copy link
Collaborator

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
Copy link
Contributor

@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 Jan 7, 2019
@nikomatsakis
Copy link
Contributor

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
Copy link
Member

cc #55861

@bors
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
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
Copy link
Contributor

bors commented Jan 7, 2019

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

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.

matching against an associated constant gives type error
5 participants