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

single life #55432

Merged
merged 2 commits into from
Nov 4, 2018
Merged

single life #55432

merged 2 commits into from
Nov 4, 2018

Conversation

zackmdavis
Copy link
Member

@zackmdavis zackmdavis commented Oct 28, 2018

single_life

r? @nikomatsakis

It would be nice to demonstrate the shining correctness here with more
run-rustfix tests than this, but unfortunately, that doesn't work with
multipart suggestions yet (rust-lang#53934).

While we're here, reword the zero-use lifetime suggestion to "elide
the unused lifetime" instead of "remove it". (It's classier.)
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 28, 2018
Copy link
Member

@killercup killercup left a comment

Choose a reason for hiding this comment

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

Nice!

single life
opened PR half past midnight on a saturday

checks out

@zackmdavis
Copy link
Member Author

😅 💔

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.

LGTM! I had one suggestion but it's pre-existing, really


error: lifetime parameter `'b` never used
--> $DIR/zero-uses-in-fn.rs:18:17
|
LL | fn november<'a, 'b>(s: &'a str) -> (&'a str) {
| --^^
| |
| help: remove it
| help: elide the unused lifetime
Copy link
Contributor

Choose a reason for hiding this comment

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

This...looks funny, no? It seems like we'd be better off making this suggestion "out of line"?

@nikomatsakis
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Oct 29, 2018

📌 Commit faea5bb 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 Oct 29, 2018
@bors
Copy link
Contributor

bors commented Nov 4, 2018

⌛ Testing commit faea5bb with merge 9a89b6433c0e1a90228a3256fea0007c726a5b07...

@bors
Copy link
Contributor

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

The job x86_64-gnu-distcheck 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.
[02:29:01] warning: spurious network error (2 tries remaining): curl error: Could not resolve host: github.com
[02:29:01] ; class=Net (12)
[02:29:21] warning: spurious network error (1 tries remaining): curl error: Could not resolve host: github.com
[02:29:21] ; class=Net (12)
[02:29:41] error: failed to load source for a dependency on `rand`
[02:29:41] Caused by:
[02:29:41]   Unable to update registry `https://github.com/rust-lang/crates.io-index`
[02:29:41] 
[02:29:41] Caused by:
[02:29:41] Caused by:
[02:29:41]   failed to fetch `https://github.com/rust-lang/crates.io-index`
[02:29:41] 
[02:29:41] Caused by:
[02:29:41]   curl error: Could not resolve host: github.com
[02:29:41] ; class=Net (12)
[02:29:41] 
[02:29:41] 
[02:29:41] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "generate-lockfile" "--manifest-path" "/checkout/obj/build/tmp/distcheck-src/rust-src/lib/rustlib/src/rust/src/libstd/Cargo.toml"
[02:29:41] 
[02:29:41] 
[02:29:41] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test distcheck
[02:29:41] Build completed unsuccessfully in 2:26:38
---
travis_time:end:05e1b992:start=1541314526985736513,finish=1541314526993865921,duration=8129408
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:26c9542a
$ 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:00d50ecb
travis_time:start:00d50ecb
$ 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:0ccc1db6
$ 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)

@zackmdavis
Copy link
Member Author

[02:29:41] Caused by:
[02:29:41]   failed to fetch `https://github.com/rust-lang/crates.io-index`
[02:29:41] 
[02:29:41] Caused by:
[02:29:41]   curl error: Could not resolve host: github.com
[02:29:41] ; class=Net (12)

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

bors commented Nov 4, 2018

⌛ Testing commit faea5bb with merge 86b88e6...

bors added a commit that referenced this pull request Nov 4, 2018
single life

 * structured ~~autofixable~~ (well, pending #53934 and rust-lang/rustfix#141) suggestions for the single-use-lifetimes lint in the case of function and method reference args
 * don't consider the anonymous lifetime `'_` as "single-use" (it's intended for exactly this sort of thing)

![single_life](https://user-images.githubusercontent.com/1076988/47613227-3b2b6400-da48-11e8-8efd-cb975ddf537d.png)

r? @nikomatsakis
@bors
Copy link
Contributor

bors commented Nov 4, 2018

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

@bors bors merged commit faea5bb into rust-lang:master Nov 4, 2018
@zackmdavis zackmdavis deleted the single_life branch November 5, 2018 07:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants