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

rustc: remove {FxHash,Node,DefId,HirId,ItemLocal}{Map,Set} "constructor" fns. #52591

Merged
merged 2 commits into from
Nov 21, 2018

Conversation

eddyb
Copy link
Member

@eddyb eddyb commented Jul 21, 2018

These are cruft left over from a time when Foo::default() didn't "just work".

@rust-highfive
Copy link
Collaborator

r? @petrochenkov

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 21, 2018
@eddyb
Copy link
Member Author

eddyb commented Jul 21, 2018

cc @oli-obk @Manishearth Heads up, I believe there's a use of NodeSet() in clippy.

@petrochenkov
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Jul 21, 2018

📌 Commit 069e63d68d6eef88a23e5fe29053e9e19a6acc72 has been approved by petrochenkov

@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 Jul 21, 2018
@rust-highfive

This comment has been minimized.

@rust-highfive

This comment has been minimized.

@rust-highfive

This comment has been minimized.

Copy link
Contributor

@oli-obk oli-obk left a comment

Choose a reason for hiding this comment

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

address.or_else(open_easy_issue)

@@ -100,11 +100,11 @@ impl DepGraph {
DepGraph {
data: Some(Lrc::new(DepGraphData {
previous_work_products: prev_work_products,
dep_node_debug: Lock::new(FxHashMap()),
dep_node_debug: Lock::new(FxHashMap::default()),
Copy link
Contributor

Choose a reason for hiding this comment

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

Lock::default() should probably work

@@ -386,13 +386,13 @@ impl Definitions {
index_to_key: [vec![], vec![]],
def_path_hashes: [vec![], vec![]],
},
node_to_def_index: NodeMap(),
node_to_def_index: NodeMap::default(),
Copy link
Contributor

Choose a reason for hiding this comment

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

We can replace this entire function by adding derive(Default)

@@ -370,7 +370,7 @@ impl<'a> HashStable<StableHashingContext<'a>> for Span {
// recursing every time.
thread_local! {
static CACHE: RefCell<FxHashMap<hygiene::Mark, u64>> =
RefCell::new(FxHashMap());
RefCell::new(FxHashMap::default());
Copy link
Contributor

Choose a reason for hiding this comment

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

RefCell::default()

@@ -280,8 +280,8 @@ impl<'tcx> RegionConstraintCollector<'tcx> {
RegionConstraintCollector {
Copy link
Contributor

Choose a reason for hiding this comment

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

RegionConstraintCollector::default()

@@ -466,7 +466,7 @@ pub struct LintBuffer {

impl LintBuffer {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can have a derive(Default) now

@@ -852,7 +852,7 @@ impl<'a, 'tcx, 'rcx> AutoTraitFinder<'a, 'tcx, 'rcx> {
// loop
ty_to_traits
.entry(*ty.clone())
.or_insert_with(|| FxHashSet())
.or_insert_with(|| FxHashSet::default())

This comment was marked as off-topic.

@@ -403,7 +403,7 @@ pub fn build_impl(cx: &DocContext, did: DefId, ret: &mut Vec<clean::Item>) {
.into_iter()
.map(|meth| meth.ident.to_string())
.collect()
}).unwrap_or(FxHashSet());
}).unwrap_or(FxHashSet::default());
Copy link
Contributor

Choose a reason for hiding this comment

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

unwrap_or_default

@@ -3879,7 +3879,7 @@ impl Clean<Vec<Item>> for doctree::Impl {
.into_iter()
.map(|meth| meth.ident.to_string())
.collect()
}).unwrap_or(FxHashSet());
}).unwrap_or(FxHashSet::default());
Copy link
Contributor

Choose a reason for hiding this comment

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

unwrap_or_default

@@ -145,7 +145,7 @@ impl CodeMap {
CodeMap {
files: Lock::new(CodeMapFiles {
Copy link
Contributor

Choose a reason for hiding this comment

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

Lock::default()

@@ -168,7 +168,7 @@ impl CodeMap {
CodeMap {
files: Lock::new(CodeMapFiles {
Copy link
Contributor

Choose a reason for hiding this comment

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

Lock::default()

@bors
Copy link
Contributor

bors commented Jul 21, 2018

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

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jul 21, 2018
@petrochenkov
Copy link
Contributor

r? @oli-obk

@oli-obk
Copy link
Contributor

oli-obk commented Jul 25, 2018

@bors r+ p=1 (prio due to bitrottyness)

@bors
Copy link
Contributor

bors commented Jul 25, 2018

📌 Commit de114a7a3e2b39a8607142f11ece9e2014d3bafe has been approved by oli-obk

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jul 25, 2018
@oli-obk
Copy link
Contributor

oli-obk commented Jul 25, 2018

@bors r- eddyb is checking things

@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 Jul 25, 2018
@rust-highfive
Copy link
Collaborator

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

Click to expand the log.
travis_time:end:06fd1ad5:start=1542780799808020677,finish=1542780800920154034,duration=1112133357
$ git checkout -qf FETCH_HEAD
travis_fold:end:git.checkout

Encrypted environment variables have been removed for security reasons.
See https://docs.travis-ci.com/user/pull-requests/#Pull-Requests-and-Security-Restrictions
$ export SCCACHE_BUCKET=rust-lang-ci-sccache2
$ export SCCACHE_REGION=us-west-1
Setting environment variables from .travis.yml
$ export IMAGE=x86_64-gnu-llvm-5.0

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 Nov 21, 2018

💔 Test failed - status-travis

@rust-highfive
Copy link
Collaborator

Your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
$ sudo service docker start
start: Job is already running: docker
travis_time:end:18a52a9f:start=1542782524006748123,finish=1542782524022776121,duration=16027998

No output has been received in the last 30m0s, this potentially indicates a stalled build or something wrong with the build itself.
Check the details on how to adjust your build configuration on: https://docs.travis-ci.com/user/common-build-problems/#Build-times-out-because-no-output-was-received
The build has been terminated

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 Nov 21, 2018
@eddyb
Copy link
Member Author

eddyb commented Nov 21, 2018

Timeout? Could it be my fault?

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

bors commented Nov 21, 2018

⌛ Testing commit 7683180 with merge 289ad6e...

bors added a commit that referenced this pull request Nov 21, 2018
rustc: remove {FxHash,Node,DefId,HirId,ItemLocal}{Map,Set} "constructor" fns.

These are cruft left over from a time when `Foo::default()` didn't "just work".
@bors
Copy link
Contributor

bors commented Nov 21, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: oli-obk
Pushing 289ad6e to master...

@bors bors merged commit 7683180 into rust-lang:master Nov 21, 2018
@rust-highfive
Copy link
Collaborator

📣 Toolstate changed by #52591!

Tested on commit 289ad6e.
Direct link to PR: #52591

💔 clippy-driver on windows: test-pass → build-fail (cc @Manishearth @llogiq @mcarton @oli-obk, @rust-lang/infra).
💔 clippy-driver on linux: test-pass → build-fail (cc @Manishearth @llogiq @mcarton @oli-obk, @rust-lang/infra).
💔 rls on windows: test-pass → build-fail (cc @nrc @Xanewok, @rust-lang/infra).
💔 rls on linux: test-pass → build-fail (cc @nrc @Xanewok, @rust-lang/infra).

rust-highfive added a commit to rust-lang-nursery/rust-toolstate that referenced this pull request Nov 21, 2018
Tested on commit rust-lang/rust@289ad6e.
Direct link to PR: <rust-lang/rust#52591>

💔 clippy-driver on windows: test-pass → build-fail (cc @Manishearth @llogiq @mcarton @oli-obk, @rust-lang/infra).
💔 clippy-driver on linux: test-pass → build-fail (cc @Manishearth @llogiq @mcarton @oli-obk, @rust-lang/infra).
💔 rls on windows: test-pass → build-fail (cc @nrc @Xanewok, @rust-lang/infra).
💔 rls on linux: test-pass → build-fail (cc @nrc @Xanewok, @rust-lang/infra).
@eddyb eddyb deleted the functional-snakes branch November 21, 2018 11:01
matthiaskrgr added a commit to matthiaskrgr/rust-clippy that referenced this pull request Nov 21, 2018
bors bot added a commit to rust-lang/rust-clippy that referenced this pull request Nov 21, 2018
3441: rustup rust-lang/rust#52591 r=flip1995 a=matthiaskrgr



Co-authored-by: Matthias Krüger <[email protected]>
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Nov 21, 2018
````
rustup rust-lang#52591
remove unused allow() attributes, NFC
Add regression test
Don't emit suggestion when inside of a macro
````
bors added a commit that referenced this pull request Nov 21, 2018
submodules: update clippy from f5d868c to 70ca052

````
rustup #52591
remove unused allow() attributes, NFC
Add regression test
Don't emit suggestion when inside of a macro
````

fixes clippy toolstate
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Nov 22, 2018
````
missed another one in the README
run "util/dev update_lints"
rust-lang-nursery/rust-clippy => rust-lang/rust-clippy
Address 'clippy::single-match' dogfood lint
Fix nit
Address travis CI lint failure
Update trivially_copy_pass_by_ref with Trait stderr output
issue#3318 run trivially_copy_pass_by_ref for traits
Update trivially_copy_pass_by_ref with Trait examples
Fix awkward wording
Document how to lint local Clippy changes with locally built Clippy
Enable rustup clippy to refer to the correct documentation
rustup rust-lang#52591
remove unused allow() attributes, NFC
Add regression test
Don't emit suggestion when inside of a macro
````
bors added a commit that referenced this pull request Nov 22, 2018
submodules: update clippy from f5d868c to 2f6881c

Changes:

````
missed another one in the README
run "util/dev update_lints"
rust-lang-nursery/rust-clippy => rust-lang/rust-clippy
Address 'clippy::single-match' dogfood lint
Fix nit
Address travis CI lint failure
Update trivially_copy_pass_by_ref with Trait stderr output
issue#3318 run trivially_copy_pass_by_ref for traits
Update trivially_copy_pass_by_ref with Trait examples
Fix awkward wording
Document how to lint local Clippy changes with locally built Clippy
Enable rustup clippy to refer to the correct documentation
rustup #52591
remove unused allow() attributes, NFC
Add regression test
Don't emit suggestion when inside of a macro
````

fixes clippy toolstate
@crlf0710
Copy link
Member

@rustbot modify labels to -S-inactive-closed

@rustbot rustbot removed the S-inactive Status: Inactive and waiting on the author. This is often applied to closed PRs. label Mar 29, 2020
flip1995 pushed a commit to flip1995/rust-clippy that referenced this pull request May 5, 2020
````
missed another one in the README
run "util/dev update_lints"
rust-lang-nursery/rust-clippy => rust-lang/rust-clippy
Address 'clippy::single-match' dogfood lint
Fix nit
Address travis CI lint failure
Update trivially_copy_pass_by_ref with Trait stderr output
issue#3318 run trivially_copy_pass_by_ref for traits
Update trivially_copy_pass_by_ref with Trait examples
Fix awkward wording
Document how to lint local Clippy changes with locally built Clippy
Enable rustup clippy to refer to the correct documentation
rustup rust-lang/rust#52591
remove unused allow() attributes, NFC
Add regression test
Don't emit suggestion when inside of a macro
````
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.

10 participants