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

Remove lowering cruft from ingot/module items #727

Merged
merged 2 commits into from
Jun 1, 2022

Conversation

sbillig
Copy link
Collaborator

@sbillig sbillig commented May 31, 2022

What was wrong?

Closes #720 (I think; @Y-Nak, are you aware of any other leftorovers?)

The only functional change is that db.set_ingot_modules has been replaced with db.set_ingot_files. The former was a compromise to work with lowered modules. Now the latter will be used by the (imaginary) language server to update the list of files in a project.

How was it fixed?

🧠

To-Do

  • OPTIONAL: Update Spec if applicable

  • Add entry to the release notes (may forgo for trivial changes)

  • Clean up commit history

@sbillig sbillig requested a review from Y-Nak May 31, 2022 05:05
@codecov-commenter
Copy link

codecov-commenter commented May 31, 2022

Codecov Report

Merging #727 (dd79c53) into master (43b58a8) will increase coverage by 0.27%.
The diff coverage is 96.66%.

@@            Coverage Diff             @@
##           master     #727      +/-   ##
==========================================
+ Coverage   81.92%   82.19%   +0.27%     
==========================================
  Files         105      105              
  Lines       11822    11780      -42     
==========================================
- Hits         9685     9683       -2     
+ Misses       2137     2097      -40     
Impacted Files Coverage Δ
crates/analyzer/src/context.rs 61.66% <ø> (ø)
crates/analyzer/src/db.rs 100.00% <ø> (ø)
crates/analyzer/src/db/queries/functions.rs 61.53% <0.00%> (ø)
crates/analyzer/src/db/queries/module.rs 77.69% <ø> (+0.57%) ⬆️
crates/analyzer/src/errors.rs 79.59% <ø> (ø)
crates/analyzer/src/namespace/scopes.rs 79.41% <ø> (+0.27%) ⬆️
crates/analyzer/src/namespace/types.rs 61.36% <ø> (+2.84%) ⬆️
crates/analyzer/src/traversal/declarations.rs 92.30% <ø> (-0.29%) ⬇️
crates/common/src/files.rs 91.30% <ø> (ø)
crates/parser/src/ast.rs 78.65% <ø> (+0.72%) ⬆️
... and 5 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 43b58a8...dd79c53. Read the comment docs.

Copy link
Member

@Y-Nak Y-Nak left a comment

Choose a reason for hiding this comment

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

Seems nice!

In addition to the changes that you've made, we could remove

pub var_decl_types: IndexMap<NodeId, Type>,
and
pub fn add_declaration(&self, node: &Node<ast::TypeDesc>, typ: Type) {

var_decl_types are referred by fe-lowering, but it's no longer used. Also it wrongly stores type annotation spans as its key, instead of variables spans.
So I think it'd be better to remove them in favor of

pub var_types: IndexMap<NodeId, Type>,

Of course, it's completely fine if you merge this PR as is.
I like mindless work and I'll do it after mering the PR 😄

@sbillig
Copy link
Collaborator Author

sbillig commented May 31, 2022

var_decl_types are referred by fe-lowering, but it's no longer used.

Gone! I also removed some other dead code, as revealed by https://github.com/est31/warnalyzer

Copy link
Member

@Y-Nak Y-Nak left a comment

Choose a reason for hiding this comment

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

👍
Left one nit.

crates/analyzer/tests/analysis.rs Show resolved Hide resolved
@Y-Nak Y-Nak mentioned this pull request Jun 1, 2022
7 tasks
@sbillig sbillig force-pushed the lowering-cruft branch 2 times, most recently from fc3fc3c to 2a839b5 Compare June 1, 2022 15:31
@sbillig sbillig merged commit 5dc66d5 into ethereum:master Jun 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cleanup leftover of old lowering crate
3 participants