Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NLL regresses diagnostic for impl-trait/static-return-lifetime-infered.rs #53900

Merged
merged 6 commits into from
Sep 18, 2018

Conversation

davidtwco
Copy link
Member

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 2, 2018
@memoryruins memoryruins added the A-NLL Area: Non-lexical lifetimes (NLL) label Sep 2, 2018
@rust-highfive

This comment has been minimized.

Copy link
Contributor

@nikomatsakis nikomatsakis left a comment

Choose a reason for hiding this comment

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

Looks mostly good. Left a few nits.

@nikomatsakis
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Sep 6, 2018

📌 Commit cd19ce4ad0273ae7dcc0634499fc883609bf95df has been approved by nikomatsakis

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 6, 2018
@bors
Copy link
Contributor

bors commented Sep 7, 2018

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

@bors bors 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-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Sep 7, 2018
@davidtwco
Copy link
Member Author

Rebased.

if let Ok(snippet) = infcx.tcx.sess.source_map().span_to_snippet(span) {
let suggestable_fr_name = match fr_name {
RegionName::Named(name) => format!("{}", name),
RegionName::Synthesized(_) => "'_".to_string(),
Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm, I just noticed this; it is not always going to be correct, right?

e.g., in this example

fn foo(x: &[i32], y: &[i32]) -> impl Iterator<Item = i32> {
    y.iter().cloned()
}

but we should probably just file a follow-up issue.

Copy link
Member Author

@davidtwco davidtwco Sep 11, 2018

Choose a reason for hiding this comment

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

We currently get the following for that example:

error[E0621]: explicit lifetime required in the type of `y`
 --> test.rs:2:5
  |
1 | fn foo(x: &[i32], y: &[i32]) -> impl Iterator<Item = i32> {
  |                      ------ help: add explicit lifetime `'static` to the type of `y`: `&'static [i32]`
2 |     y.iter().cloned()
  |     ^^^^^^^^^^^^^^^^^ lifetime `'static` required

error: unsatisfied lifetime constraints
 --> test.rs:2:5
  |
1 | fn foo(x: &[i32], y: &[i32]) -> impl Iterator<Item = i32> {
  |           -          - let's call the lifetime of this reference `'1`
  |           |
  |           let's call the lifetime of this reference `'2`
2 |     y.iter().cloned()
  |     ^^^^^^^^ requires that `'1` must outlive `'2`

@nikomatsakis
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Sep 11, 2018

📌 Commit b1e7c635c877c048a1b13087d19eee7cf96ba7f4 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 Sep 11, 2018
@bors
Copy link
Contributor

bors commented Sep 12, 2018

⌛ Testing commit b1e7c635c877c048a1b13087d19eee7cf96ba7f4 with merge d0d3b809ab3cc7ddeca8caa7f79c56a6ff5b8385...

@bors
Copy link
Contributor

bors commented Sep 12, 2018

💔 Test failed - status-appveyor

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Sep 12, 2018
@rust-highfive
Copy link
Collaborator

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.
Checking out files: 100% (16613/16613), done.
travis_time:end:00666138:start=1536766485573499000,finish=1536766494741996000,duration=9168497000
$ cd rust-lang/rust
$ git checkout -qf d0d3b809ab3cc7ddeca8caa7f79c56a6ff5b8385
fatal: reference is not a tree: d0d3b809ab3cc7ddeca8caa7f79c56a6ff5b8385
The command "git checkout -qf d0d3b809ab3cc7ddeca8caa7f79c56a6ff5b8385" failed and exited with 128 during .
Your build has been stopped.

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 bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Sep 12, 2018
@bors
Copy link
Contributor

bors commented Sep 13, 2018

⌛ Testing commit b1e7c635c877c048a1b13087d19eee7cf96ba7f4 with merge ce7917c3f41561c8b662faf0b7598a837b825174...

@rust-highfive
Copy link
Collaborator

The job armhf-gnu 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:12:34]    Compiling rustc_typeck v0.0.0 (file:///checkout/src/librustc_typeck)
[00:12:34]    Compiling rustc_mir v0.0.0 (file:///checkout/src/librustc_mir)
[00:12:35] [RUSTC-TIMING] rustc_metadata_utils test:false 0.731
[00:12:35]    Compiling rustc_traits v0.0.0 (file:///checkout/src/librustc_traits)
[00:12:40] error[E0599]: no variant named `Anon` found for type `rustc::ty::TyKind<'_>` in the current scope
[00:12:40]    --> librustc_mir/borrow_check/nll/region_infer/error_reporting/mod.rs:492:22
[00:12:40]     |
[00:12:40] 492 |                 sty: ty::TyKind::Anon(did, substs),
[00:12:40] 
[00:12:48] error: aborting due to previous error
[00:12:48] 
[00:12:48] For more information about this error, try `rustc --explain E0599`.
[00:12:48] For more information about this error, try `rustc --explain E0599`.
[00:12:48] [RUSTC-TIMING] rustc_mir test:false 14.150
[00:12:48] error: Could not compile `rustc_mir`.
[00:12:48] 
[00:12:48] Caused by:
[00:12:48]   process didn't exit successfully: `/checkout/obj/build/bootstrap/debug/rustc --crate-name rustc_mir librustc_mir/lib.rs --color always --error-format json --crate-type dylib --emit=dep-info,link -C prefer-dynamic -C opt-level=2 -C metadata=9389ef21a7981207 -C extra-filename=-9389ef21a7981207 --out-dir /checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps --target x86_64-unknown-linux-gnu -L dependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps -L dependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/release/deps --extern arena=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libarena-93ff3b002b18b7ed.so --extern bitflags=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libbitflags-5a39798fe03e47f4.rlib --extern byteorder=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libbyteorder-8246be02936c9b1b.rlib --extern either=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libeither-0a515e87c8afea9e.rlib --extern graphviz=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libgraphviz-45ae4394366d07fd.so --extern log=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/liblog-c55d6c95192e4906.rlib --extern log_settings=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/liblog_settings-87ec950697a15ed0.rlib --extern polonius_engine=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libpolonius_engine-218f3033f29f5493.rlib --extern rustc=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc-09c0f3a89ad0d6b5.so --extern rustc_apfloat=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_apfloat-96aac12abd62414d.rlib --extern rustc_data_structures=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_data_structures-05301c67193a930e.so --extern rustc_errors=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_errors-f4ac364f854372fe.so --extern rustc_target=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_target-4a08b81d2b6640c1.so --extern serialize=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libserialize-8d84add221c0f710.so --extern serialize=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libserialize-8d84add221c0f710.rlib --extern smallvec=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libsmallvec-cb741677cd0e0351.rlib --extern syntax=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libsyntax-0651ffc5a9129db1.so --extern syntax_pos=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libsyntax_pos-47b99ffec2efbd05.so -L native=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/build/backtrace-sys-ee16f6821aef40e9/out -L native=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/build/miniz-sys-52504d5ed57fefc2/out` (exit code: 1)
[00:13:04] [RUSTC-TIMING] rustc_traits test:false 28.615
[00:13:23] [RUSTC-TIMING] rustc_incremental test:false 49.088
[00:13:57] [RUSTC-TIMING] rustc_typeck test:false 83.116
[00:13:57] error: build failed
[00:13:57] error: build failed
[00:13:57] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "build" "--target" "x86_64-unknown-linux-gnu" "-j" "4" "--release" "--locked" "--color" "always" "--features" " jemalloc" "--manifest-path" "/checkout/src/rustc/Cargo.toml" "--message-format" "json"
[00:13:57] expected success, got: exit code: 101
[00:13:57] thread 'main' panicked at 'cargo must succeed', bootstrap/compile.rs:1155:9
[00:13:57] travis_fold:end:stage0-rustc

[00:13:57] travis_time:end:stage0-rustc:start=1536799845921628135,finish=1536800395025321501,duration=549103693366

---
travis_time:end:0a23c238:start=1536800395853058268,finish=1536800395860147998,duration=7089730
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:00163726
$ 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 -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:06e528dc
travis_time:start:06e528dc
$ 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:01eb6ee6
$ 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)

@bors
Copy link
Contributor

bors commented Sep 13, 2018

💔 Test failed - status-travis

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Sep 13, 2018
@kennytm kennytm 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 Sep 13, 2018
@davidtwco
Copy link
Member Author

Rebased this.

@nikomatsakis
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Sep 17, 2018

📌 Commit 18c1374 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 Sep 17, 2018
@nikomatsakis
Copy link
Contributor

@davidtwco btw, as you have r+ now, you can feel free to do r=whomever after a rebase (where whomever is the person that gave the original r+)

@bors
Copy link
Contributor

bors commented Sep 18, 2018

⌛ Testing commit 18c1374 with merge 36c0ee9...

bors added a commit that referenced this pull request Sep 18, 2018
NLL regresses diagnostic for impl-trait/static-return-lifetime-infered.rs

Fixes #53771.

r? @nikomatsakis
cc @pnkfelix @estebank
@bors
Copy link
Contributor

bors commented Sep 18, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-NLL Area: Non-lexical lifetimes (NLL) 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.

8 participants