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

Implement the Re-rebalance coherence RFC #56145

Open
wants to merge 8 commits into
base: master
from

Conversation

Projects
None yet
5 participants
@weiznich
Contributor

weiznich commented Nov 21, 2018

This is the first time I touch anything in the compiler so just tell me if I got something wrong.

Big thanks to @sgrif for the pointers where to look for those things.
cc #55437

@rust-highfive

This comment has been minimized.

Collaborator

rust-highfive commented Nov 21, 2018

r? @varkor

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive

This comment was marked as resolved.

Collaborator

rust-highfive commented Nov 21, 2018

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.
travis_time:end:086f3864:start=1542837703580203705,finish=1542837757045396633,duration=53465192928
$ 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-5.0
---
476 ./src/test/ui-fulldeps
472 ./src/libstd/sys/unix
468 ./src/test/ui/resolve
448 ./src/test/ui/traits
448 ./src/test/ui/re_rebalance_coherence
440 ./src/doc/unstable-book
436 ./src/test/ui/privacy
432 ./src/librustc_resolve
432 ./src/doc/unstable-book/src
---

[00:03:41] travis_fold:start:tidy
travis_time:start:tidy
tidy check
[00:03:42] tidy error: /checkout/src/librustc/traits/coherence.rs:378: line longer than 100 chars
[00:03:43] some tidy checks failed
[00:03:43] 
[00:03:43] 
[00:03:43] 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:43] 
[00:03:43] 
[00:03:43] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test src/tools/tidy
[00:03:43] Build completed unsuccessfully in 0:00:54
[00:03:43] Build completed unsuccessfully in 0:00:54
[00:03:43] Makefile:79: recipe for target 'tidy' failed
[00:03:43] make: *** [tidy] Error 1
The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:001d674e
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
Wed Nov 21 22:06:28 UTC 2018
---
travis_time:end:00464829:start=1542837989389297703,finish=1542837989393934802,duration=4637099
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:16908eb3
$ 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:08ca4cd1
travis_time:start:08ca4cd1
$ 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:0150aba8
$ 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)

@varkor

I haven't checked over the tests yet, but the code looks good. I'll try to look at the tests soon.

Show resolved Hide resolved src/doc/unstable-book/src/language-features/re-rebalance-coherence.md Outdated
impls are allowed in crates.
The following rule is used:

Given `impl<P1..=Pn> Trait<T1..=Tn> for T0`, an impl is valid only if at

This comment has been minimized.

@varkor

varkor Nov 22, 2018

Member

Is this "if and only if"?

This comment has been minimized.

@weiznich

weiznich Nov 22, 2018

Contributor

That's directly copied from the RFC. I think it should be "if and only if" but's not written there. (cc @sgrif who has written that thing)

Show resolved Hide resolved src/librustc/traits/coherence.rs Outdated
@weiznich

This comment has been minimized.

Contributor

weiznich commented Nov 27, 2018

@varkor I've addressed your review comments.

@bors

This comment has been minimized.

Contributor

bors commented Dec 1, 2018

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

@varkor

This comment has been minimized.

Member

varkor commented Dec 1, 2018

Sorry about the delay @weiznich. I'll get to this soon.

@weiznich weiznich force-pushed the weiznich:re_rebalance_coherence branch from 6361b15 to 07328d5 Dec 3, 2018

@weiznich

This comment has been minimized.

Contributor

weiznich commented Dec 3, 2018

@varkor I've rebased the PR.

@@ -393,6 +393,9 @@ declare_features! (
// `extern` in paths
(active, extern_in_paths, "1.23.0", Some(55600), None),

// Use `?` as the Kleene "at most one" operator

This comment has been minimized.

@varkor

varkor Dec 5, 2018

Member

You seem to have accidentally pulled in some extra changes with the rebase.

@varkor

This comment has been minimized.

Member

varkor commented Dec 5, 2018

At the moment, the fact that all the coherence tests have been duplicated under the new feature flag seems a little excessive. I'm not quite sure what the correct approach here is though: we do want to make sure we don't break anything. I wonder if it would be appropriate to run the tests in two modes, a bit like NLL does at the moment. Alternatively, we could have a few tests that cover a representative sample of existing cases, under the assumption that the algorithm is mostly the same anyway and when stabilised, the existing tests are going to come into effect anyway.

Could you point out which tests are new (and demonstrate the new behaviour), so I can check those in particular?

I think @nikomatsakis will have better ideas about the right solution re. tests, so I'm going to reassign. The actual change looks good to me, though (once the rebase issues are fixed).

r? @nikomatsakis

@rust-highfive rust-highfive assigned nikomatsakis and unassigned varkor Dec 5, 2018

@weiznich

This comment has been minimized.

Contributor

weiznich commented Dec 6, 2018

Could you point out which tests are new (and demonstrate the new behaviour), so I can check those in particular?

This one and this one is new. All other tests are just a copied version of the old coherence tests with the re_rebalance feature enabled.

At the moment, the fact that all the coherence tests have been duplicated under the new feature flag seems a little excessive. I'm not quite sure what the correct approach here is though: we do want to make sure we don't break anything. I wonder if it would be appropriate to run the tests in two modes, a bit like NLL does at the moment. Alternatively, we could have a few tests that cover a representative sample of existing cases, under the assumption that the algorithm is mostly the same anyway and when stabilised, the existing tests are going to come into effect anyway.

I'm not sure what would be a representative sample of the existing test cases here, nor I'm knowing what needs to be changed to run the existing tests using two modes. Would be great to get some more input here.

@weiznich weiznich force-pushed the weiznich:re_rebalance_coherence branch 2 times, most recently from 06c2a37 to 8a97a74 Dec 6, 2018

@rust-highfive

This comment has been minimized.

Collaborator

rust-highfive commented Dec 6, 2018

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.
travis_time:end:0ad13af8:start=1544096341158726535,finish=1544096344133678538,duration=2974952003
$ 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-5.0
---
472 ./src/libstd/sys/unix
468 ./src/test/ui/resolve
460 ./src/test/ui/rust-2018
448 ./src/test/ui/traits
448 ./src/test/ui/re_rebalance_coherence
444 ./src/test/ui/privacy
440 ./src/librustc_resolve
424 ./src/doc/unstable-book
416 ./src/test/ui/associated-types
---
[00:48:59] .................................................................................................... 1100/5166
[00:49:01] .................................................................................................... 1200/5166
[00:49:03] .................................................................................................... 1300/5166
[00:49:06] .................................................................................................... 1400/5166
[00:49:08] ..............................................................................F..................... 1500/5166
[00:49:15] .................................................................................................... 1700/5166
[00:49:18] .................................................................................................... 1800/5166
[00:49:21] .................................................................................................... 1900/5166
[00:49:24] ...................................i................................................................ 2000/5166
---
[00:50:24] ...........................................i........................................................ 3700/5166
[00:50:25] ..................................................................................................i. 3800/5166
[00:50:26] .................................................................................................... 3900/5166
[00:50:32] .................................................................................................... 4000/5166
[00:50:37] ........................................................................F........................... 4100/5166
[00:50:43] .................................................................................................... 4300/5166
[00:50:47] ...............................................i.................................................... 4400/5166
[00:50:53] .................................................................................................... 4500/5166
[00:50:56] .................................................................................................... 4600/5166
---
[00:51:12] .................................................................................................... 5100/5166
[00:51:14] .....i............................................................
[00:51:14] failures:
[00:51:14] 
[00:51:14] ---- [ui] ui/feature-gates/feature-gate-re-rebalance-coherence.rs stdout ----
[00:51:14] 
[00:51:14] error: /checkout/src/test/ui/feature-gates/feature-gate-re-rebalance-coherence.rs:10: unexpected error: '10:1: 10:70: type parameter `T` must be used as the type parameter for some local type (e.g. `MyStruct<T>`) [E0210]'
[00:51:14] error: 1 unexpected errors found, 0 expected errors not found
[00:51:14] status: exit code: 1
[00:51:14] status: exit code: 1
[00:51:14] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/feature-gates/feature-gate-re-rebalance-coherence.rs" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/feature-gates/feature-gate-re-rebalance-coherence/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/feature-gates/feature-gate-re-rebalance-coherence/auxiliary" "-A" "unused"
[00:51:14]     Error {
[00:51:14]         line_num: 10,
[00:51:14]         kind: Some(
[00:51:14]             Error
[00:51:14]             Error
[00:51:14]         ),
[00:51:14]         msg: "10:1: 10:70: type parameter `T` must be used as the type parameter for some local type (e.g. `MyStruct<T>`) [E0210]"
[00:51:14] ]
[00:51:14] 
[00:51:14] 
[00:51:14] thread '[ui] ui/feature-gates/feature-gate-re-rebalance-coherence.rs' panicked at 'explicit panic', src/tools/compiletest/src/runtest.rs:1358:13
[00:51:14] 
[00:51:14] 
[00:51:14] ---- [ui] ui/re_rebalance_coherence/coherence-pair-covered-uncovered-1.rs stdout ----
[00:51:14] 
[00:51:14] error: /checkout/src/test/ui/re_rebalance_coherence/coherence-pair-covered-uncovered-1.rs:23: unexpected error: '23:1: 23:46: only traits defined in the current crate can be implemented for arbitrary types [E0117]'
[00:51:14] error: 1 unexpected errors found, 0 expected errors not found
[00:51:14] status: exit code: 1
[00:51:14] status: exit code: 1
[00:51:14] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/re_rebalance_coherence/coherence-pair-covered-uncovered-1.rs" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/re_rebalance_coherence/coherence-pair-covered-uncovered-1/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/re_rebalance_coherence/coherence-pair-covered-uncovered-1/auxiliary" "-A" "unused"
[00:51:14]     Error {
[00:51:14]         line_num: 23,
[00:51:14]         kind: Some(
[00:51:14]             Error
[00:51:14]             Error
[00:51:14]         ),
[00:51:14]         msg: "23:1: 23:46: only traits defined in the current crate can be implemented for arbitrary types [E0117]"
[00:51:14] ]
[00:51:14] 
[00:51:14] 
[00:51:14] thread '[ui] ui/re_rebalance_coherence/coherence-pair-covered-uncovered-1.rs' panicked at 'explicit panic', src/tools/compiletest/src/runtest.rs:1358:13
[00:51:14] 
[00:51:14] failures:
[00:51:14] failures:
[00:51:14]     [ui] ui/feature-gates/feature-gate-re-rebalance-coherence.rs
[00:51:14]     [ui] ui/re_rebalance_coherence/coherence-pair-covered-uncovered-1.rs
[00:51:14] test result: FAILED. 5140 passed; 2 failed; 24 ignored; 0 measured; 0 filtered out
[00:51:14] 
[00:51:14] thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:503:22
[00:51:14] 
[00:51:14] 
[00:51:14] 
[00:51:14] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/compiletest" "--compile-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" "--run-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "--rustc-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "--src-base" "/checkout/src/test/ui" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui" "--stage-id" "stage2-x86_64-unknown-linux-gnu" "--mode" "ui" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/usr/lib/llvm-5.0/bin/FileCheck" "--host-rustcflags" "-Crpath -O -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--target-rustcflags" "-Crpath -O -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--docck-python" "/usr/bin/python2.7" "--lldb-python" "/usr/bin/python2.7" "--gdb" "/usr/bin/gdb" "--quiet" "--llvm-version" "5.0.0\n" "--system-llvm" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--llvm-cxxflags" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"
[00:51:14] 
[00:51:14] 
[00:51:14] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[00:51:14] Build completed unsuccessfully in 0:04:03
[00:51:14] Build completed unsuccessfully in 0:04:03
[00:51:14] make: *** [check] Error 1
[00:51:14] Makefile:58: recipe for target 'check' failed
2411660 ./obj
2411620 ./obj/build
1765148 ./obj/build/x86_64-unknown-linux-gnu
1166296 ./src
---
143648 ./obj/build/x86_64-unknown-linux-gnu/test/ui
134920 ./.git/modules
134916 ./.git/modules/src
134748 ./obj/build/bootstrap/debug/incremental/bootstrap-1plb86h2refwc
134744 ./obj/build/bootstrap/debug/incremental/bootstrap-1plb86h2refwc/s-f7c44fwnbf-18uojqq-jerzeai9r9z3
130776 ./obj/build/x86_64-unknown-linux-gnu/stage0-bootstrap-tools/x86_64-unknown-linux-gnu
130772 ./obj/build/x86_64-unknown-linux-gnu/stage0-bootstrap-tools/x86_64-unknown-linux-gnu/release
125088 ./obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu
125084 ./obj/build/x8

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)

@bors

This comment has been minimized.

Contributor

bors commented Dec 6, 2018

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

@weiznich weiznich force-pushed the weiznich:re_rebalance_coherence branch from 8a97a74 to 852e95d Dec 6, 2018

@weiznich

This comment has been minimized.

Contributor

weiznich commented Dec 6, 2018

I'm not sure why those 2 tests fail. The corresponding .stderr files containing exactly those error messages...

@rust-highfive

This comment has been minimized.

Collaborator

rust-highfive commented Dec 6, 2018

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.
travis_time:end:0479004c:start=1544134215075933908,finish=1544134217485299789,duration=2409365881
$ 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-5.0
---
/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
  Downloading https://files.pythonhosted.org/packages/ff/94/838f88e12e6d3aadb427955e657f3fe3c763ee1ad9290d4601a287fed7d1/awscli-1.16.71-py2.py3-none-any.whl (1.4MB)
    0% |▎                               | 10kB 40.5MB/s eta 0:00:01
    1% |▌                               | 20kB 2.1MB/s eta 0:00:01
    2% |▊                               | 30kB 3.1MB/s eta 0:00:01
    2% |█                               | 40kB 2.0MB/s eta 0:00:01
---
472 ./src/libstd/sys/unix
468 ./src/test/ui/resolve
460 ./src/test/ui/rust-2018
448 ./src/test/ui/traits
448 ./src/test/ui/re_rebalance_coherence
444 ./src/test/ui/privacy
444 ./src/librustc_resolve
424 ./src/doc/unstable-book
416 ./src/test/ui/associated-types
---
[00:47:15] .................................................................................................... 1100/5183
[00:47:17] .................................................................................................... 1200/5183
[00:47:19] .................................................................................................... 1300/5183
[00:47:22] .................................................................................................... 1400/5183
[00:47:24] .................................................................................F.................. 1500/5183
[00:47:27] .............................i....................................................................i. 1600/5183
[00:47:34] .................................................................................................... 1800/5183
[00:47:37] .................................................................................................... 1900/5183
[00:47:41] .......................................i............................................................ 2000/5183
[00:47:45] .................................................................................................... 2100/5183
---
[00:48:38] ................................................i................................................... 3700/5183
[00:48:40] .................................................................................................... 3800/5183
[00:48:41] ...i................................................................................................ 3900/5183
[00:48:46] .................................................................................................... 4000/5183
[00:48:51] ...............................................................................F.................... 4100/5183
[00:48:57] .................................................................................................... 4300/5183
[00:49:01] ......................................................i............................................. 4400/5183
[00:49:06] .................................................................................................... 4500/5183
[00:49:09] .................................................................................................... 4600/5183
---
[00:49:24] .................................................................................................... 5100/5183
[00:49:26] ......................i............................................................
[00:49:26] failures:
[00:49:26] 
[00:49:26] ---- [ui] ui/feature-gates/feature-gate-re-rebalance-coherence.rs stdout ----
[00:49:26] 
[00:49:26] error: /checkout/src/test/ui/feature-gates/feature-gate-re-rebalance-coherence.rs:10: unexpected error: '10:1: 10:70: type parameter `T` must be used as the type parameter for some local type (e.g. `MyStruct<T>`) [E0210]'
[00:49:26] error: 1 unexpected errors found, 0 expected errors not found
[00:49:26] status: exit code: 1
[00:49:26] status: exit code: 1
[00:49:26] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/feature-gates/feature-gate-re-rebalance-coher_rebalance_coherence/coherence-pair-covered-uncovered-1.rs" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/re_rebalance_coherence/coherence-pair-covered-uncovered-1/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/re_rebalance_coherence/coherence-pair-covered-uncovered-1/auxiliary" "-A" "unused"
[00:49:26]     Error {
[00:49:26]         line_num: 23,
[00:49:26]         kind: Some(
[00:49:26]             Error
[00:49:26]             Error
[00:49:26]         ),
[00:49:26]         msg: "23:1: 23:46: only traits defined in the current crate can be implemented for arbitrary types [E0117]"
[00:49:26] ]
[00:49:26] 
[00:49:26] 
[00:49:26] thread '[ui] ui/re_rebalance_coherence/coherence-pair-covered-uncovered-1.rs' panicked at 'explicit panic', src/tools/compiletest/src/runtest.rs:1358:13
[00:49:26] 
[00:49:26] failures:
[00:49:26] failures:
[00:49:26]     [ui] ui/feature-gates/feature-gate-re-rebalance-coherence.rs
[00:49:26]     [ui] ui/re_rebalance_coherence/coherence-pair-covered-uncovered-1.rs
[00:49:26] test result: FAILED. 5157 passed; 2 failed; 24 ignored; 0 measured; 0 filtered out
[00:49:26] 
[00:49:26] thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:503:22
[00:49:26] 
[00:49:26] 
[00:49:26] 
[00:49:26] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/compiletest" "--compile-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" "--run-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "--rustc-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "--src-base" "/checkout/src/test/ui" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui" "--stage-id" "stage2-x86_64-unknown-linux-gnu" "--mode" "ui" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/usr/lib/llvm-5.0/bin/FileCheck" "--host-rustcflags" "-Crpath -O -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--target-rustcflags" "-Crpath -O -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--docck-python" "/usr/bin/python2.7" "--lldb-python" "/usr/bin/python2.7" "--gdb" "/usr/bin/gdb" "--quiet" "--llvm-version" "5.0.0\n" "--system-llvm" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--llvm-cxxflags" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"
[00:49:26] 
[00:49:26] 
[00:49:26] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[00:49:26] Build completed unsuccessfully in 0:03:57
[00:49:26] Build completed unsuccessfully in 0:03:57
[00:49:26] make: *** [check] Error 1
[00:49:26] Makefile:58: recipe for target 'check' failed
The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:13c72860
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
Thu Dec  6 22:59:53 UTC 2018
---
travis_time:end:06c75ad4:start=1544137194832883116,finish=1544137194838481555,duration=5598439
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:1d115745
$ ln -s . checkout && for CORE in obj/cores/core.*; do EXE=$(echo $CORE | sed 's|

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)

@weiznich

This comment has been minimized.

Contributor

weiznich commented Dec 11, 2018

@varkor @nikomatsakis Any news here?

@nikomatsakis

Seems great! I would like before r+'ing though to spend a bit more time checking over the tests.

struct Oracle;
impl Backend for Oracle {}
impl<'a, T:'a, Tab> QueryFragment<Oracle> for BatchInsert<'a, T, Tab> {}
// ~^ ERROR E0210

This comment has been minimized.

@nikomatsakis

nikomatsakis Dec 13, 2018

Contributor

This comment needs to be //~^ -- no space

@rust-highfive

This comment has been minimized.

Collaborator

rust-highfive commented Dec 14, 2018

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.
travis_time:end:0e6e87c0:start=1544786423331187056,finish=1544786477558750623,duration=54227563567
$ 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-5.0
---
472 ./src/libstd/sys/unix
468 ./src/test/ui/resolve
460 ./src/test/ui/rust-2018
448 ./src/test/ui/traits
448 ./src/test/ui/re_rebalance_coherence
444 ./src/test/ui/privacy
436 ./src/librustc_resolve
420 ./src/doc/unstable-book
416 ./src/test/ui/associated-types
---
[00:43:45] .................................................................................................... 1100/5225
[00:43:47] .................................................................................................... 1200/5225
[00:43:49] .................................................................................................... 1300/5225
[00:43:52] .................................................................................................... 1400/5225
[00:43:54] ................................................................................F................... 1500/5225
[00:43:57] ............................i....................................................................i.. 1600/5225
[00:44:03] .................................................................................................... 1800/5225
[00:44:06] .................................................................................................... 1900/5225
[00:44:09] ........................................i........................................................... 2000/5225
[00:44:13] .................................................................................................... 2100/5225
---
[00:45:06] ...................................................i................................................ 3700/5225
[00:45:07] .................................................................................................... 3800/5225
[00:45:09] ........i........................................................................................... 3900/5225
[00:45:13] .................................................................................................... 4000/5225
[00:45:21] .......................................................................................FF........F.. 4100/5225
[00:45:25] ..........F......................................................................................... 4200/5225
[00:45:31] ..............................................................................................i..... 4400/5225
[00:45:36] .................................................................................................... 4500/5225
[00:45:40] .................................................................................................... 4600/5225
[00:45:43] .................................................................................................... 4700/5225
[00:45:43] .................................................................................................... 4700/5225
[00:45:47] ................................................................................i................... 4800/5225
[00:45:50] .................................................................................................... 4900/5225
[00:45:53] .................................................................................................... 5000/5225
[00:45:56] .................................................................................................... 5100/5225
[00:45:58] ................................................................i................................... 5200/5225
86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/feature-gates/feature-gate-re-rebalance-coherence/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/feature-gates/feature-gate-re-rebalance-coherence/auxiliary" "-A" "unused"
[00:45:59] ------------------------------------------
[00:45:59] 
[00:45:59] ------------------------------------------
[00:45:59] stderr:
[00:45:59] stderr:
[00:45:59] ------------------------------------------
[00:45:59] {"message":"type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct<T>`)","code":{"code":"E0210","explanation":"\nThis error indicates a violation of one of Rust's orphan rules for trait\nimplementations. The rule concerns the use of type parameters in an\nimplementation of a foreign trait (a trait defined in another crate), and\nstates that type parameters must be \"covered\" by a local type. To understand\nwhat this means, it is perhaps easiest to consider a few examples.\n\nIf `ForeignTrait` is a trait defined in some external crate `foo`, then the\nfollowing trait `impl` is an error:\n\n```compile_fail,E0210\n# #[cfg(for_demonstration_only)]\nextern crate foo;\n# #[cfg(for_demonstration_only)]\nuse foo::ForeignTrait;\n# use std::panic::UnwindSafe as ForeignTrait;\n\nimpl<T> ForeignTrait for T { } // error\n# fn main() {}\n```\n\nTo work around this, it can be covered with a local type, `MyType`:\n\n```\n# use std::panic::on the design of the orphan rules, see [RFC 1023].\n\n[RFC 1023]: https://github.com/rust-lang/rfcs/blob/master/text/1023-rebalancing-coherence.md\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/feature-gates/feature-gate-re-rebalance-coherence.rs","byte_start":226,"byte_end":295,"line_start":10,"line_end":10,"column_start":1,"column_end":70,"is_primary":true,"text":[{"text":"impl<'a, T:'a, Tab> QueryFragment<Oracle> for BatchInsert<'a, T, Tab> {}","highlight_start":1,"highlight_end":70}],"label":"type parameter `T` must be used as the type parameter for some local type","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"only traits defined in the current crate can be implemented for a type parameter","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct<T>`)\n  --> /checkout/src/test/ui/feature-gates/feature-gate-re-rebalance-coherence.rs:10:1\n   |\nLL | impl<'a, T:'a, Tab> QueryFragment<Oracle> for BatchInsert<'a, T, Tab> {}\n   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type parameter `T` must be used as the type parameter for some local type\n   |\n   = note: only traits defined in the current crate can be implemented for a type parameter\n\n"}
[00:45:59] {"message":"aborting due to previous error","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to previous error\n\n"}
[00:45:59] {"message":"For more information about this error, try `rustc --explain E0210`.","code":null,"level":"","spans":[],"children":[],"rendered":"For more information about this error, try `rustc --explain E0210`.\n"}
[00:45:59] ------------------------------------------
[00:45:59] 
[00:45:59] 
[00:45:59] thread '[ui] ui/feature-gates/feature-gate-re-rebalance-coherence.rs' panicked at 'explicit panic', src/tools/compiletest/src/runtest.rs:3252:9
[00:45:59] 
[00:45:59] 
[00:45:59] ---- [ui] ui/re_rebalance_coherence/coherence-all-remote.rs stdout ----
[00:45:59] 
[00:45:59] 
[00:45:59] - error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g. `MyStruct<T>`)
[00:45:59] + error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct<T>`)
[00:45:59] 2   --> $DIR/coherence-all-remote.rs:18:1
[00:45:59] 3    |
[00:45:59] 4 LL | impl<T> Remote1<T> for isize { }
[00:45:59] 
[00:45:59] The actual stderr differed from the expected stderr.
[00:45:59] The actual stderr differed from the expected stderr.
[00:45:59] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/re_rebalance_coherence/coherence-all-remote/coherence-all-remote.stderr
[00:45:59] To update references, rerun the tests and pass the `--bless` flag
[00:45:59] To only update this specific test, also pass `--test-args re_rebalance_coherence/coherence-all-remote.rs`
[00:45:59] error: 1 errors occurred comparing output.
[00:45:59] status: exit code: 1
[00:45:59] status: exit code: 1
[00:45:59] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/re_rebalance_coherence/coherence-all-remote.rs" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/re_rebalance_coherence/coherence-all-remote/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/re_rebalance_coherence/coherence-all-remote/auxiliary" "-A" "unused"
[00:45:59] ------------------------------------------
[00:45:59] 
[00:45:59] ------------------------------------------
[00:45:59] stderr:
[00:45:59] stderr:
[00:45:59] ------------------------------------------
[00:45:59] {"message":"type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct<T>`)","code":{"code":"E0210","explanation":"\nThis error indicates a violation of one of Rust's orphan rules for trait\nimplementations. The rule concerns the use of type parameters in an\nimplementation of a foreign trait (a trait defined in another crate), and\nstates that type parameters must be \"covered\" by a local type. To understand\nwhat this means, it is perhaps easiest to consider a few examples.\n\nIf `ForeignTrait` is a trait defined in some external crate `foo`, then the\nfollowing trait `impl` is an error:\n\n```compile_fail,E0210\n# #[cfg(for_demonstration_only)]\nextern crate foo;\n# #[cfg(for_demonstration_only)]\nuse foo::ForeignTrait;\n# use std::panic::UnwindSafe as ForeignTrait;\n\nimpl<T> ForeignTrait for T { } // error\n# fn main() {}\n```\n\nTo work around this, it can be covered with a local type, `MyType`:\n\n```\n# use std::panic::UnwindSafe as ForeignTrait;\nstruct MyType<T>(T);\nimpl<T> ForeignTrait for MyType<T> { } // Ok\n```\n\nPlease note that a type alias is not sufficient.\n\nFor another example of an error, suppose there's another trait defined in `foo`\nnamed `ForeignTrait2` that takes two type parameters. Then this `impl` results\nin the same rule violation:\n\n```ignore (cannot-doctest-multicrate-project)\nstruct MyType2;\nimpl<T> ForeignTrait2<T, MyType<T>> for MyType2 { } // error\n```\n\nThe reason for this is that there are two appearances of type parameter `T` in\nthe `impl` header, both as parameters for `ForeignTrait2`. The first appearance\nis uncovered, and so runs afoul of the orphan rule.\n\nConsider one more example:\n\n```ignore (cannot-doctest-multicrate-project)\nimpl<T> ForeignTrait2<MyType<T>, T> for MyType2 { } // Ok\n```\n\nThis only differs from the previous `impl` in that the parameters `T` and\n`MyType<T>` for `ForeignTrait2` have been swapped. This example does *not*\nviolate the orphan rule; it is permitted.\n\nTo see why that last example was allowed, you need to understand the general\nrule. Unfortunately this rule is a bit tricky to state. Consider an `impl`:\n\n```ignore (only-for-syntax-highlight)\nimpl<P1, ..., Pm> ForeignTrait<T1, ..., Tn> for T0 { ... }\n```\n\nwhere `P1, ..., Pm` are the type parameters of the `impl` and `T0, ..., Tn`\nare types. One of the types `T0, ..., Tn` must be a local type (this is another\norphan rule, see the explanation for E0117). Let `i` be the smallest integer\nsuch that `Ti` is a local type. Then no type parameter can appear in any of the\n`Tj` for `j < i`.\n\nFor information on the design of the orphan rules, see [RFC 1023].\n\n[RFC 1023]: https://github.com/rust-lang/rfcs/blob/master/text/1023-rebalancing-coherence.md\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/re_rebalance_coherence/coherence-all-remote.rs","byte_start":589,"byte_end":617,"line_start":18,"line_end":18,"column_start":1,"column_end":29,"is_primary":true,"text":[{"text":"impl<T> Remote1<T> for isize { }","highlight_start":1,"highlight_end":29}],"label":"type parameter `T` must be used as the type parameter for some local type","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"only traits defined in the current crate can be implemented for a type parameter","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct<T>`)\n  --> /checkout/src/test/ui/re_rebalance_coherence/coherence-all-remote.rs:18:1\n   |\nLL | impl<T> Remote1<T> for isize { }\n   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type parameter `T` must be used as the type parameter for some local type\n   |\n   = note: only traits defined in the current crate can be implemented for a type parameter\n\n"}
[00:45:59] {"message":"aborting due to previous error","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to previous error\n\n"}
[00:45:59] {"message":"For more information about this error, try `rustc --explain E0210`.","code":null,"level":"","spans":[],"children":[],"rendered":"For more information about this error, try `rustc --explain E0210`.\n"}t-param/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/re_rebalance_coherence/coherence-bigint-param/auxiliary" "-A" "unused"
[00:45:59] ------------------------------------------
[00:45:59] 
[00:45:59] ------------------------------------------
[00:45:59] stderr:
[00:45:59] stderr:
[00:45:59] ------------------------------------------
[00:45:59] {"message":"type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct<T>`)","code":{"code":"E0210","explanation":"\nThis error indicates a violation of one of Rust's orphan rules for trait\nimplementations. The rule concerns the use of type parameters in an\nimplementation of a foreign trait (a trait defined in another crate), and\nstates that type parameters must be \"covered\" by a local type. To understand\nwhat this means, it is perhaps easiest to consider a few examples.\n\nIf `ForeignTrait` is a trait defined in some external crate `foo`, then the\nfollowing trait `impl` is an error:\n\n```compile_fail,E0210\n# #[cfg(for_demonstration_only)]\nextern crate foo;\n# #[cfg(for_demonstration_only)]\nuse foo::ForeignTrait;\n# use std::panic::UnwindSafe as ForeignTrait;\n\nimpl<T> ForeignTrait for T { } // error\n# fn main() {}\n```\n\nTo work around this, it can be covered with a local type, `MyType`:\n\n```\n# use std::panic::UnwindSafe as ForeignTrait;\nstruct MyType<T>(T);\nimpl<T> ForeignTrait for MyType<T> { } // Ok\n```\n\nPlease note that a type alias is not sufficient.\n\nFor another example of an error, suppose there's another trait defined in `foo`\nnamed `ForeignTrait2` that takes two type parameters. Then this `impl` results\nin the same rule violation:\n\n```ignore (cannot-doctest-multicrate-project)\nstruct MyType2;\nimpl<T> ForeignTrait2<T, MyType<T>> for MyType2 { } // error\n```\n\nThe reason for this is that there are two appearances of type parameter `T` in\nthe `impl` header, both as parameters for `ForeignTrait2`. The first appearance\nis uncovered, and so runs afoul of the orphan rule.\n\nConsider one more example:\n\n```ignore (cannot-doctest-multicrate-project)\nimpl<T> ForeignTrait2<MyType<T>, T> for MyType2 { } // Ok\n```\n\nThis only differs from the previous `impl` in that the parameters `T` and\n`MyType<T>` for `ForeignTrait2` have been swapped. This example does *not*\nviolate the orphan rule; it is permitted.\n\nTo see why that last example was allowed, you need to understand the general\nrule. Unfortunately this rule is a bit tricky to state. Consider an `impl`:\n\n```ignore (only-for-syntax-highlight)\nimpl<P1, ..., Pm> ForeignTrait<T1, ..., Tn> for T0 { ... }\n```\n\nwhere `P1, ..., Pm` are the type parameters of the `impl` and `T0, ..., Tn`\nare types. One of the types `T0, ..., Tn` must be a local type (this is another\norphan rule, see the explanation for E0117). Let `i` be the smallest integer\nsuch that `Ti` is a local type. Then no type parameter can appear in any of the\n`Tj` for `j < i`.\n\nFor information on the design of the orphan rules, see [RFC 1023].\n\n[RFC 1023]: https://github.com/rust-lang/rfcs/blob/master/text/1023-rebalancing-coherence.md\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/re_rebalance_coherence/coherence-bigint-param.rs","byte_start":609,"byte_end":638,"line_start":20,"line_end":20,"column_start":1,"column_end":30,"is_primary":true,"text":[{"text":"impl<T> Remote1<BigInt> for T { }","highlight_start":1,"highlight_end":30}],"label":"type parameter `T` must be used as the type parameter for some local type","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"only traits defined in the current crate can be implemented for a type parameter","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct<T>`)\n  --> /checkout/src/test/ui/re_rebalance_coherence/coherence-bigint-param.rs:20:1\n   |\nLL | impl<T> Remote1<BigInt> for T { }\n   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type parameter `T` must be used as the type parameter for some local type\n   |\n   = note: only traits defined in the current crate can be implemented for a type parameter\n\n"}
[00:45:59] {"message":"aborting due to previous error","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to previous error\n\n"}
[00:45:59] {"message":"For more information about this error, try `rustc --explain E0210`.","code":null,"level":"","spans":[],"children":[],"rendered":"For more information about this error, try `rustc --explain E0210`.\n"}
[00:45:59] ------------------------------------------
[00:45:59] 
[00:45:59] 
[00:45:59] thread '[ui] ui/re_rebalance_coherence/coherence-bigint-param.rs' panicked at 'explicite:\n\n```\ntrait MyTrait {\n    fn get(&self) -> usize;\n}\n\nimpl<T> MyTrait for T {\n    fn get(&self) -> usize { 0 }\n}\n\nstruct Foo;\n\nfn main() {\n    let f = Foo;\n\n    f.get(); // the trait is implemented so we can use it\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/re_rebalance_coherence/coherence-cross-crate-conflict.rs","byte_start":703,"byte_end":720,"line_start":20,"line_end":20,"column_start":1,"column_end":18,"is_primary":true,"text":[{"text":"impl<A> Foo for A {","highlight_start":1,"highlight_end":18}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"conflicting implementation in crate `trait_impl_conflict`:\n- impl trait_impl_conflict::Foo for isize;","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0119]: conflicting implementations of trait `trait_impl_conflict::Foo` for type `isize`:\n  --> /checkout/src/test/ui/re_rebalance_coherence/coherence-cross-crate-conflict.rs:20:1\n   |\nLL | impl<A> Foo for A {\n   | ^^^^^^^^^^^^^^^^^\n   |\n   = note: conflicting implementation in crate `trait_impl_conflict`:\n           - impl trait_impl_conflict::Foo for isize;\n\n"}
[00:45:59] {"message":"type parameter `A` must be used as the type parameter for some local type (e.g., `MyStruct<A>`)","code":{"code":"E0210","explanation":"\nThis error indicates a violation of one of Rust's orphan rules for trait\nimplementations. The rule concerns the use of type parameters in an\nimplementation of a foreign trait (a trait defined in another crate), and\nstates that type parameters must be need to understand the general\nrule. Unfortunately this rule is a bit tricky to state. Consider an `impl`:\n\n```ignore (only-for-syntax-highlight)\nimpl<P1, ..., Pm> ForeignTrait<T1, ..., Tn> for T0 { ... }\n```\n\nwhere `P1, ..., Pm` are the type parameters of the `impl` and `T0, ..., Tn`\nare types. One of the types `T0, ..., Tn` must be a local type (this is another\norphan rule, see the explanation for E0117). Let `i` be the smallest integer\nsuch that `Ti` is a local type. Then no type parameter can appear in any of the\n`Tj` for `j < i`.\n\nFor information on the design of the orphan rules, see [RFC 1023].\n\n[RFC 1023]: https://github.com/rust-lang/rfcs/blob/master/text/1023-rebalancing-coherence.md\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/re_rebalance_coherence/coherence-cross-crate-conflict.rs","byte_start":703,"byte_end":720,"line_start":20,"line_end":20,"column_start":1,"column_end":18,"is_primary":true,"text":[{"text":"impl<A> Foo for A {","highlight_start":1,"highlight_end":18}],"label":"type parameter `A` must be used as the type parameter for some local type","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"only traits defined in the current crate can be implemented for a type parameter","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0210]: type parameter `A` must be used as the type parameter for some local type (e.g., `MyStruct<A>`)\n  --> /checkout/src/test/ui/re_rebalance_coherence/coherence-cross-crate-conflict.rs:20:1\n   |\nLL | impl<A> Foo for A {\n   | ^^^^^^^^^^^^^^^^^ type parameter `A` must be used as the type parameter for some local type\n   |\n   = note: only traits defined in the current crate can be implemented for a type parameter\n\n"}
[00:45:59] {"message":"aborting due to 2 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to 2 previous errors\n\n"}
[00:45:59] {"message":"Some errors occurred: E0119, E0210.","code":null,"level":"","spans":[],"children":[],"rendered":"Some errors occurred: E0119, E0210.\n"}
[00:45:59] {"message":"For more information about an error, try `rustc --explain E0119`.","code":null,"level":"","spans":[],"children":[],"rendered":"For more information about an error, try `rustc --explain E0119`.\n"}
[00:45:59] ------------------------------------------
[00:45:59] 
[00:45:59] 
[00:45:59] thread '[ui] ui/re_rebalance_coherence/coherence-cross-crate-conflict.rs' panicked at 'explicit panic', src/tools/compiletest/src/runtest.rs:3252:9
[00:45:59] 
[00:45:59] ---- [ui] ui/re_rebalance_coherence/coherence-lone-type-parameter.rs stdout ----
[00:45:59] 
[00:45:59] 
[00:45:59] - error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g. `MyStruct<T>`)
[00:45:59] + error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct<T>`)
[00:45:59] 2   --> $DIR/coherence-lone-type-parameter.rs:18:1
[00:45:59] 3    |
[00:45:59] 4 LL | impl<T> Remote for T { }
[00:45:59] 
[00:45:59] The actual stderr differed from the expected stderr.
[00:45:59] The actual stderr differed from the expected stderr.
[00:45:59] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/re_rebalance_coherence/coherence-lone-type-parameter/coherence-lone-type-parameter.stderr
[00:45:59] To update references, rerun the tests and pass the `--bless` flag
[00:45:59] To only update this specific test, also pass `--test-args re_rebalance_coherence/coherence-lone-type-parameter.rs`
[00:45:59] error: 1 errors occurred comparing output.
[00:45:59] status: exit code: 1
[00:45:59] status: exit code: 1
[00:45:59] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/re_rebalance_coherence/coherence-lone-type-parameter.rs" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/re_rebalance_coherence/coherence-lone-type-parameter/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/re_rebalance_coherence/coherence-lone-type-parameter/auxiliary" "-A" "unused"
[00:45:59] ------------------------------------------
[00:45:59] 
[00:45:59] ------------------------------------------
[00:45:59] stderr:
[00:45:59] stderr:
[00:45:59] ------------------------------------------
[00:45:59] {"message":"type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct<T>`)","code":{"code":"E0210","explanation":"\nThis error indicates a violation of one of Rust's orphan rules for trait\nimplementations. The rule concerns the use of type parameters in an\nimplementation of a foreign trait (a trait defined in another crate), and\nstates that type parameters must be \"covered\" by a local type. To understand\nwhat this means, it is perhaps easiest to consider a few examples.\n\nIf `ForeignTrait` is a trait defined in some external crate `foo`, then the\nfollowing trait `impl` is an error:\n\n```compile_fail,E0210\n# #[cfg(for_demonstration_only)]\nextern crate foo;\n# #[cfg(for_demonstration_only)]\nuse foo::ForeignTrait;\n# use std::panic::UnwindSafe as ForeignTrait;\n\nimpl<T> ForeignTrait for T { } // error\n# fn main() {}\n```\n\nTo work around this, it can be covered with a local type, `MyType`:\n\n```\n# use std::panic::UnwindSafe as ForeignTrait;\nstruct MyType<T>(T);\nimpl<T> ForeignTrait for MyType<T> { } // Ok\n```\n\nPlease note that a type alias is not sufficient.\n\nFor another example of an error, suppose there's another trait defined in `foo`\nnamed `ForeignTrait2` that takes two type parameters. Then this `impl` results\nin the same rule violation:\n\n```ignore (cannot-doctest-multicrate-project)\nstruct MyType2;\nimpl<T> ForeignTrait2<T, MyType<T>> for MyType2 { } // error\n```\n\nThe reason for this is that there are two appearances of type parameter `T` in\nthe `impl` header, both as parameters for `ForeignTrait2`. The first appearance\nis uncovered, and so runs afoul of the orphan rule.\n\nConsider one more example:\n\n```ignore (cannot-doctest-multicrate-project)\nimpl<T> ForeignTrait2<MyType<T>, T> for MyType2 { } // Ok\n```\n\nThis only differs from the previous `impl` in that the parameters `T` and\n`MyType<T>` for `ForeignTrait2` have been swapped. This example does *not*\nviolate the orphan rule; it is permitted.\n\nTo see why that last example was allowed, you need to understand the general\nrule. Unfortunately this rule is a bit tricky to state. Consider an `impl`:\n\n```ignore (only-for-syntax-highlight)\nimpl<P1, ..., Pm> ForeignTrait<T1, ..., Tn> for T0 { ... }\n```\n\nwhere `P1, ..., Pm` are the type parameters of the `impl` and `T0, ..., Tn`\nare types. One of the types `T0, ..., Tn` must be a local type (this is another\norphan rule, see the explanation for E0117). Let `i` be the smallest integer\nsuch that `Ti` is a local type. Then no type parameter can appear in any of the\n`Tj` for `j < i`.\n\nFor information on the design of the orphan rules, see [RFC 1023].\n\n[RFC 1023]: https://github.com/rust-lang/rfcs/blob/master/text/1023-rebalancing-coherence.md\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/re_rebalance_coherence/coherence-lone-type-parameter.rs","byte_start":588,"byte_end":608,"line_start":18,"line_end":18,"column_start":1,"column_end":21,"is_primary":true,"text":[{"text":"impl<T> Remote for T { }","highlight_start":1,"highlight_end":21}],"label":"type parameter `T` must be used as the type parameter for some local type","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"only traits defined in the current crate can be implemented for a type parameter","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct<T>`)\n  --> /checkout/src/test/ui/re_rebalance_coherence/coherence-lone-type-parameter.rs:18:1\n   |\nLL | impl<T> Remote for T { }\n   | ^^^^^-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" "--run-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "--rustc-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "--src-base" "/checkout/src/test/ui" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui" "--stage-id" "stage2-x86_64-unknown-linux-gnu" "--mode" "ui" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/usr/lib/llvm-5.0/bin/FileCheck" "--host-rustcflags" "-Crpath -O -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--target-rustcflags" "-Crpath -O -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--docck-python" "/usr/bin/python2.7" "--lldb-python" "/usr/bin/python2.7" "--gdb" "/usr/bin/gdb" "--quiet" "--llvm-version" "5.0.0\n" "--system-llvm" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--llvm-cxxflags" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"
[00:45:59] 
[00:45:59] 
[00:45:59] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[00:45:59] Build completed unsuccessfully in 0:03:47
[00:45:59] Build completed unsuccessfully in 0:03:47
[00:45:59] Makefile:58: recipe for target 'check' failed
[00:45:59] make: *** [check] Error 1
The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:00dcfdc5
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
Fri Dec 14 12:07:25 UTC 2018

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)

weiznich and others added some commits Nov 20, 2018

Add some tests
This copies and adjusts the existing coherence tests to ensure that
they continue to work using the new implementation.
Update src/doc/unstable-book/src/language-features/re-rebalance-coher…
…ence.md

Co-Authored-By: weiznich <Georg_semmler_05@web.de>

weiznich added some commits Nov 23, 2018

@weiznich weiznich force-pushed the weiznich:re_rebalance_coherence branch from be925ae to cf2f834 Dec 14, 2018

@weiznich

This comment has been minimized.

Contributor

weiznich commented Dec 17, 2018

@nikomatsakis Tests are fixed.

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