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

Turn implied_outlives_bounds into a query #51959

Merged
merged 5 commits into from
Jul 21, 2018

Conversation

tmandry
Copy link
Member

@tmandry tmandry commented Jul 1, 2018

Right now all this does is remove the error reporting in implied_outlives_bounds, which seems to work. Farming out full tests to Travis.

For #51649. That issue is deferred so not sure what's next.

r? @nikomatsakis

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 1, 2018
@tmandry tmandry added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 1, 2018
@nikomatsakis
Copy link
Contributor

@tmandry oh, nice! This PR was a bit unexpected, but happy to have it! =) I did do some tests locally which suggest that the error reporting code is basically dead code (I added a bug! call and it never fired), so that's good news for making this into a query. Let me take a look.

@tmandry
Copy link
Member Author

tmandry commented Jul 1, 2018

Hmm, I had triggered it on one test, see #51649 (comment).

This PR doesn’t actually make it a query, yet, btw :)

@tmandry tmandry force-pushed the make-implied-outlives-query branch 2 times, most recently from f692035 to 4bcb7ff Compare July 4, 2018 18:12
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-3.9 of your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.

[00:04:32] travis_fold:start:tidy
travis_time:start:tidy
tidy check
[00:04:33] tidy error: /checkout/src/librustc/traits/query/outlives_bounds.rs:54: TODO is deprecated; use FIXME
[00:04:34] some tidy checks failed
[00:04:34] 
[00:04:34] 
[00:04:34] 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:34] 
[00:04:34] 
[00:04:34] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test src/tools/tidy
[00:04:34] Build completed unsuccessfully in 0:01:35
[00:04:34] Build completed unsuccessfully in 0:01:35
[00:04:34] make: *** [tidy] Error 1
[00:04:34] Makefile:79: recipe for target 'tidy' failed

The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:198c3b67
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
---
travis_time:end:04893d79:start=1530728360512830631,finish=1530728360519839971,duration=7009340
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:0db215d0
$ head -30 ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers || true
head: cannot open ‘./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers’ for reading: No such file or directory
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:319be292
$ 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)

@tmandry tmandry force-pushed the make-implied-outlives-query branch from 4bcb7ff to 24b795a Compare July 4, 2018 18:34
@tmandry tmandry changed the title [WIP] Turn implied_outlives_bounds into a query Turn implied_outlives_bounds into a query Jul 4, 2018
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-3.9 of your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
[00:57:55] error: /checkout/src/test/compile-fail/issue-20831-debruijn.rs:1: unexpected error: '1:1: 1:1: mismatched types [E0308]'
[00:57:55] 
[00:57:55] error: 2 unexpected errors found, 0 expected errors not found
[00:57:55] status: exit code: 101
[00:57:55] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/compile-fail/issue-20831-debruijn.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/compile-fail/issue-20831-debruijn/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/compile-fail/issue-20831-debruijn/auxiliary" "-A" "unused"
[00:57:55]     Error {
[00:57:55]         line_num: 1,
[00:57:55]         kind: Some(
[00:57:55]             Error
---
[00:57:55] 
[00:57:55] thread 'main' panicked at 'Some tests failed', tools/compiletest/src/main.rs:498:22
[00:57:55] 
[00:57:55] 
[00:57:55] 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/compile-fail" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/compile-fail" "--stage-id" "stage2-x86_64-unknown-linux-gnu" "--mode" "compile-fail" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/usr/lib/llvm-3.9/bin/FileCheck" "--host-rustcflags" "-Crpath -O -Zunstable-options " "--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" "3.9.1\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:57:55] 
[00:57:55] 
[00:57:55] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[00:57:55] Build completed unsuccessfully in 0:14:36
[00:57:55] Build completed unsuccessfully in 0:14:36
[00:57:55] make: *** [check] Error 1
[00:57:55] Makefile:58: recipe for target 'check' failed
2410096 ./obj
2410064 ./obj/build
1815876 ./obj/build/x86_64-unknown-linux-gnu
730160 ./src
---
144248 ./obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu
144244 ./obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release
143864 ./obj/build/x86_64-unknown-linux-gnu/stage1-std
129816 ./obj/build/bootstrap/debug/incremental/bootstrap-146vjsckowoo9
129812 ./obj/build/bootstrap/debug/incremental/bootstrap-146vjsckowoo9/s-f2ljfyfeao-lexvjc-2cm8xlrxnbnm8
126680 ./obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps
107668 ./obj/build/x86_64-unkno6510885
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_fold:start:after_failure.4
travis_time:start:034330f0
$ head -30 ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers || true
head: cannot open ‘./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers’ for reading: No such file or directory
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:1ff943d0
$ 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)

@tmandry tmandry force-pushed the make-implied-outlives-query branch from 24b795a to 02cf3ac Compare July 5, 2018 22:40
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-3.9 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.
    100% |████████████████████████████████| 51kB 8.7MB/s 
Collecting botocore==1.10.51 (from awscli)
/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/e3/ba/f6c9220d87784a85f24a8f2425edccb2f330d15c304ea2373ed8206a03ca/botocore-1.10.51-py2.py3-none-any.whl (4.4MB)
    0% |                                | 10kB 42.7MB/s eta 0:00:01
    0% |▏                               | 20kB 22.9MB/s eta 0:00:01
    0% |▎                               | 30kB 24.8MB/s eta 0:00:01
    0% |▎                               | 40kB 23.2MB/s eta 0:00:01
---
[00:46:10] ....................................................................................................
[00:46:22] ....................................................................................................
[00:46:33] ....................................................................................................
[00:46:55] .....................................................................i..............................
[00:47:08] .............................................F......................................................
[00:47:23] ...i............................F..........................................................i........
[00:47:37] ...........................................................................test [run-pass] run-pass/issue-29227.rs has been running for over 60 seconds
[00:48:06] ....................................................................................................
[00:48:21] ....................................................................................................
[00:48:37] .....................................................................i..............................
[00:48:51] ....................................................................i...............................
---
[00:51:27] ---- [run-pass] run-pass/issue-37109.rs stdout ----
[00:51:27] 
[00:51:27] error: compilation failed!
[00:51:27] status: exit code: 101
[00:51:27] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/run-pass/issue-37109.rs" "--target=x86_64-unknown-linux-gnu" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass/issue-37109/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/run-pass/issue-37109/auxiliary"
[00:51:27] ------------------------------------------
[00:51:27] 
[00:51:27] ------------------------------------------
[00:51:27] stderr:
[00:51:27] stderr:
[00:51:27] ------------------------------------------
[00:51:27] thread 'main' panicked at 'region_obligations not empty: [
[00:51:27]         NodeId(
[00:51:27]             0
[00:51:27]         ),
[00:51:27]         ),
[00:51:27]         RegionObligation(sub_region=ReFree(DefId(0/0:7 ~ issue_37109[317d]::example[0]), BrNamed(crate0:DefIndex(1:12), 'a)), sup_type=&'a T)
[00:51:27]     )
[00:51:27] ]', librustc/infer/mod.rs:1031:9
[00:51:27] 
[00:51:27] error: internal compiler error: unexpected panic
[00:51:27] 
[00:51:27] 
[00:51:27] note: the compiler unexpectedly panicked. this is a bug.
[00:51:27] 
[00:51:27] note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
[00:51:27] note: rustc 1.29.0-dev running on x86_64-unknown-linux-gnu
[00:51:27] 
[00:51:27] 
[00:51:27] note: compiler flags: -Z unstable-options -C prefer-dynamic -C rpath
[00:51:27] 
[00:51:27] ------------------------------------------
[00:51:27] 
[00:51:27] thread '[run-pass] run-pass/issue-37109.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3140:9
[00:51:27] thread '[run-pass] run-pass/issue-37109.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3140:9
[00:51:27] note: Run with `RUST_BACKTRACE=1` for a backtrace.
[00:51:27] 
[00:51:27] ---- [run-pass] run-pass/issue-42552.rs stdout ----
[00:51:27] 
[00:51:27] error: compilation failed!
[00:51:27] status: exit code: 101
[00:51:27] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/run-pass/issue-42552.rs" "--target=x86_64-unknown-linux-gnu" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass/issue-42552/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/run-pass/issue-42552/auxiliary"
[00:51:27] ------------------------------------------
[00:51:27] 
[00:51:27] ------------------------------------------
[00:51:27] stderr:
[00:51:27] stderr:
[00:51:27] ------------------------------------------
[00:51:27] thread 'main' panicked at 'region_obligations not empty: [
[00:51:27]         NodeId(
[00:51:27]             0
[00:51:27]         ),
[00:51:27]         ),
[00:51:27]         RegionObligation(sub_region='_#10r, sup_type=i32)
[00:51:27]     )
[00:51:27] ]', librustc/infer/mod.rs:1031:9
[00:51:27] 
[00:51:27] error: internal compiler error: unexpected panic
[00:51:27] 
[00:51:27] 
[00:51:27] note: the compiler unexpectedly panicked. this is a bug.
[00:51:27] 
[00:51:27] note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
[00:51:27] note: rustc 1.29.0-dev running on x86_64-unknown-linux-gnu
[00:51:27] 
[00:51:27] 
[00:51:27] note: compiler flags: -Z unstable-options -C prefer-dynamic -C rpath
[00:51:27] 
[00:51:27] ------------------------------------------
[00:51:27] 
[00:51:27] thread '[run-pass] run-pass/issue-42552.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3140:9

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

bors commented Jul 7, 2018

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

@nikomatsakis
Copy link
Contributor

Ugh. Rebased, but travis is reporting a new failure. On the bright side, this turns out to fix some other problems we were encountering (#52078)

@kennytm kennytm added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 18, 2018
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-5.0 of your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
[00:40:58] ....................................................................................................
[00:41:01] ....................................................................................................
[00:41:04] ....................................................................................................
[00:41:06] .......................................i............................................................
[00:41:08] ...............................................F....................................................
[00:41:13] ....................................................................................................
[00:41:16] ....................................................................................................
[00:41:19] ....................................................................................................
[00:41:21] ....................................................................................................
---
[00:41:43] 
[00:41:43] + error[E0308]: mismatched types
[00:41:43] +   --> $DIR/issue-20831-debruijn.rs:38:5
[00:41:43] +    |
[00:41:43] + LL | /     fn subscribe(&mut self, t : Box<Subscriber<Input=<Self as Publisher>::Output> + 'a>) {
[00:41:43] + LL | |         // Not obvious, but there is an implicit lifetime here -------^
[00:41:43] + LL | |         //~^^ ERROR cannot infer
[00:41:43] + LL | |         //
[00:41:43] + ...  |
[00:41:43] + LL | |         self.sub = t;
[00:41:43] + LL | |     }
[00:41:43] +    | |_____^ lifetime mismatch
[00:41:43] +    = note: expected type `'a`
[00:41:43] +               found type ``
[00:41:43] +               found type ``
[00:41:43] + note: the anonymous lifetime #2 defined on the method body at 38:5...
[00:41:43] +   --> $DIR/issue-20831-debruijn.rs:38:5
[00:41:43] +    |
[00:41:43] + LL | /     fn subscribe(&mut self, t : Box<Subscriber<Input=<Self as Publisher>::Output> + 'a>) {
[00:41:43] + LL | |         // Not obvious, but there is an implicit lifetime here -------^
[00:41:43] + LL | |         //~^^ ERROR cannot infer
[00:41:43] + LL | |         //
[00:41:43] + ...  |
[00:41:43] + LL | |         self.sub = t;
[00:41:43] + LL | |     }
[00:41:43] +    | |_____^
[00:41:43] + note: ...does not necessarily outlive the lifetime 'a as defined on the impl at 36:6
[00:41:43] +   --> $DIR/issue-20831-debruijn.rs:36:6
[00:41:43] +    |
[00:41:43] + LL | impl<'a> Publisher<'a> for MyStruct<'a> {
[00:41:43] + 
[00:41:43] + error[E0308]: mismatched types
[00:41:43] +   --> $DIR/issue-20831-debruijn.rs:38:5
[00:41:43] +    |
[00:41:43] +    |
[00:41:43] + LL | /     fn subscribe(&mut self, t : Box<Subscriber<Input=<Self as Publisher>::Output> + 'a>) {
[00:41:43] + LL | |         // Not obvious, but there is an implicit lifetime here -------^
[00:41:43] + LL | |         //~^^ ERROR cannot infer
[00:41:43] + LL | |         //
[00:41:43] + ...  |
[00:41:43] + LL | |         self.sub = t;
[00:41:43] + LL | |     }
[00:41:43] +    | |_____^ lifetime mismatch
[00:41:43] +    = note: expected type `'a`
[00:41:43] +               found type ``
[00:41:43] +               found type ``
[00:41:43] + note: the lifetime 'a as defined on the impl at 36:6...
[00:41:43] +   --> $DIR/issue-20831-debruijn.rs:36:6
[00:41:43] +    |
[00:41:43] + LL | impl<'a> Publisher<'a> for MyStruct<'a> {
[00:41:43] +    |      ^^
[00:41:43] + note: ...does not necessarily outlive the anonymous lifetime #2 defined on the method body at 38:5
[00:41:43] +   --> $DIR/issue-20831-debruijn.rs:38:5
[00:41:43] +    |
[00:41:43] + LL | /     fn subscribe(&mut self, t : Box<Subscriber<Input=<Self as Publisher>::Output> + 'a>) {
[00:41:43] + LL | |         // Not obvious, but there is an implicit lifetime here -------^
[00:41:43] + LL | |         //~^^ ERROR cannot infer
[00:41:43] + LL | |         //
[00:41:43] + ...  |
[00:41:43] + LL | |         self.sub = t;
[00:41:43] + LL | |     }
L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/issue-20831-debruijn/auxiliary" "-A" "unused"
[00:41:43] ------------------------------------------
[00:41:43] 
[00:41:43] ------------------------------------------
[00:41:43] stderr:
[00:41:43] stderr:
[00:41:43] ------------------------------------------
[00:41:43] {"message":"mismatched types","code":{"code":"E0308","explanation":"\nThis error occurs when the compiler was unable to infer the concrete type of a\nvariable. It can occur for several cases, the most common of which is a\nmismatch in the expected type that the compiler inferred for a variable's\ninitializing expression, and the actual type explicitly assigned to the\nvariable.\n\nFor example:\n\n```compile_fail,E0308\nlet x: i32 = \"I am not a number!\";\n//     ~~~   ~~~~~~~~~~~~~~~~~~~~\n//      |             |\n//      |    initializing expression;\n//      |    compiler infers type `&str`\n//      |\n//    type `i32` assigned to variable `x`\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/issue-20831-debruijn.rs","byte_start":1159,"byte_end":1555,"line_start":38,"line_end":46,"column_start":5,"column_end":6,"is_primary":true,"text":[{"text":"    fn subscribe(&mut self, t : Box<Subscriber<Input=<Self as Publisher>::Output> + 'a>) {","highlight_start":5,"highlight_end":91},{"text":"        // Not obvious, but there is an implicit lifetime here -------^","highlight_start":1,"highlight_end":72},{"text":"        //~^^ ERROR cannot infer","highlight_start":1,"highlight_end":33},{"text":"        //","highlight_start":1,"highlight_end":11},{"text":"        // The fact that `Publisher` is using an implicit lifetime is","highlight_start":1,"highlight_end":70},{"text":"        // what was causing the debruijn accounting to be off, so","highlight_start":1,"highlight_end":66},{"text":"        // leave it that way!","highlight_start":1,"highlight_end":30},{"text":"        self.sub = t;","highlight_start":1,"highlight_end":22},{"text":"    }","highlight_start":1,"highlight_end":6}],"label":"lifetime mismatch","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"expected type `'a`\n   found type ``","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"the anonymous lifetime #2 defined on the method body at 38:5...","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/issue-20831-debruijn.rs","byte_start":1159,"byte_end":1555,"line_start":38,"line_end":46,"column_start":5,"column_end":6,"is_primary":true,"text":[{"text":"    fn subscribe(&mut self, t : Box<Subscriber<Input=<Self as Publisher>::Output> + 'a>) {","highlight_start":5,"highlight_end":91},{"text":"        // Not obvious, but there is an implicit lifetime here -------^","highlight_start":1,"highlight_end":72},{"text":"        //~^^ ERROR cannot infer","highlight_start":1,"highlight_end":33},{"text":"        //","highlight_start":1,"highlight_end":11},{"text":"        // The fact that `Publisher` is using an implicit lifetime is","highlight_start":1,"highlight_end":70},{"text":"        // what was causing the debruijn accounting to be off, so","highlight_start":1,"highlight_end":66},{"text":"        // leave it that way!","highlight_start":1,"highlight_end":30},{"text":"        self.sub = t;","highlight_start":1,"highlight_end":22},{"text":"    }","highlight_start":1,"highlight_end":6}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":null},{"message":"...does not necessarily outlive the lifetime 'a as defined on the impl at 36:6","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/issue-20831-debruijn.rs","byte_start":1095,"byte_end":1097,"line_start":36,"line_end":36,"column_start":6,"column_end":8,"is_primary":true,"text":[{"text":"impl<'a> Publisher<'a> for MyStruct<'a> {","highlight_start":6,"highlight_end":8}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":null}],"rendered":"error[E0308]: mismatched types\n  --> /checkout/src/test/ui/issue-20831-debruijn.rs:38:5\n   |\nLL | /     fn subscribe(&mut self, t : Box<Subscriber<Input=<Self as Publisher>::Output> + 'a>) {\nLL | |         // Not obvious, but there is an implicit lifetime here -------^\nLL | |         //~^^ ERROR cannot infer\nLL | |         //\n...  |\nLL | |         self.sub = t;\nLL | |     }\n   | |_____^ lifetime mismatch\n   |\n   = note: expected type `'a`\n              found type ``\nnote: the anonymous lifetime #2 defined on the method body at 38:5...\n  --> /checkout/src/test/ui/issue-20831-debruijn.rs:38:5\n   |\nLL | /     fn subscribe(&mut self, t : Box<Subscriber<Input=<Self as Publisher>::Output> + 'a>) {\nLL | |         // Not obvious, but there is an implicit lifetime here -------^\nLL | |         //~^^ ERROR cannot infer\nLL | |         //\n...  |\nLL | |         self.sub = t;\nLL | |     }\n   | |_____^\nnote: ...does not necessarily outlive the lifetime 'a as defined on the impl at 36:6\n  --> /checkout/src/test/ui/issue-20831-debruijn.rs:36:6\n   |\nLL | impl<'a> Publisher<'a> for MyStruct<'a> {\n   |      ^^\n\n"}
[00:41:43] {"message":"mismatched types","code":{"code":"E0308","explanation":"\nThis error occurs when the compiler was unable to infer the concrete type of a\nvariable. It can occur for several cases, the most common of which is a\nmismatch in the expected type that the compiler inferred for a variable's\ninitializing expression, and the actual type explicitly assigned to the\nvariable.\n\nFor example:\n\n```compile_fail,E0308\nlet x: i32 = \"I am not a number!\";\n//     ~~~   ~~~~~~~~~~~~~~~~~~~~\n//      |             |\n//      |    initializing expression;\n//      |    compiler infers type `&str`\n//      |\n//    type `i32` assigned to variable `x`\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/issue-20831-debruijn.rs","byte_start":1159,"byte_end":1555,"line_start":38,"line_end":46,"column_start":5,"column_end":6,"is_primary":true,"text":[{"text":"    fn subscribe(&mut self, t : Box<Subscriber<Input=<Self as Publisher>::Output> + 'a>) {","highlight_start":5,"highlight_end":91},{"text":"        // Not obvious, but there is an implicit lifetime here -------^","highlight_start":1,"highlight_end":72},{"text":"        //~^^ ERROR cannot infer","highlight_start":1,"highlight_end":33},{"text":"        //","highlight_start":1,"highlight_end":11},{"text":"        // The fact that `Publisher` is using an implicit lifetime is","highlight_start":1,"highlight_end":70},{"text":"        // what was causing the debruijn accounting to be off, so","highlight_start":1,"highlight_end":66},{"text":"        // leave it that way!","highlight_start":1,"highlight_end":30},{"text":"        self.sub = t;","highlight_start":1,"highlight_end":22},{"text":"    }","highlight_start":1,"highlight_end":6}],"label":"lifetime mismatch","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"expected type `'a`\n   found type ``","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"the lifetime 'a as defined on the impl at 36:6...","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/issue-20831-debruijn.rs","byte_start":1095,"byte_end":1097,"line_start":36,"line_end":36,"column_start":6,"column_end":8,"is_primary":true,"text":[{"text":"impl<'a> Publisher<'a> for MyStruct<'a> {","highlight_start":6,"highlight_end":8}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":null},{"message":"...does not necessarily outlive the anonymous lifetime #2 defined on the method body at 38:5","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/issue-20831-debruijn.rs","byte_start":1159,"byte_end":1555,"line_start":38,"line_end":46,"column_start":5,"column_end":6,"is_primary":true,"text":[{"text":"    fn subscribe(&mut self, t : Box<Subscriber<Input=<Self as Publisher>::Output> + 'a>) {","highlight_start":5,"highlight_end":91},{"text":"        // Not obvious, but there is an implicit lifetime here -------^","highlight_start":1,"highlight_end":72},{"text":"        //~^^ ERROR cannot infer","highlight_start":1,"highlight_end":33},{"text":"        //","highlight_start":1,"highlight_end":11},{"text":"        // The fact that `Publisher` is using an implicit lifetime is","highlight_start":1,"highlight_end":70},{"text":"        // what was causing the debruijn accounting to be off, so","highlight_start":1,"highlight_end":66},{"text":"        // leave it that way!","highlight_start":1,"highlight_end":30},{"text":"        self.sub = t;","highlight_start":1,"highlight_end":22},{"text":"    }","highlight_start":1,"highlight_end":6}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":null}],"rendered":"error[E0308]: mismatched types\n  --> /checkout/src/test/ui/issue-20831-debruijn.rs:38:5\n   |\nLL | /     fn subscribe(&mut self, t : Box<Subscriber<Input=<Self as Publisher>::Output> + 'a>) {\nLL | |         // Not obvious, but there is an implicit lifetime here -------^\nLL | |         //~^^ ERROR cannot infer\nLL | |         //\n...  |\nLL | |         self.sub = t;\nLL | |     }\n   | |_____^ lifetime mismatch\n   |\n   = note: expected type `'a`\n              found type ``\nnote: the lifetime 'a as defined on the impl at 36:6...\n  --> /checkout/src/test/ui/issue-20831-debruijn.rs:36:6\n   |\nLL | impl<'a> Publisher<'a> for MyStruct<'a> {\n   |      ^^\nnote: ...does not necessarily outlive the anonymous lifetime #2 defined on the method body at 38:5\n  --> /checkout/src/test/ui/issue-20831-debruijn.rs:38:5\n   |\nLL | /     fn subscribe(&mut self, t : Box<Subscriber<Input=<Self as Publisher>::Output> + 'a>) {\nLL | |         // Not obvious, but there is an implicit lifetime here -------^\nLL | |         //~^^ ERROR cannot infer\nLL | |         //\n...  |\nLL | |         self.sub = t;\nLL | |     }\n   | |_____^\n\n"}
[00:41:43] {"message":"cannot infer an appropriate lifetime for lifetime parameter `'a` due to conflicting requirements","code":{"code":"E0495","explanation":null},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/issue-20831-debruijn.rs","byte_start":1159,"byte_end":1555,"line_start":38,"line_end":46,"column_start":5,"column_end":6,"is_primary":true,"text":[{"text":"    fn subscribe(&mut self, t : Box<Subscriber<Input=<Self as Publisher>::Output> + 'a>) {","highlight_start":5,"highlight_end":91},{"text":"        // Not obvious, but there is an implicit lifetime here -------^","highlight_start":1,"highlight_end":72},{"text":"        //~^^ ERROR cannot infer","highlight_start":1,"highlight_end":33},{"text":"        //","highlight_start":1,"highlight_end":11},{"text":"        // The fact that `Publisher` is using an implicit lifetime is","highlight_start":1,"highlight_end":70},{"text":"        // what was causing the debruijn accounting to be off, so","highlight_start":1,"highlight_end":66},{"text":"        // leave it that way!","highlight_start":1,"highlight_end":30},{"text":"        self.sub = t;","highlight_start":1,"highlight_end":22},{"text":"    }","highlight_start":1,"highlight_end":6}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"first, the lifetime cannot outlive the anonymous lifetime #2 defined on the method body at 38:5...","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/issue-20831-debruijn.rs","byte_start":1159,"byte_end":1555,"line_start":38,"line_end":46,"column_start":5,"column_end":6,"is_primary":true,"text":[{"text":"    fn subscribe(&mut self, t : Box<Subscriber<Input=<Self as Publisher>::Output> + 'a>) {","highlight_start":5,"highlight_end":91},{"text":"        // Not obvious, but there is an implicit lifetime here -------^","highlight_start":1,"highlight_end":72},{"text":"        //~^^ ERROR cannot infer","highlight_start":1,"highlight_end":33},{"text":"        //","highlight_start":1,"highlight_end":11},{"text":"        // The fact that `Publisher` is using an implicit lifetime is","highlight_start":1,"highlight_end":70},{"text":"        // what was causing the debruijn accounting to be off, so","highlight_start":1,"highlight_end":66},{"text":"        // leave it that way!","highlight_start":1,"highlight_end":30},{"text":"        self.sub = t;","highlight_start":1,"highlight_end":22},{"text":"    }","highlight_start":1,"highlight_end":6}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":null},{"message":"...but the lifetime must also be valid for the lifetime 'a as defined on the impl at 36:6...","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/issue-20831-debruijn.rs","byte_start":1095,"byte_end":1097,"line_start":36,"line_end":36,"column_start":6,"column_end":8,"is_primary":true,"text":[{"text":"impl<'a> Publisher<'a> for MyStruct<'a> {","highlight_start":6,"highlight_end":8}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":null},{"message":"...so that the types are compatible:\nexpected Publisher<'_>\n   found Publisher<'_>","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'a` due to conflicting requirements\n  --> /checkout/src/test/ui/issue-20831-debruijn.rs:38:5\n   |\nLL | /     fn subscribe(&mut self, t : Box<Subscriber<Input=<Self as Publisher>::Output> + 'a>) {\nLL | |         // Not obvious, but there is an implicit lifetime here -------^\nLL | |         //~^^ ERROR cannot infer\nLL | |         //\n...  |\nLL | |         self.sub = t;\nLL | |     }\n   | |_____^\n   |\nnote: first, the lifetime cannot outlive the anonymous lifetime #2 defined on the method body at 38:5...\n  --> /checkout/src/test/ui/issue-20831-debruijn.rs:38:5\n   |\nLL | /     fn subscribe(&mut self, t : Box<Subscriber<Input=<Self as Publisher>::Output> + 'a>) {\nLL | |         // Not obvious, but there is an implicit lifetime here -------^\nLL | |         //~^^ ERROR cannot infer\nLL | |         //\n...  |\nLL | |         self.sub = t;\nLL | |     }\n   | |_____^\nnote: ...but the lifetime must also be valid for the lifetime 'a as defined on the impl at 36:6...\n  --> /checkout/src/test/ui/issue-20831-debruijn.rs:36:6\n   |\nLL | impl<'a> Publisher<'a> for MyStruct<'a> {\n   |      ^^\n   = note: ...so that the types are compatible:\n           expected Publisher<'_>\n              found Publisher<'_>\n\n"}
[00:41:43] thread 'main' panicked at 'Some tests failed', tools/compiletest/src/main.rs:498:22
[00:41:43] {"message":"aborting due to 3 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to 3 previous errors\n\n"}
[00:41:43] {"message":"Some errors occurred: E0308, E0495.","code":null,"level":"","spans":[],"children":[],"rendered":"Some errors occurred: E0308, E0495.\n"}
[00:41:43] {"message":"For more information about an error, try `rustc --explain E0308`.","code":null,"level":"","spans":[],"children":[],"rendered":"For more information about an error, try `rustc --explain E0308`.\n"}
[00:41:43] ------------------------------------------
[00:41:43] 
[00:41:43] thread '[ui] ui/issue-20831-debruijn.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3139:9
[00:41:43] note: Run with `RUST_BACKTRACE=1` for a backtrace.
---
[00:41:43] test result: FAILED. 2110 passed; 1 failed; 7 ignored; 0 measured; 0 filtered out
[00:41:43] 
[00:41:43] 
[00:41:43] 
[00:41:43] 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" "s

The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:028be3b1
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)

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 nikomatsakis force-pushed the make-implied-outlives-query branch from 27a03db to 86fa26b Compare July 19, 2018 04:19
@nikomatsakis
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Jul 20, 2018

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

These new errors actually seem a *tad* clearer than the old one, so
that's good, but now there are 3. Maybe call it a wash?
@nikomatsakis nikomatsakis force-pushed the make-implied-outlives-query branch from 86fa26b to 0d8f3b3 Compare July 21, 2018 12:57
@nikomatsakis
Copy link
Contributor

Rebased.

@nikomatsakis
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Jul 21, 2018

📌 Commit 0d8f3b3 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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jul 21, 2018
@bors
Copy link
Contributor

bors commented Jul 21, 2018

⌛ Testing commit 0d8f3b3 with merge d941658...

bors added a commit that referenced this pull request Jul 21, 2018
…sakis

Turn implied_outlives_bounds into a query

Right now all this does is remove the error reporting in `implied_outlives_bounds`, which seems to work. Farming out full tests to Travis.

For #51649. That issue is deferred so not sure what's next.

r? @nikomatsakis
@bors
Copy link
Contributor

bors commented Jul 21, 2018

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

@bors bors merged commit 0d8f3b3 into rust-lang:master Jul 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants