-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
cc @oli-obk @Manishearth Heads up, I believe there's a use of |
@bors r+ |
📌 Commit 069e63d68d6eef88a23e5fe29053e9e19a6acc72 has been approved by |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this 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)
src/librustc/dep_graph/graph.rs
Outdated
@@ -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()), |
There was a problem hiding this comment.
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
src/librustc/hir/map/definitions.rs
Outdated
@@ -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(), |
There was a problem hiding this comment.
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)
src/librustc/ich/hcx.rs
Outdated
@@ -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()); |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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
src/librustdoc/clean/auto_trait.rs
Outdated
@@ -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.
This comment was marked as off-topic.
Sorry, something went wrong.
src/librustdoc/clean/inline.rs
Outdated
@@ -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()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unwrap_or_default
src/librustdoc/clean/mod.rs
Outdated
@@ -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()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unwrap_or_default
src/libsyntax/codemap.rs
Outdated
@@ -145,7 +145,7 @@ impl CodeMap { | |||
CodeMap { | |||
files: Lock::new(CodeMapFiles { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lock::default()
src/libsyntax/codemap.rs
Outdated
@@ -168,7 +168,7 @@ impl CodeMap { | |||
CodeMap { | |||
files: Lock::new(CodeMapFiles { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lock::default()
☔ The latest upstream changes (presumably #52115) made this pull request unmergeable. Please resolve the merge conflicts. |
r? @oli-obk |
@bors r+ p=1 (prio due to bitrottyness) |
📌 Commit de114a7a3e2b39a8607142f11ece9e2014d3bafe has been approved by |
@bors r- eddyb is checking things |
The job Click to expand the log.
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 |
💔 Test failed - status-travis |
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.
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 |
Timeout? Could it be my fault? @bors retry |
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".
☀️ Test successful - status-appveyor, status-travis |
📣 Toolstate changed by #52591! Tested on commit 289ad6e. 💔 clippy-driver on windows: test-pass → build-fail (cc @Manishearth @llogiq @mcarton @oli-obk, @rust-lang/infra). |
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).
3441: rustup rust-lang/rust#52591 r=flip1995 a=matthiaskrgr Co-authored-by: Matthias Krüger <matthias.krueger@famsik.de>
```` rustup rust-lang#52591 remove unused allow() attributes, NFC Add regression test Don't emit suggestion when inside of a macro ````
```` 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 ````
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
@rustbot modify labels to -S-inactive-closed |
```` 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 ````
These are cruft left over from a time when
Foo::default()
didn't "just work".