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

Generalized article_and_description #67742

Merged
merged 9 commits into from
Feb 27, 2020
Merged

Conversation

mark-i-m
Copy link
Member

r? @matthewjasper

The logic of finding the right word and article to print seems to be repeated elsewhere... this is an experimental method to unify this logic...

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Dec 31, 2019
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-7 of your PR failed (pretty log, 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.
2019-12-31T01:49:34.0222074Z ##[command]git remote add origin https://github.com/rust-lang/rust
2019-12-31T01:49:34.0237467Z ##[command]git config gc.auto 0
2019-12-31T01:49:34.0241446Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2019-12-31T01:49:34.0245984Z ##[command]git config --get-all http.proxy
2019-12-31T01:49:34.0253526Z ##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/67742/merge:refs/remotes/pull/67742/merge
---
2019-12-31T01:55:46.4358051Z    Compiling serde_json v1.0.40
2019-12-31T01:55:48.0151421Z    Compiling tidy v0.1.0 (/checkout/src/tools/tidy)
2019-12-31T01:55:58.3539759Z     Finished release [optimized] target(s) in 1m 22s
2019-12-31T01:55:58.3628783Z tidy check
2019-12-31T01:55:59.1706169Z tidy error: /checkout/src/librustc/ty/context.rs:1521: TODO is deprecated; use FIXME
2019-12-31T01:56:00.8199934Z Found 486 error codes
2019-12-31T01:56:00.8200170Z Found 0 error codes with no tests
2019-12-31T01:56:00.8200521Z Done!
2019-12-31T01:56:00.8202390Z some tidy checks failed
2019-12-31T01:56:00.8202390Z some tidy checks failed
2019-12-31T01:56:00.8205326Z 
2019-12-31T01:56:00.8205770Z 
2019-12-31T01:56:00.8206838Z command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/tidy" "/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"
2019-12-31T01:56:00.8206994Z 
2019-12-31T01:56:00.8207016Z 
2019-12-31T01:56:00.8216600Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test src/tools/tidy
2019-12-31T01:56:00.8217014Z Build completed unsuccessfully in 0:01:32
2019-12-31T01:56:00.8217014Z Build completed unsuccessfully in 0:01:32
2019-12-31T01:56:00.8264561Z == clock drift check ==
2019-12-31T01:56:00.8275158Z   local time: Tue Dec 31 01:56:00 UTC 2019
2019-12-31T01:56:01.1150963Z   network time: Tue, 31 Dec 2019 01:56:01 GMT
2019-12-31T01:56:01.1151157Z == end clock drift check ==
2019-12-31T01:56:02.6078063Z 
2019-12-31T01:56:02.6168807Z ##[error]Bash exited with code '1'.
2019-12-31T01:56:02.6211911Z ##[section]Starting: Checkout
2019-12-31T01:56:02.6213456Z ==============================================================================
2019-12-31T01:56:02.6213526Z Task         : Get sources
2019-12-31T01:56:02.6213570Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.

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)

src/librustc/ty/context.rs Outdated Show resolved Hide resolved
@bors
Copy link
Contributor

bors commented Jan 18, 2020

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

@mark-i-m
Copy link
Member Author

@matthewjasper Thanks! I have pushed my progress so far. Please let me know what you think.

@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-7 of your PR failed (pretty log, 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.
2020-01-26T01:32:20.6219419Z ========================== Starting Command Output ===========================
2020-01-26T01:32:20.6220740Z [command]/bin/bash --noprofile --norc /home/vsts/work/_temp/c46c7564-5e8c-43b0-831b-2527b378a1cd.sh
2020-01-26T01:32:20.6220769Z 
2020-01-26T01:32:20.6222892Z ##[section]Finishing: Disable git automatic line ending conversion
2020-01-26T01:32:20.6227942Z ##[section]Starting: Checkout rust-lang/rust@refs/pull/67742/merge to s
2020-01-26T01:32:20.6229699Z Task         : Get sources
2020-01-26T01:32:20.6229725Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2020-01-26T01:32:20.6229751Z Version      : 1.0.0
2020-01-26T01:32:20.6229783Z Author       : Microsoft
---
2020-01-26T01:32:21.6023826Z ##[command]git remote add origin https://github.com/rust-lang/rust
2020-01-26T01:32:21.6034869Z ##[command]git config gc.auto 0
2020-01-26T01:32:21.6037269Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2020-01-26T01:32:21.6039097Z ##[command]git config --get-all http.proxy
2020-01-26T01:32:21.6044039Z ##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/67742/merge:refs/remotes/pull/67742/merge
---
2020-01-26T01:37:22.6085342Z    Compiling serde_json v1.0.40
2020-01-26T01:37:23.7806323Z    Compiling tidy v0.1.0 (/checkout/src/tools/tidy)
2020-01-26T01:37:30.9327117Z     Finished release [optimized] target(s) in 59.47s
2020-01-26T01:37:30.9408897Z tidy check
2020-01-26T01:37:31.2488721Z tidy error: /checkout/src/librustc_typeck/collect.rs: too many lines (3004) (add `// ignore-tidy-filelength` to the file to suppress this error)
2020-01-26T01:37:33.0423478Z Found 487 error codes
2020-01-26T01:37:33.0423616Z Found 0 error codes with no tests
2020-01-26T01:37:33.0423651Z Done!
2020-01-26T01:37:33.0428624Z some tidy checks failed
2020-01-26T01:37:33.0428624Z some tidy checks failed
2020-01-26T01:37:33.0430672Z 
2020-01-26T01:37:33.0432629Z 
2020-01-26T01:37:33.0435794Z command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/tidy" "/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"
2020-01-26T01:37:33.0442443Z 
2020-01-26T01:37:33.0442617Z 
2020-01-26T01:37:33.0446891Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test src/tools/tidy
2020-01-26T01:37:33.0447272Z Build completed unsuccessfully in 0:01:07
2020-01-26T01:37:33.0447272Z Build completed unsuccessfully in 0:01:07
2020-01-26T01:37:33.0487802Z == clock drift check ==
2020-01-26T01:37:33.0497728Z   local time: Sun Jan 26 01:37:33 UTC 2020
2020-01-26T01:37:33.3136764Z   network time: Sun, 26 Jan 2020 01:37:33 GMT
2020-01-26T01:37:33.3136827Z == end clock drift check ==
2020-01-26T01:37:34.2513802Z 
2020-01-26T01:37:34.2602713Z ##[error]Bash exited with code '1'.
2020-01-26T01:37:34.2612409Z ##[section]Finishing: Run build
2020-01-26T01:37:34.2626651Z ##[section]Starting: Checkout rust-lang/rust@refs/pull/67742/merge to s
2020-01-26T01:37:34.2628218Z Task         : Get sources
2020-01-26T01:37:34.2628255Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2020-01-26T01:37:34.2628290Z Version      : 1.0.0
2020-01-26T01:37:34.2628342Z Author       : Microsoft
2020-01-26T01:37:34.2628342Z Author       : Microsoft
2020-01-26T01:37:34.2628378Z Help         : [More Information](https://go.microsoft.com/fwlink/?LinkId=798199)
2020-01-26T01:37:34.2628428Z ==============================================================================
2020-01-26T01:37:34.5713209Z Cleaning any cached credential from repository: rust-lang/rust (GitHub)
2020-01-26T01:37:34.5741453Z ##[section]Finishing: Checkout rust-lang/rust@refs/pull/67742/merge to s
2020-01-26T01:37:34.5833102Z Cleaning up task key
2020-01-26T01:37:34.5833791Z Start cleaning up orphan processes.
2020-01-26T01:37:34.6067273Z Terminate orphan process: pid (4625) (python)
2020-01-26T01:37:34.6085260Z ##[section]Finishing: Finalize Job

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)

src/librustc_metadata/rmeta/mod.rs Outdated Show resolved Hide resolved
src/librustc/ty/context.rs Show resolved Hide resolved
src/librustc_typeck/collect.rs Outdated Show resolved Hide resolved
@Dylan-DPC-zz Dylan-DPC-zz 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 Feb 6, 2020
@mark-i-m
Copy link
Member Author

mark-i-m commented Feb 8, 2020

@matthewjasper What should I do about src/librustc_typeck/collect.rs which exceeds tidy's maximum number of lines (3004 lines)?

EDIT: actually, that file already appears to be // ignore-tidy-filelength...

@matthewjasper
Copy link
Contributor

Wait for #67681
Pick one of the providers and move it to a submodule. Maybe codegen_fn_attrs?

@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-7 of your PR failed (pretty log, 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.
2020-02-08T22:34:30.5713044Z ========================== Starting Command Output ===========================
2020-02-08T22:34:30.5715762Z [command]/bin/bash --noprofile --norc /home/vsts/work/_temp/2a1de31a-ed1b-4181-82df-2adfc0ff4379.sh
2020-02-08T22:34:30.5716100Z 
2020-02-08T22:34:30.5720426Z ##[section]Finishing: Disable git automatic line ending conversion
2020-02-08T22:34:30.5728103Z ##[section]Starting: Checkout rust-lang/rust@refs/pull/67742/merge to s
2020-02-08T22:34:30.5730254Z Task         : Get sources
2020-02-08T22:34:30.5730291Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2020-02-08T22:34:30.5730327Z Version      : 1.0.0
2020-02-08T22:34:30.5730419Z Author       : Microsoft
---
2020-02-08T22:34:31.5725596Z ##[command]git remote add origin https://github.com/rust-lang/rust
2020-02-08T22:34:31.5738213Z ##[command]git config gc.auto 0
2020-02-08T22:34:31.5741570Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2020-02-08T22:34:31.5745889Z ##[command]git config --get-all http.proxy
2020-02-08T22:34:31.5753704Z ##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/67742/merge:refs/remotes/pull/67742/merge
---
2020-02-08T23:34:39.9680434Z .................................................................................................... 1700/9611
2020-02-08T23:34:45.2622626Z .................................................................................................... 1800/9611
2020-02-08T23:34:57.6278076Z ...............................i.................................................................... 1900/9611
2020-02-08T23:35:05.5236044Z .................................................................................................... 2000/9611
2020-02-08T23:35:20.0693194Z .....................iiiii.......................................................................... 2100/9611
2020-02-08T23:35:30.2954097Z .................................................................................................... 2300/9611
2020-02-08T23:35:32.9116959Z .................................................................................................... 2400/9611
2020-02-08T23:35:37.7645434Z .................................................................................................... 2500/9611
2020-02-08T23:35:59.2300437Z .................................................................................................... 2600/9611
---
2020-02-08T23:38:39.1731485Z .........................................................................i...............i.......... 4900/9611
2020-02-08T23:38:46.9248847Z .................................................................................................... 5000/9611
2020-02-08T23:38:55.4299396Z .................................................................................................... 5100/9611
2020-02-08T23:39:00.4400292Z ................i................................................................................... 5200/9611
2020-02-08T23:39:11.8198383Z ..........................................................................................ii.ii..... 5300/9611
2020-02-08T23:39:16.1997403Z ...i...i............................................................................................ 5400/9611
2020-02-08T23:39:26.3920687Z .................................................................................................... 5600/9611
2020-02-08T23:39:37.0954925Z ..............................................................................i..................... 5700/9611
2020-02-08T23:39:44.8385912Z .................................................................................................... 5800/9611
2020-02-08T23:39:51.2569621Z .................................................................................................... 5900/9611
2020-02-08T23:39:51.2569621Z .................................................................................................... 5900/9611
2020-02-08T23:40:01.5129209Z .....................................................................ii...i..ii...........i......... 6000/9611
2020-02-08T23:40:23.5128298Z .................................................................................................... 6200/9611
2020-02-08T23:40:31.4643313Z ...........................................................F........................................ 6300/9611
2020-02-08T23:40:39.8749897Z .................................................................................................i.. 6400/9611
2020-02-08T23:40:54.9236658Z ii.................................................................................................. 6500/9611
---
2020-02-08T23:43:02.7265442Z .................................................................................................... 7600/9611
2020-02-08T23:43:07.9084599Z .................................................................................................... 7700/9611
2020-02-08T23:43:13.3160953Z .................................................................................................... 7800/9611
2020-02-08T23:43:23.0067690Z .................................................................................................... 7900/9611
2020-02-08T23:43:31.9105337Z .......................................................iiiiiii.i.................................... 8000/9611
2020-02-08T23:43:47.0504966Z ..i................................................................................................. 8200/9611
2020-02-08T23:43:52.6600352Z .................................................................................................... 8300/9611
2020-02-08T23:44:08.4726262Z .................................................................................................... 8400/9611
2020-02-08T23:44:17.2421572Z .................................................................................................... 8500/9611
---
2020-02-08T23:46:20.4663835Z - error[E0521]: borrowed data escapes outside of function
2020-02-08T23:46:20.4663895Z + error[E0521]: borrowed data escapes outside of method
2020-02-08T23:46:20.4664181Z 97   --> $DIR/outlives-suggestion-simple.rs:73:9
2020-02-08T23:46:20.4664235Z 98    |
2020-02-08T23:46:20.4664482Z 99 LL |     fn get_bar(&self) -> Bar2 {
2020-02-08T23:46:20.4664771Z 100    |                -----
2020-02-08T23:46:20.4664825Z 101    |                |
2020-02-08T23:46:20.4665113Z -    |                `self` declared here, outside of the function body
2020-02-08T23:46:20.4665450Z -    |                `self` is a reference that is only valid in the function body
2020-02-08T23:46:20.4665450Z -    |                `self` is a reference that is only valid in the function body
2020-02-08T23:46:20.4665514Z +    |                `self` declared here, outside of the method body
2020-02-08T23:46:20.4665573Z +    |                `self` is a reference that is only valid in the method body
2020-02-08T23:46:20.4665654Z 104 LL |         Bar2::new(&self)
2020-02-08T23:46:20.4665936Z -    |         ^^^^^^^^^^^^^^^^ `self` escapes the function body here
2020-02-08T23:46:20.4665997Z +    |         ^^^^^^^^^^^^^^^^ `self` escapes the method body here
2020-02-08T23:46:20.4666118Z 107 error: aborting due to 9 previous errors
2020-02-08T23:46:20.4666165Z 108 
2020-02-08T23:46:20.4666195Z 
2020-02-08T23:46:20.4666224Z 
2020-02-08T23:46:20.4666224Z 
2020-02-08T23:46:20.4666295Z The actual stderr differed from the expected stderr.
2020-02-08T23:46:20.4666666Z Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/nll/outlives-suggestion-simple/outlives-suggestion-simple.stderr
2020-02-08T23:46:20.4667269Z To update references, rerun the tests and pass the `--bless` flag
2020-02-08T23:46:20.4667609Z To only update this specific test, also pass `--test-args nll/outlives-suggestion-simple.rs`
2020-02-08T23:46:20.4667700Z error: 1 errors occurred comparing output.
2020-02-08T23:46:20.4667910Z status: exit code: 1
2020-02-08T23:46:20.4667910Z status: exit code: 1
2020-02-08T23:46:20.4668892Z command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/nll/outlives-suggestion-simple.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/nll/outlives-suggestion-simple" "-Crpath" "-O" "-Cdebuginfo=0" "-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/nll/outlives-suggestion-simple/auxiliary" "-A" "unused"
2020-02-08T23:46:20.4669292Z ------------------------------------------
2020-02-08T23:46:20.4669331Z 
2020-02-08T23:46:20.4669604Z ------------------------------------------
2020-02-08T23:46:20.4669656Z stderr:
---
2020-02-08T23:46:20.4670579Z LL | fn foo1<'a, 'b>(x: &'a usize) -> &'b usize {
2020-02-08T23:46:20.4670858Z    |         --  -- lifetime `'b` defined here
2020-02-08T23:46:20.4670911Z    |         |
2020-02-08T23:46:20.4671151Z    |         lifetime `'a` defined here
2020-02-08T23:46:20.4671230Z LL |     x //~ERROR lifetime may not live long enough
2020-02-08T23:46:20.4671512Z    |     ^ returning this value requires that `'a` must outlive `'b`
2020-02-08T23:46:20.4671858Z    = help: consider adding the following bound: `'a: 'b`
2020-02-08T23:46:20.4671896Z 
2020-02-08T23:46:20.4671943Z error: lifetime may not live long enough
2020-02-08T23:46:20.4672219Z   --> /checkout/src/test/ui/nll/outlives-suggestion-simple.rs:10:5
2020-02-08T23:46:20.4672219Z   --> /checkout/src/test/ui/nll/outlives-suggestion-simple.rs:10:5
2020-02-08T23:46:20.4672293Z    |
2020-02-08T23:46:20.4672556Z LL | fn foo2<'a>(x: &'a usize) -> &'static usize {
2020-02-08T23:46:20.4672882Z LL |     x //~ERROR lifetime may not live long enough
2020-02-08T23:46:20.4672882Z LL |     x //~ERROR lifetime may not live long enough
2020-02-08T23:46:20.4673164Z    |     ^ returning this value requires that `'a` must outlive `'static`
2020-02-08T23:46:20.4673488Z    = help: consider replacing `'a` with `'static`
2020-02-08T23:46:20.4673526Z 
2020-02-08T23:46:20.4673572Z error: lifetime may not live long enough
2020-02-08T23:46:20.4673847Z   --> /checkout/src/test/ui/nll/outlives-suggestion-simple.rs:14:5
2020-02-08T23:46:20.4673847Z   --> /checkout/src/test/ui/nll/outlives-suggestion-simple.rs:14:5
2020-02-08T23:46:20.4673931Z    |
2020-02-08T23:46:20.4674213Z LL | fn foo3<'a, 'b>(x: &'a usize, y: &'b usize) -> (&'b usize, &'a usize) {
2020-02-08T23:46:20.4674541Z    |         |
2020-02-08T23:46:20.4674783Z    |         lifetime `'a` defined here
2020-02-08T23:46:20.4674783Z    |         lifetime `'a` defined here
2020-02-08T23:46:20.4674841Z LL |     (x, y) //~ERROR lifetime may not live long enough
2020-02-08T23:46:20.4675201Z    |     ^^^^^^ function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a`
2020-02-08T23:46:20.4675533Z    = help: consider adding the following bound: `'a: 'b`
2020-02-08T23:46:20.4675592Z 
2020-02-08T23:46:20.4675639Z error: lifetime may not live long enough
2020-02-08T23:46:20.4675914Z   --> /checkout/src/test/ui/nll/outlives-suggestion-simple.rs:14:5
2020-02-08T23:46:20.4675914Z   --> /checkout/src/test/ui/nll/outlives-suggestion-simple.rs:14:5
2020-02-08T23:46:20.4676126Z    |
2020-02-08T23:46:20.4676428Z LL | fn foo3<'a, 'b>(x: &'a usize, y: &'b usize) -> (&'b usize, &'a usize) {
2020-02-08T23:46:20.4676900Z    |         |
2020-02-08T23:46:20.4677172Z    |         lifetime `'a` defined here
2020-02-08T23:46:20.4677172Z    |         lifetime `'a` defined here
2020-02-08T23:46:20.4677230Z LL |     (x, y) //~ERROR lifetime may not live long enough
2020-02-08T23:46:20.4677562Z    |     ^^^^^^ function was supposed to return data with lifetime `'a` but it is returning data with lifetime `'b`
2020-02-08T23:46:20.4678043Z    = help: consider adding the following bound: `'b: 'a`
2020-02-08T23:46:20.4678083Z 
2020-02-08T23:46:20.4678350Z help: `'a` and `'b` must be the same: replace one with the other
2020-02-08T23:46:20.4678421Z 
2020-02-08T23:46:20.4678421Z 
2020-02-08T23:46:20.4678468Z error: lifetime may not live long enough
2020-02-08T23:46:20.4678748Z   --> /checkout/src/test/ui/nll/outlives-suggestion-simple.rs:22:5
2020-02-08T23:46:20.4678823Z    |
2020-02-08T23:46:20.4679093Z LL | fn foo4<'a, 'b, 'c>(x: &'a usize) -> (&'b usize, &'c usize) {
2020-02-08T23:46:20.4679431Z    |         |
2020-02-08T23:46:20.4679683Z    |         lifetime `'a` defined here
2020-02-08T23:46:20.4679733Z ...
2020-02-08T23:46:20.4679733Z ...
2020-02-08T23:46:20.4679784Z LL |     (x, x) //~ERROR lifetime may not live long enough
2020-02-08T23:46:20.4680092Z    |     ^^^^^^ returning this value requires that `'a` must outlive `'b`
2020-02-08T23:46:20.4680414Z    = help: consider adding the following bound: `'a: 'b`
2020-02-08T23:46:20.4680478Z 
2020-02-08T23:46:20.4680525Z error: lifetime may not live long enough
2020-02-08T23:46:20.4680803Z   --> /checkout/src/test/ui/nll/outlives-suggestion-simple.rs:31:9
2020-02-08T23:46:20.4680803Z   --> /checkout/src/test/ui/nll/outlives-suggestion-simple.rs:31:9
2020-02-08T23:46:20.4680856Z    |
2020-02-08T23:46:20.4681126Z LL |     pub fn foo<'a>(x: &'a usize) -> Self {
2020-02-08T23:46:20.4681383Z    |                -- lifetime `'a` defined here
2020-02-08T23:46:20.4681443Z LL |         Foo { x } //~ERROR lifetime may not live long enough
2020-02-08T23:46:20.4681764Z    |         ^^^^^^^^^ returning this value requires that `'a` must outlive `'static`
2020-02-08T23:46:20.4682081Z    = help: consider replacing `'a` with `'static`
2020-02-08T23:46:20.4682138Z 
2020-02-08T23:46:20.4682186Z error: lifetime may not live long enough
2020-02-08T23:46:20.4682463Z   --> /checkout/src/test/ui/nll/outlives-suggestion-simple.rs:41:9
2020-02-08T23:46:20.4682463Z   --> /checkout/src/test/ui/nll/outlives-suggestion-simple.rs:41:9
2020-02-08T23:46:20.4682515Z    |
2020-02-08T23:46:20.4682770Z LL | impl<'a> Bar<'a> {
2020-02-08T23:46:20.4683016Z    |      -- lifetime `'a` defined here
2020-02-08T23:46:20.4683267Z LL |     pub fn get<'b>(&self) -> &'b usize {
2020-02-08T23:46:20.4683546Z    |                -- lifetime `'b` defined here
2020-02-08T23:46:20.4683606Z LL |         self.x //~ERROR lifetime may not live long enough
2020-02-08T23:46:20.4683891Z    |         ^^^^^^ returning this value requires that `'a` must outlive `'b`
2020-02-08T23:46:20.4684226Z    = help: consider adding the following bound: `'a: 'b`
2020-02-08T23:46:20.4684265Z 
2020-02-08T23:46:20.4684320Z error: lifetime may not live long enough
2020-02-08T23:46:20.4684620Z   --> /checkout/src/test/ui/nll/outlives-suggestion-simple.rs:52:9
2020-02-08T23:46:20.4684620Z   --> /checkout/src/test/ui/nll/outlives-suggestion-simple.rs:52:9
2020-02-08T23:46:20.4684674Z    |
2020-02-08T23:46:20.4684893Z LL | impl<'a> Baz<'a> {
2020-02-08T23:46:20.4685156Z    |      -- lifetime `'a` defined here
2020-02-08T23:46:20.4685408Z LL |     fn get<'b>(&'b self) -> &'a i32 {
2020-02-08T23:46:20.4685667Z    |            -- lifetime `'b` defined here
2020-02-08T23:46:20.4685747Z LL |         self.x //~ERROR lifetime may not live long enough
2020-02-08T23:46:20.4686104Z    |         ^^^^^^ returning this value requires that `'b` must outlive `'a`
2020-02-08T23:46:20.4686439Z    = help: consider adding the following bound: `'b: 'a`
2020-02-08T23:46:20.4686478Z 
2020-02-08T23:46:20.4686527Z error[E0521]: borrowed data escapes outside of method
2020-02-08T23:46:20.4686803Z   --> /checkout/src/test/ui/nll/outlives-suggestion-simple.rs:73:9
2020-02-08T23:46:20.4686803Z   --> /checkout/src/test/ui/nll/outlives-suggestion-simple.rs:73:9
2020-02-08T23:46:20.4686878Z    |
2020-02-08T23:46:20.4687282Z LL |     fn get_bar(&self) -> Bar2 {
2020-02-08T23:46:20.4687586Z    |                |
2020-02-08T23:46:20.4687586Z    |                |
2020-02-08T23:46:20.4687640Z    |                `self` declared here, outside of the method body
2020-02-08T23:46:20.4687698Z    |                `self` is a reference that is only valid in the method body
2020-02-08T23:46:20.4687864Z LL |         Bar2::new(&self) //~ERROR borrowed data escapes outside of function
2020-02-08T23:46:20.4687931Z    |         ^^^^^^^^^^^^^^^^ `self` escapes the method body here
2020-02-08T23:46:20.4706165Z error: aborting due to 9 previous errors
2020-02-08T23:46:20.4706201Z 
2020-02-08T23:46:20.4706230Z 
2020-02-08T23:46:20.4706853Z ------------------------------------------
---
2020-02-08T23:46:20.4726636Z thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:348:22
2020-02-08T23:46:20.4727695Z note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
2020-02-08T23:46:20.4728922Z 
2020-02-08T23:46:20.4729090Z 
2020-02-08T23:46:20.4735069Z 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-7/bin/FileCheck" "--host-rustcflags" "-Crpath -O -Cdebuginfo=0 -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--target-rustcflags" "-Crpath -O -Cdebuginfo=0 -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" "7.0.0\n" "--system-llvm" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"
2020-02-08T23:46:20.4735419Z 
2020-02-08T23:46:20.4735458Z 
2020-02-08T23:46:20.4749621Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
2020-02-08T23:46:20.4750445Z Build completed unsuccessfully in 1:05:25
2020-02-08T23:46:20.4750445Z Build completed unsuccessfully in 1:05:25
2020-02-08T23:46:20.4823821Z == clock drift check ==
2020-02-08T23:46:20.4849946Z   local time: Sat Feb  8 23:46:20 UTC 2020
2020-02-08T23:46:21.0386886Z   network time: Sat, 08 Feb 2020 23:46:21 GMT
2020-02-08T23:46:21.0387351Z == end clock drift check ==
2020-02-08T23:46:21.4520149Z 
2020-02-08T23:46:21.4620322Z ##[error]Bash exited with code '1'.
2020-02-08T23:46:21.4634279Z ##[section]Finishing: Run build
2020-02-08T23:46:21.4654060Z ##[section]Starting: Checkout rust-lang/rust@refs/pull/67742/merge to s
2020-02-08T23:46:21.4655853Z Task         : Get sources
2020-02-08T23:46:21.4655913Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2020-02-08T23:46:21.4655957Z Version      : 1.0.0
2020-02-08T23:46:21.4655995Z Author       : Microsoft
2020-02-08T23:46:21.4655995Z Author       : Microsoft
2020-02-08T23:46:21.4656056Z Help         : [More Information](https://go.microsoft.com/fwlink/?LinkId=798199)
2020-02-08T23:46:21.4656239Z ==============================================================================
2020-02-08T23:46:21.9194021Z Cleaning any cached credential from repository: rust-lang/rust (GitHub)
2020-02-08T23:46:21.9234720Z ##[section]Finishing: Checkout rust-lang/rust@refs/pull/67742/merge to s
2020-02-08T23:46:21.9366635Z Cleaning up task key
2020-02-08T23:46:21.9367519Z Start cleaning up orphan processes.
2020-02-08T23:46:21.9488208Z Terminate orphan process: pid (3675) (python)
2020-02-08T23:46:21.9734699Z ##[section]Finishing: Finalize Job

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 Feb 11, 2020

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

@mark-i-m mark-i-m marked this pull request as ready for review February 22, 2020 19:19
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-7 of your PR failed (pretty log, 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.
2020-02-22T19:17:51.0044694Z ========================== Starting Command Output ===========================
2020-02-22T19:17:51.0046998Z [command]/bin/bash --noprofile --norc /home/vsts/work/_temp/693c1c32-d6cc-470a-8795-1384710b0b8d.sh
2020-02-22T19:17:51.0047209Z 
2020-02-22T19:17:51.0051073Z ##[section]Finishing: Disable git automatic line ending conversion
2020-02-22T19:17:51.0070557Z ##[section]Starting: Checkout rust-lang/rust@refs/pull/67742/merge to s
2020-02-22T19:17:51.0074225Z Task         : Get sources
2020-02-22T19:17:51.0074459Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2020-02-22T19:17:51.0074685Z Version      : 1.0.0
2020-02-22T19:17:51.0074930Z Author       : Microsoft
---
2020-02-22T19:17:52.2757340Z ##[command]git remote add origin https://github.com/rust-lang/rust
2020-02-22T19:17:52.2767641Z ##[command]git config gc.auto 0
2020-02-22T19:17:52.2773784Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2020-02-22T19:17:52.2780092Z ##[command]git config --get-all http.proxy
2020-02-22T19:17:52.2789932Z ##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/67742/merge:refs/remotes/pull/67742/merge
---
2020-02-22T20:16:25.7199974Z .................................................................................................... 1700/9696
2020-02-22T20:16:29.6903078Z .................................................................................................... 1800/9696
2020-02-22T20:16:39.8955038Z ...........................................i........................................................ 1900/9696
2020-02-22T20:16:47.0703878Z .................................................................................................... 2000/9696
2020-02-22T20:16:59.5487375Z .................................iiiii.............................................................. 2100/9696
2020-02-22T20:17:08.2543754Z .................................................................................................... 2300/9696
2020-02-22T20:17:10.3784698Z .................................................................................................... 2400/9696
2020-02-22T20:17:14.2191783Z .................................................................................................... 2500/9696
2020-02-22T20:17:33.0212851Z .................................................................................................... 2600/9696
---
2020-02-22T20:20:00.6747201Z .........i.......................................................................................... 5000/9696
2020-02-22T20:20:08.6980824Z .................................................................................................... 5100/9696
2020-02-22T20:20:12.7877177Z ....................................i............................................................... 5200/9696
2020-02-22T20:20:21.7182615Z .................................................................................................... 5300/9696
2020-02-22T20:20:27.1130578Z ............ii.ii........i...i...................................................................... 5400/9696
2020-02-22T20:20:35.0450029Z .................................................................................................... 5600/9696
2020-02-22T20:20:44.9458417Z .................................................................................................... 5700/9696
2020-02-22T20:20:51.5997907Z ...i................................................................................................ 5800/9696
2020-02-22T20:20:57.0181518Z .................................................................................................... 5900/9696
2020-02-22T20:20:57.0181518Z .................................................................................................... 5900/9696
2020-02-22T20:21:06.4601514Z ..............................................................................................ii...i 6000/9696
2020-02-22T20:21:17.8769278Z ..ii...........i.................................................................................... 6100/9696
2020-02-22T20:21:32.7609483Z .......................................................................................F............ 6300/9696
2020-02-22T20:21:38.5472753Z .................................................................................................... 6400/9696
2020-02-22T20:21:38.5472753Z .................................................................................................... 6400/9696
2020-02-22T20:21:53.2649142Z .........................i..ii...................................................................... 6500/9696
2020-02-22T20:22:12.3161501Z .................................................................................................... 6700/9696
2020-02-22T20:22:14.3695363Z .................i.................................................................................. 6800/9696
2020-02-22T20:22:16.3308358Z .................................................................................................... 6900/9696
2020-02-22T20:22:18.5765669Z .......................................i............................................................ 7000/9696
---
2020-02-22T20:23:50.1031077Z .................................................................................................... 7700/9696
2020-02-22T20:23:54.5335114Z .................................................................................................... 7800/9696
2020-02-22T20:24:00.3231453Z ...................................................................................i................ 7900/9696
2020-02-22T20:24:08.3281913Z .................................................................................................... 8000/9696
2020-02-22T20:24:14.8084655Z ................................iiiiiii.i........................................................... 8100/9696
2020-02-22T20:24:27.4695452Z .................................................................................................... 8300/9696
2020-02-22T20:24:34.8429427Z .................................................................................................... 8400/9696
2020-02-22T20:24:47.3982028Z .................................................................................................... 8500/9696
2020-02-22T20:24:53.7381142Z .................................................................................................... 8600/9696
---
2020-02-22T20:26:33.2504451Z - error[E0521]: borrowed data escapes outside of function
2020-02-22T20:26:33.2504828Z + error[E0521]: borrowed data escapes outside of method
2020-02-22T20:26:33.2505335Z 97   --> $DIR/outlives-suggestion-simple.rs:73:9
2020-02-22T20:26:33.2505654Z 98    |
2020-02-22T20:26:33.2506059Z 99 LL |     fn get_bar(&self) -> Bar2 {
2020-02-22T20:26:33.2506700Z 100    |                -----
2020-02-22T20:26:33.2506978Z 101    |                |
2020-02-22T20:26:33.2507659Z -    |                `self` declared here, outside of the function body
2020-02-22T20:26:33.2508310Z -    |                `self` is a reference that is only valid in the function body
2020-02-22T20:26:33.2508310Z -    |                `self` is a reference that is only valid in the function body
2020-02-22T20:26:33.2508742Z +    |                `self` declared here, outside of the method body
2020-02-22T20:26:33.2509161Z +    |                `self` is a reference that is only valid in the method body
2020-02-22T20:26:33.2509519Z 104 LL |         Bar2::new(&self)
2020-02-22T20:26:33.2510051Z -    |         ^^^^^^^^^^^^^^^^ `self` escapes the function body here
2020-02-22T20:26:33.2510642Z +    |         ^^^^^^^^^^^^^^^^ `self` escapes the method body here
2020-02-22T20:26:33.2511349Z 107 error: aborting due to 9 previous errors
2020-02-22T20:26:33.2511623Z 108 
2020-02-22T20:26:33.2511799Z 
2020-02-22T20:26:33.2511970Z 
2020-02-22T20:26:33.2511970Z 
2020-02-22T20:26:33.2512245Z The actual stderr differed from the expected stderr.
2020-02-22T20:26:33.2512950Z Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/nll/outlives-suggestion-simple/outlives-suggestion-simple.stderr
2020-02-22T20:26:33.2513631Z To update references, rerun the tests and pass the `--bless` flag
2020-02-22T20:26:33.2514423Z To only update this specific test, also pass `--test-args nll/outlives-suggestion-simple.rs`
2020-02-22T20:26:33.2514989Z error: 1 errors occurred comparing output.
2020-02-22T20:26:33.2515291Z status: exit code: 1
2020-02-22T20:26:33.2515291Z status: exit code: 1
2020-02-22T20:26:33.2518600Z command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/nll/outlives-suggestion-simple.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/nll/outlives-suggestion-simple" "-Crpath" "-O" "-Cdebuginfo=0" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-A" "unused" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/nll/outlives-suggestion-simple/auxiliary"
2020-02-22T20:26:33.2520275Z ------------------------------------------
2020-02-22T20:26:33.2520531Z 
2020-02-22T20:26:33.2520940Z ------------------------------------------
2020-02-22T20:26:33.2521228Z stderr:
---
2020-02-22T20:26:33.2526756Z LL | fn foo1<'a, 'b>(x: &'a usize) -> &'b usize {
2020-02-22T20:26:33.2527331Z    |         --  -- lifetime `'b` defined here
2020-02-22T20:26:33.2527505Z    |         |
2020-02-22T20:26:33.2527813Z    |         lifetime `'a` defined here
2020-02-22T20:26:33.2528026Z LL |     x //~ERROR lifetime may not live long enough
2020-02-22T20:26:33.2528423Z    |     ^ returning this value requires that `'a` must outlive `'b`
2020-02-22T20:26:33.2528953Z    = help: consider adding the following bound: `'a: 'b`
2020-02-22T20:26:33.2529121Z 
2020-02-22T20:26:33.2529261Z error: lifetime may not live long enough
2020-02-22T20:26:33.2529670Z   --> /checkout/src/test/ui/nll/outlives-suggestion-simple.rs:10:5
2020-02-22T20:26:33.2529670Z   --> /checkout/src/test/ui/nll/outlives-suggestion-simple.rs:10:5
2020-02-22T20:26:33.2529861Z    |
2020-02-22T20:26:33.2530167Z LL | fn foo2<'a>(x: &'a usize) -> &'static usize {
2020-02-22T20:26:33.2530856Z LL |     x //~ERROR lifetime may not live long enough
2020-02-22T20:26:33.2530856Z LL |     x //~ERROR lifetime may not live long enough
2020-02-22T20:26:33.2531259Z    |     ^ returning this value requires that `'a` must outlive `'static`
2020-02-22T20:26:33.2531759Z    = help: consider replacing `'a` with `'static`
2020-02-22T20:26:33.2532074Z 
2020-02-22T20:26:33.2532222Z error: lifetime may not live long enough
2020-02-22T20:26:33.2532652Z   --> /checkout/src/test/ui/nll/outlives-suggestion-simple.rs:14:5
2020-02-22T20:26:33.2532652Z   --> /checkout/src/test/ui/nll/outlives-suggestion-simple.rs:14:5
2020-02-22T20:26:33.2532853Z    |
2020-02-22T20:26:33.2533236Z LL | fn foo3<'a, 'b>(x: &'a usize, y: &'b usize) -> (&'b usize, &'a usize) {
2020-02-22T20:26:33.2534060Z    |         |
2020-02-22T20:26:33.2534506Z    |         lifetime `'a` defined here
2020-02-22T20:26:33.2534506Z    |         lifetime `'a` defined here
2020-02-22T20:26:33.2534767Z LL |     (x, y) //~ERROR lifetime may not live long enough
2020-02-22T20:26:33.2535481Z    |     ^^^^^^ function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a`
2020-02-22T20:26:33.2536089Z    = help: consider adding the following bound: `'a: 'b`
2020-02-22T20:26:33.2536259Z 
2020-02-22T20:26:33.2536399Z error: lifetime may not live long enough
2020-02-22T20:26:33.2536808Z   --> /checkout/src/test/ui/nll/outlives-suggestion-simple.rs:14:5
2020-02-22T20:26:33.2536808Z   --> /checkout/src/test/ui/nll/outlives-suggestion-simple.rs:14:5
2020-02-22T20:26:33.2536998Z    |
2020-02-22T20:26:33.2537360Z LL | fn foo3<'a, 'b>(x: &'a usize, y: &'b usize) -> (&'b usize, &'a usize) {
2020-02-22T20:26:33.2538864Z    |         |
2020-02-22T20:26:33.2539152Z    |         lifetime `'a` defined here
2020-02-22T20:26:33.2539152Z    |         lifetime `'a` defined here
2020-02-22T20:26:33.2539385Z LL |     (x, y) //~ERROR lifetime may not live long enough
2020-02-22T20:26:33.2539882Z    |     ^^^^^^ function was supposed to return data with lifetime `'a` but it is returning data with lifetime `'b`
2020-02-22T20:26:33.2540467Z    = help: consider adding the following bound: `'b: 'a`
2020-02-22T20:26:33.2540641Z 
2020-02-22T20:26:33.2540978Z help: `'a` and `'b` must be the same: replace one with the other
2020-02-22T20:26:33.2541153Z 
2020-02-22T20:26:33.2541153Z 
2020-02-22T20:26:33.2541308Z error: lifetime may not live long enough
2020-02-22T20:26:33.2541698Z   --> /checkout/src/test/ui/nll/outlives-suggestion-simple.rs:22:5
2020-02-22T20:26:33.2541888Z    |
2020-02-22T20:26:33.2542239Z LL | fn foo4<'a, 'b, 'c>(x: &'a usize) -> (&'b usize, &'c usize) {
2020-02-22T20:26:33.2542977Z    |         |
2020-02-22T20:26:33.2543278Z    |         lifetime `'a` defined here
2020-02-22T20:26:33.2543447Z ...
2020-02-22T20:26:33.2543447Z ...
2020-02-22T20:26:33.2543624Z LL |     (x, x) //~ERROR lifetime may not live long enough
2020-02-22T20:26:33.2544058Z    |     ^^^^^^ returning this value requires that `'a` must outlive `'b`
2020-02-22T20:26:33.2544619Z    = help: consider adding the following bound: `'a: 'b`
2020-02-22T20:26:33.2544801Z 
2020-02-22T20:26:33.2544966Z error: lifetime may not live long enough
2020-02-22T20:26:33.2545489Z   --> /checkout/src/test/ui/nll/outlives-suggestion-simple.rs:31:9
2020-02-22T20:26:33.2545489Z   --> /checkout/src/test/ui/nll/outlives-suggestion-simple.rs:31:9
2020-02-22T20:26:33.2545859Z    |
2020-02-22T20:26:33.2546202Z LL |     pub fn foo<'a>(x: &'a usize) -> Self {
2020-02-22T20:26:33.2546565Z    |                -- lifetime `'a` defined here
2020-02-22T20:26:33.2546805Z LL |         Foo { x } //~ERROR lifetime may not live long enough
2020-02-22T20:26:33.2547270Z    |         ^^^^^^^^^ returning this value requires that `'a` must outlive `'static`
2020-02-22T20:26:33.2547772Z    = help: consider replacing `'a` with `'static`
2020-02-22T20:26:33.2547915Z 
2020-02-22T20:26:33.2548071Z error: lifetime may not live long enough
2020-02-22T20:26:33.2548460Z   --> /checkout/src/test/ui/nll/outlives-suggestion-simple.rs:41:9
2020-02-22T20:26:33.2548460Z   --> /checkout/src/test/ui/nll/outlives-suggestion-simple.rs:41:9
2020-02-22T20:26:33.2548651Z    |
2020-02-22T20:26:33.2548911Z LL | impl<'a> Bar<'a> {
2020-02-22T20:26:33.2549309Z    |      -- lifetime `'a` defined here
2020-02-22T20:26:33.2549645Z LL |     pub fn get<'b>(&self) -> &'b usize {
2020-02-22T20:26:33.2550010Z    |                -- lifetime `'b` defined here
2020-02-22T20:26:33.2550246Z LL |         self.x //~ERROR lifetime may not live long enough
2020-02-22T20:26:33.2550671Z    |         ^^^^^^ returning this value requires that `'a` must outlive `'b`
2020-02-22T20:26:33.2551207Z    = help: consider adding the following bound: `'a: 'b`
2020-02-22T20:26:33.2551376Z 
2020-02-22T20:26:33.2551515Z error: lifetime may not live long enough
2020-02-22T20:26:33.2551920Z   --> /checkout/src/test/ui/nll/outlives-suggestion-simple.rs:52:9
2020-02-22T20:26:33.2551920Z   --> /checkout/src/test/ui/nll/outlives-suggestion-simple.rs:52:9
2020-02-22T20:26:33.2552110Z    |
2020-02-22T20:26:33.2552350Z LL | impl<'a> Baz<'a> {
2020-02-22T20:26:33.2552666Z    |      -- lifetime `'a` defined here
2020-02-22T20:26:33.2552993Z LL |     fn get<'b>(&'b self) -> &'a i32 {
2020-02-22T20:26:33.2553513Z    |            -- lifetime `'b` defined here
2020-02-22T20:26:33.2553776Z LL |         self.x //~ERROR lifetime may not live long enough
2020-02-22T20:26:33.2554228Z    |         ^^^^^^ returning this value requires that `'b` must outlive `'a`
2020-02-22T20:26:33.2554793Z    = help: consider adding the following bound: `'b: 'a`
2020-02-22T20:26:33.2554970Z 
2020-02-22T20:26:33.2555139Z error[E0521]: borrowed data escapes outside of method
2020-02-22T20:26:33.2555570Z   --> /checkout/src/test/ui/nll/outlives-suggestion-simple.rs:73:9
2020-02-22T20:26:33.2555570Z   --> /checkout/src/test/ui/nll/outlives-suggestion-simple.rs:73:9
2020-02-22T20:26:33.2555787Z    |
2020-02-22T20:26:33.2556075Z LL |     fn get_bar(&self) -> Bar2 {
2020-02-22T20:26:33.2556697Z    |                |
2020-02-22T20:26:33.2556697Z    |                |
2020-02-22T20:26:33.2556900Z    |                `self` declared here, outside of the method body
2020-02-22T20:26:33.2557178Z    |                `self` is a reference that is only valid in the method body
2020-02-22T20:26:33.2557498Z LL |         Bar2::new(&self) //~ERROR borrowed data escapes outside of function
2020-02-22T20:26:33.2557787Z    |         ^^^^^^^^^^^^^^^^ `self` escapes the method body here
2020-02-22T20:26:33.2558101Z error: aborting due to 9 previous errors
2020-02-22T20:26:33.2558229Z 
2020-02-22T20:26:33.2558300Z 
2020-02-22T20:26:33.2558581Z ------------------------------------------
---
2020-02-22T20:26:33.2560365Z thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:348:22
2020-02-22T20:26:33.2560697Z note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
2020-02-22T20:26:33.2560872Z 
2020-02-22T20:26:33.2560943Z 
2020-02-22T20:26:33.2563978Z 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-7/bin/FileCheck" "--host-rustcflags" "-Crpath -O -Cdebuginfo=0 -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--target-rustcflags" "-Crpath -O -Cdebuginfo=0 -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" "7.0.0\n" "--system-llvm" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"
2020-02-22T20:26:33.2566140Z 
2020-02-22T20:26:33.2566219Z 
2020-02-22T20:26:33.2567094Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
2020-02-22T20:26:33.2567439Z Build completed unsuccessfully in 1:01:47
2020-02-22T20:26:33.2567439Z Build completed unsuccessfully in 1:01:47
2020-02-22T20:26:33.2583273Z == clock drift check ==
2020-02-22T20:26:33.2605500Z   local time: Sat Feb 22 20:26:33 UTC 2020
2020-02-22T20:26:33.5283787Z   network time: Sat, 22 Feb 2020 20:26:33 GMT
2020-02-22T20:26:33.5287712Z == end clock drift check ==
2020-02-22T20:26:34.0076805Z 
2020-02-22T20:26:34.0158656Z ##[error]Bash exited with code '1'.
2020-02-22T20:26:34.0170719Z ##[section]Finishing: Run build
2020-02-22T20:26:34.0210088Z ##[section]Starting: Checkout rust-lang/rust@refs/pull/67742/merge to s
2020-02-22T20:26:34.0214149Z Task         : Get sources
2020-02-22T20:26:34.0214404Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2020-02-22T20:26:34.0214639Z Version      : 1.0.0
2020-02-22T20:26:34.0214820Z Author       : Microsoft
2020-02-22T20:26:34.0214820Z Author       : Microsoft
2020-02-22T20:26:34.0215084Z Help         : [More Information](https://go.microsoft.com/fwlink/?LinkId=798199)
2020-02-22T20:26:34.0215386Z ==============================================================================
2020-02-22T20:26:34.3061062Z Cleaning any cached credential from repository: rust-lang/rust (GitHub)
2020-02-22T20:26:34.3100952Z ##[section]Finishing: Checkout rust-lang/rust@refs/pull/67742/merge to s
2020-02-22T20:26:34.3174046Z Cleaning up task key
2020-02-22T20:26:34.3175005Z Start cleaning up orphan processes.
2020-02-22T20:26:34.3311749Z Terminate orphan process: pid (3732) (python)
2020-02-22T20:26:34.3516283Z ##[section]Finishing: Finalize Job

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)

@mark-i-m
Copy link
Member Author

Tests passing now. The UI changes are all "function" -> "method".

@mark-i-m
Copy link
Member Author

@rustbot modify labels: +S-waiting-on-review -S-waiting-on-author

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Feb 24, 2020
@@ -7,7 +7,7 @@ LL | fn foo<'a>(x: &i32, y: &'a i32) -> &'a i32 {
| lifetime `'a` defined here
LL |
LL | if x > y { x } else { y }
| ^ function was supposed to return data with lifetime `'a` but it is returning data with lifetime `'1`
| ^ method was supposed to return data with lifetime `'a` but it is returning data with lifetime `'1`
Copy link
Member Author

Choose a reason for hiding this comment

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

Hmm... actually, this is not a method... all the others appear correct.

And I also just realized, that I don't know why this change in UI happened? Any ideas?

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

Hmm... do you mean this one instead?

https://github.com/rust-lang/rust/pull/67742/files?file-filters%5B%5D=.rs#diff-5f616dd3631e07b51dd7c59f32ccfb76R505-R507

Also, this seems to imply that we are getting a DefKind::Method instead of a DefKind::Fn. Is this expected?

Copy link
Contributor

Choose a reason for hiding this comment

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

DefKind::Method is for all associated functions. This is generally what Method means in the compiler, not that it should be leaking into error messages.

Copy link
Contributor

Choose a reason for hiding this comment

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

We should rename DefKind::Method to DefKind::AssocFn so that it fits with the scheme used for AssocTy, AssocConst, etc. cc @petrochenkov @eddyb

Copy link
Member

Choose a reason for hiding this comment

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

Pretty sure we have an issue open about this, yeah.

@matthewjasper
Copy link
Contributor

r=me if you're happy with the current use of "method" in the diagnostics.

@mark-i-m
Copy link
Member Author

@matthewjasper Thanks! This looks good to me.

If there is an easy way to fix it, perhaps I can do that in a followup?

@matthewjasper
Copy link
Contributor

I was thinking of changing what DefKind::descr returns, but maybe that should be a separate change because it might change even more diagnostics.

@bors r+

@bors
Copy link
Contributor

bors commented Feb 25, 2020

📌 Commit 9434d6b has been approved by matthewjasper

@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 Feb 25, 2020
@bors
Copy link
Contributor

bors commented Feb 26, 2020

⌛ Testing commit 9434d6b with merge 0c15adc...

@bors
Copy link
Contributor

bors commented Feb 27, 2020

☀️ Test successful - checks-azure
Approved by: matthewjasper
Pushing 0c15adc to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Feb 27, 2020
@bors bors merged commit 0c15adc into rust-lang:master Feb 27, 2020
Comment on lines +1520 to +1521
let kind = self.def_kind(def_id).unwrap();
(kind.article(), kind.descr(def_id))
Copy link
Member

Choose a reason for hiding this comment

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

I wish I saw this earlier - I think you should always call def_kind and only look at the def_key or other things if def_kind returned None.

The reason is that DefKind should eventually encompass every possible DefId, and the current situation is a transitional one (since DefKind was split out of name resolution, which only needs the current set of possible DefKinds).

Copy link
Member

@eddyb eddyb Feb 27, 2020

Choose a reason for hiding this comment

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

I don't know if there is an issue for finishing DefKind, but feel free to work on that, or open one if there isn't one already.

Ideally def_key would be used in as few places as possible, as it's really the "name" of a definition more than anything else.

@mark-i-m mark-i-m deleted the describe-it branch March 6, 2020 23:58
JohnTitor added a commit to JohnTitor/rust that referenced this pull request Mar 14, 2020
…sper

Change "method" to "associated function"

r? @matthewjasper

cc @Centril @eddyb rust-lang#67742

I'm opening this mostly as a test to see what the diagnostic changes would be. It seems that this makes them somewhat more verbose, and I'm not sure it's worth it...

The relevant changes are the last two commits (it is rebased on top of rust-lang#67742)
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Mar 14, 2020
…sper

Change "method" to "associated function"

r? @matthewjasper

cc @Centril @eddyb rust-lang#67742

I'm opening this mostly as a test to see what the diagnostic changes would be. It seems that this makes them somewhat more verbose, and I'm not sure it's worth it...

The relevant changes are the last two commits (it is rebased on top of rust-lang#67742)
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Mar 15, 2020
…sper

Change "method" to "associated function"

r? @matthewjasper

cc @Centril @eddyb rust-lang#67742

I'm opening this mostly as a test to see what the diagnostic changes would be. It seems that this makes them somewhat more verbose, and I'm not sure it's worth it...

The relevant changes are the last two commits (it is rebased on top of rust-lang#67742)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. 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.

9 participants