Skip to content

Conversation

oli-obk
Copy link
Contributor

@oli-obk oli-obk commented May 24, 2018

r? @nikomatsakis

So while trying to understand lowering better, I found out that there's something related to creating definitions. Analyzing that further, I realized that it is entirely dead code.

The parent_def field was only ever used for setting and resetting the field itself. The field was never read anywhere else and thus its value was entirely unused.

Maybe the unused_field lint should detect when the only use of a field is the field being read without using the read value other than writing back to the field?

The diff is best viewed without whitespace changes getting in the way: https://github.com/rust-lang/rust/pull/51034/files?w=1

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 24, 2018
@pnkfelix
Copy link
Contributor

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented May 25, 2018

📌 Commit 6a0806b has been approved by pnkfelix

@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 May 25, 2018
kennytm added a commit to kennytm/rust that referenced this pull request May 26, 2018
Remove unused lowering field and method

r? @nikomatsakis

So while trying to understand lowering better, I found out that there's something related to creating definitions. Analyzing that further, I realized that it is entirely dead code.

The `parent_def` field was only ever used for setting and resetting the field itself. The field was never read anywhere else and thus its value was entirely unused.

Maybe the `unused_field` lint should detect when the only use of a field is the field being read without using the read value other than writing back to the field?

The diff is best viewed without whitespace changes getting in the way: https://github.com/rust-lang/rust/pull/51034/files?w=1
bors added a commit that referenced this pull request May 26, 2018
Rollup of 11 pull requests

Successful merges:

 - #50987 (Underline multiple suggested replacements in the same line)
 - #51014 (Add documentation about env! second argument)
 - #51034 (Remove unused lowering field and method)
 - #51047 (Use AllFacts from polonius-engine)
 - #51048 (Add more missing examples for Formatter)
 - #51056 (Mention and use `Once::new` instead of `ONCE_INIT`)
 - #51059 (What does an expression look like, that consists only of special characters?)
 - #51065 (Update nomicon link in transmute docs)
 - #51067 (Add inner links in documentation)
 - #51070 (Fail typecheck if we encounter a bogus break)
 - #51073 (Rename TokenStream::empty to TokenStream::new)

Failed merges:
@bors bors merged commit 6a0806b into rust-lang:master May 26, 2018
@oli-obk oli-obk deleted the lowering branch June 15, 2020 15:27
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