]> git.lizzy.rs Git - rust.git/commit
Rollup merge of #51034 - oli-obk:lowering, r=pnkfelix
authorkennytm <kennytm@gmail.com>
Sat, 26 May 2018 11:32:21 +0000 (19:32 +0800)
committerGitHub <noreply@github.com>
Sat, 26 May 2018 11:32:21 +0000 (19:32 +0800)
commite66ba0fe8b621947e076a991a9bf4bc3236cf52a
treec828f77819f8b23a5c853d83173e6fc331f73878
parentee18e926841b5104f94a1c3b22ff9016c6b14129
parent6a0806b75a6e7f98b07ef14804c6e9fbc1b7b9f4
Rollup merge of #51034 - oli-obk:lowering, r=pnkfelix

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
src/librustc/hir/lowering.rs