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

don't elide lifetimes in paths in librustc/ #53816

Merged

Conversation

zackmdavis
Copy link
Member

@zackmdavis zackmdavis commented Aug 30, 2018

In light of the "Apply to rustc" checkbox on #44524 and @nikomatsakis's recent comment about regularly wanting visual indication of elided lifetimes in types, I was curious to see what it would look like if we turned the elided_lifetimes_in_path lint on in at least one crate in the codebase (I chose librustc). Given that I couldn't figure out how to get cargo fix work with the build system, this arguably wasn't a very efficient use of my time, but once I started, the conjunction of moral law and the sunk cost fallacy forced me to continue.

This is mostly applying the <'_> suggestions issued by the lint, but there were a few places where I named the lifetimes (e.g., <'a, 'gcx, 'tcx> on TyCtxt) in order to match style with surrounding code.

r? @nikomatsakis

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 30, 2018
@@ -331,7 +331,7 @@ macro_rules! define_dep_nodes {
/// refers to something from the previous compilation session that
/// has been removed.
#[inline]
pub fn extract_def_id(&self, tcx: TyCtxt) -> Option<DefId> {
pub fn extract_def_id(&self, tcx: TyCtxt<'a, 'gcx, 'tcx>) -> Option<DefId> {
Copy link
Member

Choose a reason for hiding this comment

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

I think I would prefer this as '_ since they're not used.

Copy link
Contributor

Choose a reason for hiding this comment

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

I too would prefer to use '_ — I like to know when the names are important. I also just don't like our convention of using name 'a, though I guess that's neither here nor there =)

Copy link
Contributor

Choose a reason for hiding this comment

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

Are we using in-band lifetimes here, or are these names in scope?

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.

Wow, this is awesome, and kind of unexpected. I think I would have preferred to see TyCtxt,'_, '_, '_>, but actually I could go either way on that point, and we could always tweak later (guided by the "single-use lifetime" lint).

@nikomatsakis
Copy link
Contributor

@bors r+

I think I'm going to r+ this as is because "bitrot"

@bors
Copy link
Contributor

bors commented Aug 30, 2018

📌 Commit c9a67858ecb9c686bfbbd7e2929e3e86e62bd571 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 Aug 30, 2018
@@ -55,7 +55,8 @@ impl Cache {
*self.predecessors.borrow_mut() = None;
}

pub fn predecessors(&self, mir: &Mir) -> ReadGuard<IndexVec<BasicBlock, Vec<BasicBlock>>> {
pub fn predecessors(&self, mir: &Mir<'_>)
-> ReadGuard<'_, IndexVec<BasicBlock, Vec<BasicBlock>>> {
Copy link
Contributor

Choose a reason for hiding this comment

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

This exact function confuses me every time — I always think "how come there is no lifetime here?!"

@bors
Copy link
Contributor

bors commented Sep 1, 2018

⌛ Testing commit c9a67858ecb9c686bfbbd7e2929e3e86e62bd571 with merge 0c4c20043bfe7c2069c8cd5f4969449feb9cfc66...

@bors
Copy link
Contributor

bors commented Sep 1, 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 1, 2018
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-debug 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:49] 
[00:04:49] error: Could not compile `rustc`.
[00:04:49] 
[00:04:49] Caused by:
[00:04:49]   process didn't exit successfully: `/checkout/obj/build/bootstrap/debug/rustc --crate-name rustc librustc/lib.rs --color always --error-format json --crate-type dylib --emit=dep-info,metadata -C prefer-dynamic -C opt-level=2 -C metadata=c80832497be56dad -C extra-filename=-c80832497be56dad --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-826447fcad47d3ad.rmeta --extern backtrace=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libbacktrace-184d2a78ecc794c8.rmeta --extern bitflags=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libbitflags-e6d22cc3c74247d5.rmeta --extern byteorder=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libbyteorder-dd7bce5599a644fd.rmeta --extern chalk_engine=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libchalk_engine-800784824a6b2174.rmeta --extern flate2=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libflate2-02d966840b167981.rmeta --extern fmt_macros=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libfmt_macros-d9cbbd55dadc1a79.rmeta --extern graphviz=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libgraphviz-1422d82efe208b7a.rmeta --extern jobserver=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libjobserver-4489d0f5fe18ecf4.rmeta --extern lazy_static=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/liblazy_static-329986913e2fbde7.rmeta --extern log=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/liblog-445c78b30a600938.rmeta --extern parking_lot=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libparking_lot-995c92418f1c49d0.rmeta --extern polonius_engine=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libpolonius_engine-a669ffce0e02389a.rmeta --extern proc_macro=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libproc_macro-934697b5758435a2.rmeta --extern rustc_rayon=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_rayon-c7c2646c556db1c0.rmeta --extern rustc_rayon_core=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_rayon_core-ea60bff1c29b1037.rmeta --extern rustc_apfloat=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_apfloat-30d39368be32fa2e.rmeta --extern rustc_data_structures=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_data_structures-027c0ca43081b1e8.rmeta --extern rustc_errors=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_errors-9cc7d7855d756635.rmeta --extern rustc_fs_util=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_fs_util-300dc69e71213529.rmeta --extern rustc_target=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_target-62a91fdc5731dc0e.rmeta --extern scoped_tls=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libscoped_tls-90354e0a4903eca7.rmeta --extern serialize=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libserialize-5515a7a8d5fe3e66.rmeta --extern smallvec=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libsmallvec-f0122952bd92f973.rmeta --extern syntax=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libsyntax-cb7790fd9ee13ed4.rmeta --extern syntax_pos=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libsyntax_pos-6449186865dade13.rmeta --extern tempfile=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libtempfile-b20a480e56610e05.rmeta -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:04:49] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "check" "--target" "x86_64-unknown-linux-gnu" "-j" "4" "--release" "--color" "always" "--features" " jemalloc" "--manifest-path" "/checkout/src/rustc/Cargo.toml" "--message-format" "json"
[00:04:49] expected success, got: exit code: 101
[00:04:49] thread 'main' panicked at 'cargo must succeed', bootstrap/compile.rs:1155:9
[00:04:49] travis_fold:end:stage0-rustc

[00:04:49] travis_time:end:stage0-rustc:start=1535784980074841963,finish=1535785040065517403,duration=59990675440

---
travis_time:end:3340f4a3:start=1535785040807686957,finish=1535785040817405139,duration=9718182
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:0d9e6365
$ 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:19390fd0
travis_time:start:19390fd0
$ 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:0f074740
$ 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)

@kennytm
Copy link
Member

kennytm commented Sep 1, 2018

Missed one <'_>.

[00:04:30] error: hidden lifetime parameters in types are deprecated
[00:04:30]    --> librustc/lint/context.rs:405:10
[00:04:30]     |
[00:04:30] 405 |     ) -> CheckLintNameResult {
[00:04:30]     |          ^^^^^^^^^^^^^^^^^^^- help: indicate the anonymous lifetime: `<'_>`

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

bors commented Sep 1, 2018

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

@zackmdavis zackmdavis mentioned this pull request Sep 2, 2018
@BatmanAoD
Copy link
Member

Ping from triage, @zackmdavis! Any update on fixing the missing lifetime?

@zackmdavis
Copy link
Member Author

@BatmanAoD yes, thanks, I have a note on my to-do list to rebase this tonight.

@zackmdavis
Copy link
Member Author

or at least "soon" if not literally tonight (I hope I may be forgiven for the phenomenon where a task that only takes 10 minutes of wall time costs disproportionately more in subjective "activiation energy")

@zackmdavis zackmdavis force-pushed the elided_lifetimes_in_paths_field_day branch from c9a6785 to 54cc45c Compare September 14, 2018 05:03
@zackmdavis zackmdavis removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Sep 14, 2018
@bors
Copy link
Contributor

bors commented Sep 14, 2018

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

@bors bors added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Sep 14, 2018
@zackmdavis zackmdavis force-pushed the elided_lifetimes_in_paths_field_day branch from 54cc45c to 91a3cb1 Compare September 14, 2018 14:43
@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:08:52]    Compiling syntax_ext v0.0.0 (file:///checkout/src/libsyntax_ext)
[00:08:57] error: hidden lifetime parameters in types are deprecated
[00:08:57]   --> librustc/hir/def_id.rs:39:29
[00:08:57]    |
[00:08:57] 39 |     fn fmt(&self, fmt: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
[00:08:57] 
[00:08:57] error: hidden lifetime parameters in types are deprecated
[00:08:57]    --> librustc/middle/region.rs:110:29
[00:08:57]     |
[00:08:57]     |
[00:08:57] 110 |     fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
[00:08:57]     |                             ^^^^^^^^^^^^^^- help: indicate the anonymous lifetime: `<'_>`
[00:08:57] 
[00:08:57] error: hidden lifetime parameters in types are deprecated
[00:08:57]    --> librustc/ty/context.rs:304:27
[00:08:57]     |
[00:08:57] 304 |     pub fn iter(&self) -> hash_map::Iter<hir::ItemLocalId, V> {
[00:08:57]     |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: indicate the anonymous lifetime: `hash_map::Iter<'_, hir::ItemLocalId, V>`
[00:08:57] error: hidden lifetime parameters in types are deprecated
[00:08:57]    --> librustc/ty/context.rs:328:48
[00:08:57]     |
[00:08:57]     |
[00:08:57] 328 |     pub fn entry(&mut self, id: hir::HirId) -> Entry<hir::ItemLocalId, V> {
[00:08:57]     |                                                ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: indicate the anonymous lifetime: `Entry<'_, hir::ItemLocalId, V>`
[00:08:57] error: hidden lifetime parameters in types are deprecated
[00:08:57]    --> librustc/ty/context.rs:486:42
[00:08:57]     |
[00:08:57]     |
[00:08:57] 486 |     pub fn type_dependent_defs(&self) -> LocalTableInContext<Def> {
[00:08:57]     |                                          ^^^^^^^^^^^^^^^^^^^^^^^^ help: indicate the anonymous lifetime: `LocalTableInContext<'_, Def>`
[00:08:57] error: hidden lifetime parameters in types are deprecated
[00:08:57]    --> librustc/ty/context.rs:493:50
[00:08:57]     |
[00:08:57]     |
[00:08:57] 493 |     pub fn type_dependent_defs_mut(&mut self) -> LocalTableInContextMut<Def> {
[00:08:57]     |                                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: indicate the anonymous lifetime: `LocalTableInContextMut<'_, Def>`
[00:08:57] error: hidden lifetime parameters in types are deprecated
[00:08:57]    --> librustc/ty/context.rs:500:36
[00:08:57]     |
[00:08:57]     |
[00:08:57] 500 |     pub fn field_indices(&self) -> LocalTableInContext<usize> {
[00:08:57]     |                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: indicate the anonymous lifetime: `LocalTableInContext<'_, usize>`
[00:08:57] error: hidden lifetime parameters in types are deprecated
[00:08:57]    --> librustc/ty/context.rs:507:44
[00:08:57]     |
[00:08:57]     |
[00:08:57] 507 |     pub fn field_indices_mut(&mut self) -> LocalTableInContextMut<usize> {
[00:08:57]     |                                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: indicate the anonymous lifetime: `LocalTableInContextMut<'_, usize>`
[00:08:57] error: hidden lifetime parameters in types are deprecated
[00:08:57]    --> librustc/ty/context.rs:514:40
[00:08:57]     |
[00:08:57]     |
[00:08:57] 514 |     pub fn user_provided_tys(&self) -> LocalTableInContext<CanonicalTy<'tcx>> {
[00:08:57]     |                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: indicate the anonymous lifetime: `LocalTableInContext<'_, CanonicalTy<'tcx>>`
[00:08:57] error: hidden lifetime parameters in types are deprecated
[00:08:57]    --> librustc/ty/context.rs:521:48
[00:08:57]     |
[00:08:57]     |
[00:08:57] 521 |     pub fn user_provided_tys_mut(&mut self) -> LocalTableInContextMut<CanonicalTy<'tcx>> {
[00:08:57]     |                                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: indicate the anonymous lifetime: `LocalTableInContextMut<'_, CanonicalTy<'tcx>>`
[00:08:57] error: hidden lifetime parameters in types are deprecated
[00:08:57]    --> librustc/ty/context.rs:528:33
[00:08:57]     |
[00:08:57]     |
[00:08:57] 528 |     pub fn node_types(&self) -> LocalTableInContext<Ty<'tcx>> {
[00:08:57]     |                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: indicate the anonymous lifetime: `LocalTableInContext<'_, Ty<'tcx>>`
[00:08:57] error: hidden lifetime parameters in types are deprecated
[00:08:57]    --> librustc/ty/context.rs:535:41
[00:08:57]     |
[00:08:57]     |
[00:08:57] 535 |     pub fn node_types_mut(&mut self) -> LocalTableInContextMut<Ty<'tcx>> {
[00:08:57]     |                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: indicate the anonymous lifetime: `LocalTableInContextMut<'_, Ty<'tcx>>`
[00:08:57] error: hidden lifetime parameters in types are deprecated
[00:08:57]    --> librustc/ty/context.rs:560:42
[00:08:57]     |
[00:08:57]     |
[00:08:57] 560 |     pub fn node_substs_mut(&mut self) -> LocalTableInContextMut<&'tcx Substs<'tcx>> {
[00:08:57]     |                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: indicate the anonymous lifetime: `LocalTableInContextMut<'_, &'tcx Substs<'tcx>>`
[00:08:57] error: hidden lifetime parameters in types are deprecated
[00:08:57]    --> librustc/ty/context.rs:577:42
[00:08:57]     |
[00:08:57]     |
[00:08:57] 577 |     pub fn user_substs_mut(&mut self) -> LocalTableInContextMut<CanonicalSubsts<'tcx>> {
[00:08:57]     |                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: indicate the anonymous lifetime: `LocalTableInContextMut<'_, CanonicalSubsts<'tcx>>`
[00:08:57] error: hidden lifetime parameters in types are deprecated
[00:08:57]    --> librustc/ty/context.rs:617:34
[00:08:57]     |
[00:08:57]     |
[00:08:57] 617 |     pub fn adjustments(&self) -> LocalTableInContext<Vec<ty::adjustment::Adjustment<'tcx>>> {
[00:08:57]     |                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: indicate the anonymous lifetime: `LocalTableInContext<'_, Vec<ty::adjustment::Adjustment<'tcx>>>`
[00:08:57] error: hidden lifetime parameters in types are deprecated
[00:08:57]    --> librustc/ty/context.rs:625:31
[00:08:57]     |
[00:08:57]     |
[00:08:57] 625 |                            -> LocalTableInContextMut<Vec<ty::adjustment::Adjustment<'tcx>>> {
[00:08:57]     |                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: indicate the anonymous lifetime: `LocalTableInContextMut<'_, Vec<ty::adjustment::Adjustment<'tcx>>>`
[00:08:57] error: hidden lifetime parameters in types are deprecated
[00:08:57]    --> librustc/ty/context.rs:666:40
[00:08:57]     |
[00:08:57]     |
[00:08:57] 666 |     pub fn pat_binding_modes(&self) -> LocalTableInContext<BindingMode> {
[00:08:57]     |                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: indicate the anonymous lifetime: `LocalTableInContext<'_, BindingMode>`
[00:08:57] error: hidden lifetime parameters in types are deprecated
[00:08:57]    --> librustc/ty/context.rs:674:31
[00:08:57]     |
[00:08:57]     |
[00:08:57] 674 |                            -> LocalTableInContextMut<BindingMode> {
[00:08:57]     |                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: indicate the anonymous lifetime: `LocalTableInContextMut<'_, BindingMode>`
[00:08:57] error: hidden lifetime parameters in types are deprecated
[00:08:57]    --> librustc/ty/context.rs:681:38
[00:08:57]     |
[00:08:57]     |
[00:08:57] 681 |     pub fn pat_adjustments(&self) -> LocalTableInContext<Vec<Ty<'tcx>>> {
[00:08:57]     |                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: indicate the anonymous lifetime: `LocalTableInContext<'_, Vec<Ty<'tcx>>>`
[00:08:57] error: hidden lifetime parameters in types are deprecated
[00:08:57]    --> librustc/ty/context.rs:689:31
[00:08:57]     |
[00:08:57]     |
[00:08:57] 689 |                            -> LocalTableInContextMut<Vec<Ty<'tcx>>> {
[00:08:57]     |                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: indicate the anonymous lifetime: `LocalTableInContextMut<'_, Vec<Ty<'tcx>>>`
[00:08:57] error: hidden lifetime parameters in types are deprecated
[00:08:57]    --> librustc/ty/context.rs:700:43
[00:08:57]     |
[00:08:57]     |
[00:08:57] 700 |     pub fn closure_kind_origins(&self) -> LocalTableInContext<(Span, ast::Name)> {
[00:08:57]     |                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: indicate the anonymous lifetime: `LocalTableInContext<'_, (Span, ast::Name)>`
[00:08:57] error: hidden lifetime parameters in types are deprecated
[00:08:57]    --> librustc/ty/context.rs:707:51
[00:08:57]     |
[00:08:57]     |
[00:08:57] 707 |     pub fn closure_kind_origins_mut(&mut self) -> LocalTableInContextMut<(Span, ast::Name)> {
[00:08:57]     |                                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: indicate the anonymous lifetime: `LocalTableInContextMut<'_, (Span, ast::Name)>`
[00:08:57] error: hidden lifetime parameters in types are deprecated
[00:08:57]    --> librustc/ty/context.rs:714:40
[00:08:57]     |
[00:08:57]     |
[00:08:57] 714 |     pub fn liberated_fn_sigs(&self) -> LocalTableInContext<ty::FnSig<'tcx>> {
[00:08:57]     |                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: indicate the anonymous lifetime: `LocalTableInContext<'_, ty::FnSig<'tcx>>`
[00:08:57] error: hidden lifetime parameters in types are deprecated
[00:08:57]    --> librustc/ty/context.rs:721:48
[00:08:57]     |
[00:08:57]     |
[00:08:57] 721 |     pub fn liberated_fn_sigs_mut(&mut self) -> LocalTableInContextMut<ty::FnSig<'tcx>> {
[00:08:57]     |                                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: indicate the anonymous lifetime: `LocalTableInContextMut<'_, ty::FnSig<'tcx>>`
[00:08:57] error: hidden lifetime parameters in types are deprecated
[00:08:57]    --> librustc/ty/context.rs:728:38
[00:08:57]     |
[00:08:57]     |
[00:08:57] 728 |     pub fn fru_field_types(&self) -> LocalTableInContext<Vec<Ty<'tcx>>> {
[00:08:57]     |                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: indicate the anonymous lifetime: `LocalTableInContext<'_, Vec<Ty<'tcx>>>`
[00:08:57] error: hidden lifetime parameters in types are deprecated
[00:08:57]    --> librustc/ty/context.rs:735:46
[00:08:57]     |
[00:08:57]     |
[00:08:57] 735 |     pub fn fru_field_types_mut(&mut self) -> LocalTableInContextMut<Vec<Ty<'tcx>>> {
[00:08:57]     |                                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: indicate the anonymous lifetime: `LocalTableInContextMut<'_, Vec<Ty<'tcx>>>`
[00:08:57] error: hidden lifetime parameters in types are deprecated
[00:08:57]    --> librustc/ty/context.rs:742:33
[00:08:57]     |
[00:08:57]     |
[00:08:57] 742 |     pub fn cast_kinds(&self) -> LocalTableInContext<ty::cast::CastKind> {
[00:08:57]     |                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: indicate the anonymous lifetime: `LocalTableInContext<'_, ty::cast::CastKind>`
[00:08:57] error: hidden lifetime parameters in types are deprecated
[00:08:57]    --> librustc/ty/context.rs:749:41
[00:08:57]     |
[00:08:57]     |
[00:08:57] 749 |     pub fn cast_kinds_mut(&mut self) -> LocalTableInContextMut<ty::cast::CastKind> {
[00:08:57]     |                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: indicate the anonymous lifetime: `LocalTableInContextMut<'_, ty::cast::CastKind>`
[00:08:57] error: hidden lifetime parameters in types are deprecated
[00:08:57]     --> librustc/ty/context.rs:1899:51
[00:08:57]      |
[00:08:57]      |
[00:08:57] 1899 |     fn span_debug(span: syntax_pos::Span, f: &mut fmt::Formatter) -> fmt::Result {
[00:08:57] 
[00:08:57] error: hidden lifetime parameters in types are deprecated
[00:08:57]     --> librustc/ty/context.rs:2022:33
[00:08:57]      |
[00:08:57]      |
[00:08:57] 2022 |             sync::assert_sync::<ImplicitCtxt>();
[00:08:57] 
[00:08:57] error: hidden lifetime parameters in types are deprecated
[00:08:57]     --> librustc/ty/context.rs:2024:50
[00:08:57]      |
[00:08:57]      |
[00:08:57] 2024 |             unsafe { f(Some(&*(context as *const ImplicitCtxt))) }
[00:08:57] 
[00:08:57] error: hidden lifetime parameters in types are deprecated
[00:08:57]     --> librustc/ty/context.rs:2048:31
[00:08:57]      |
[00:08:57]      |
[00:08:57] 2048 |                 let context: &ImplicitCtxt = mem::transmute(context);
[00:08:57] 
[00:08:57] error: hidden lifetime parameters in types are deprecated
[00:08:57]     --> librustc/ty/context.rs:2068:31
[00:08:57]      |
[00:08:57]      |
[00:08:57] 2068 |                 let context: &ImplicitCtxt = mem::transmute(context);
[00:08:57] 
[00:08:57] error: hidden lifetime parameters in types are deprecated
[00:08:57]     --> librustc/ty/context.rs:2108:28
[00:08:57]      |
[00:08:57]      |
[00:08:57] 2108 |               pub fn go(tcx: TyCtxt) {
[00:08:57] ...
[00:08:57] 2157 | /         sty_debug_print!(
[00:08:57] 2158 | |             self,
[00:08:57] 2158 | |             self,
[00:08:57] 2159 | |             Adt, Array, Slice, RawPtr, Ref, FnDef, FnPtr,
[00:08:57] 2160 | |             Generator, GeneratorWitness, Dynamic, Closure, Tuple,
[00:08:57] 2161 | |             Param, Infer, Projection, Opaque, Foreign);
[00:08:57] 
[00:08:57] error: hidden lifetime parameters in types are deprecated
[00:08:57]     --> librustc/ty/context.rs:2350:27
[00:08:57]      |
[00:08:57]      |
[00:08:57] 2350 |     const_: mk_const(|c: &Const| keep_local(&c.ty) || keep_local(&c.val)) -> Const<'tcx>
[00:08:57] 
[00:08:57] error: hidden lifetime parameters in types are deprecated
[00:08:57]     --> librustc/ty/context.rs:2359:20
[00:08:57]      |
[00:08:57]      |
[00:08:57] 2359 |               |xs: &[$ty]| xs.iter().any(keep_local)) -> List<$ty<'tcx>>);)+
[00:08:57]      |                      ^^^- help: indicate the anonymous lifetime: `<'_>`
[00:08:57] ...
[00:08:57] 2363 | / slice_interners!(
[00:08:57] 2364 | |     existential_predicates: _intern_existential_predicates(ExistentialPredicate),
[00:08:57] 2365 | |     predicates: _intern_predicates(Predicate),
[00:08:57] 2366 | |     type_list: _intern_type_list(Ty),
[00:08:57] ...    |
[00:08:57] 2369 | |     goals: _intern_goals(Goal)
[00:08:57] 2370 | | );
[00:08:57]      | |__- in this macro invocation
[00:08:57] error: hidden lifetime parameters in types are deprecated
[00:08:57]     --> librustc/ty/context.rs:2749:53
[00:08:57]      |
[00:08:57]      |
[00:08:57] 2749 |     pub fn mk_goal(self, goal: Goal<'tcx>) -> &'tcx Goal {
[00:08:57] 
[00:08:57] error: hidden lifetime parameters in types are deprecated
[00:08:57]     --> librustc/ty/context.rs:2916:32
[00:08:57]      |
[00:08:57]      |
[00:08:57] 2916 | pub fn provide(providers: &mut ty::query::Providers) {
[00:08:57] 

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 15, 2018

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

@bors
Copy link
Contributor

bors commented Sep 30, 2018

📌 Commit aab59892b4fa4357230610dd8c6525bf29b16b1a 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 30, 2018
@bors
Copy link
Contributor

bors commented Sep 30, 2018

🔒 Merge conflict

This pull request and the master branch diverged in a way that cannot be automatically merged. Please rebase on top of the latest master branch, and let the reviewer approve again.

How do I rebase?

Assuming self is your fork and upstream is this repository, you can resolve the conflict following these steps:

  1. git checkout elided_lifetimes_in_paths_field_day (switch to your branch)
  2. git fetch upstream master (retrieve the latest master)
  3. git rebase upstream/master -p (rebase on top of it)
  4. Follow the on-screen instruction to resolve conflicts (check git status if you got lost).
  5. git push self elided_lifetimes_in_paths_field_day --force-with-lease (update this PR)

You may also read Git Rebasing to Resolve Conflicts by Drew Blessing for a short tutorial.

Please avoid the "Resolve conflicts" button on GitHub. It uses git merge instead of git rebase which makes the PR commit history more difficult to read.

Sometimes step 4 will complete without asking for resolution. This is usually due to difference between how Cargo.lock conflict is handled during merge and rebase. This is normal, and you should still perform step 5 to update this PR.

Error message
Auto-merging src/librustc/ty/context.rs
CONFLICT (content): Merge conflict in src/librustc/ty/context.rs
Auto-merging src/librustc/middle/region.rs
Auto-merging src/librustc/lib.rs
Automatic merge failed; fix conflicts and then commit the result.

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

bors commented Sep 30, 2018

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

This seemed like a good way to kick the tires on the
elided-lifetimes-in-paths lint (rust-lang#52069)—seems to work! This was also
pretty tedious—it sure would be nice if `cargo fix` worked on this
codebase (rust-lang#53896)!
@zackmdavis zackmdavis force-pushed the elided_lifetimes_in_paths_field_day branch from aab5989 to 5b22d9b Compare September 30, 2018 04:48
@zackmdavis
Copy link
Member Author

@bors r=nikomatsakis

@bors
Copy link
Contributor

bors commented Sep 30, 2018

📌 Commit 5b22d9b 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 30, 2018
@bors
Copy link
Contributor

bors commented Sep 30, 2018

⌛ Testing commit 5b22d9b with merge 2bafac082a2573db4df4917533e419e54d7e63b9...

@bors
Copy link
Contributor

bors commented Sep 30, 2018

💔 Test failed - status-travis

@rust-highfive
Copy link
Collaborator

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

Click to expand the log.
[01:49:59]   curl error: Could not resolve host: github.com
[01:49:59] ; class=Net (12)
[01:49:59] 
[01:49:59] 
[01:49:59] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "install" "-j" "4" "--locked" "--color" "always" "--force" "--debug" "--vers" "0.1.4" "cargo-vendor"
[01:49:59] 
[01:49:59] 
[01:49:59] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap dist --host x86_64-unknown-linux-gnu --target x86_64-unknown-linux-gnu
[01:49:59] Build completed unsuccessfully in 1:44:13
---
travis_time:end:07cbe524:start=1538289838920248935,finish=1538289838928305804,duration=8056869
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:00755412
$ ln -s . checkout && for CORE in obj/cores/core.*; do EXE=$(echo $CORE | sed 's|obj/cores/core\.[0-9]*\.!checkout!\(.*\)|\1|;y|!|/|'); if [ -f "$EXE" ]; then printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" "$CORE"; gdb --batch -q -c "$CORE" "$EXE" -iex 'set auto-load off' -iex 'dir src/' -iex 'set sysroot .' -ex bt -ex q; echo travis_fold":"end:crashlog; fi; done || true
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:03d11290
travis_time:start:03d11290
$ 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:2b915993
$ 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 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 30, 2018
@zackmdavis
Copy link
Member Author

@bors retry

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

bors commented Sep 30, 2018

⌛ Testing commit 5b22d9b with merge a677e4c...

bors added a commit that referenced this pull request Sep 30, 2018
…, r=nikomatsakis

don't elide lifetimes in paths in librustc/

In light of the "Apply to rustc" checkbox on #44524 and @nikomatsakis's [recent comment about regularly wanting visual indication of elided lifetimes in types](#44524 (comment)), I was curious to see what it would look like if we turned the `elided_lifetimes_in_path` lint on in at least one crate in the codebase (I chose librustc). Given that I couldn't figure out how to get `cargo fix` work with the build system, this arguably wasn't a very efficient use of my time, but once I started, the conjunction of moral law and the sunk cost fallacy forced me to continue.

This is mostly applying the `<'_>` suggestions issued by the lint, but there were a few places where I named the lifetimes (_e.g._, `<'a, 'gcx, 'tcx>` on `TyCtxt`) in order to match style with surrounding code.

r? @nikomatsakis
@bors
Copy link
Contributor

bors commented Sep 30, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants