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

More robust "KnownNames" resolution #27

Merged
merged 5 commits into from
Jan 2, 2025

Conversation

davidsemakula
Copy link
Contributor

@davidsemakula davidsemakula commented Jan 1, 2025

Description

Improves KnownName resolution by:

Fixes #26

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • API change with a documentation update
  • Additional test coverage
  • Code cleanup or just keeping up with the latest Rustc nightly

How Has This Been Tested?

Added a test case as described at #26 (comment)

Also ran ./validate.sh

Checklist:

  • Fork the repo and create your branch from main.
  • If you've added code that should be tested, add tests.
  • If you've changed APIs, update the documentation.
  • Ensure the test suite passes.
  • Make sure your code lints.

@davidsemakula
Copy link
Contributor Author

davidsemakula commented Jan 1, 2025

@hermanventer I left a few minor TODO comments for myself that I don't think stop this from landing, I plan to pick them up as separate PR(s) in the next few days or early next week.

"future" => known_name_for_terminal_from_ns!(
tail_segments,
DefPathData::ValueNs,
// TODO: (@davidsemakula) Was `from_generator` removed?
Copy link
Collaborator

Choose a reason for hiding this comment

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

It seems so and, in general, the Rust compiler folks are prone to renaming functions and moving functions between namespaces so the mapping provided by KnownNames continually breaks. I make time to keep the tests mostly running, but finding the time to keep KnownNames current in every respect has been difficult.

Copy link
Collaborator

Choose a reason for hiding this comment

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

It may be worthwhile to write a test case that contains, one way or another, code the generates DefIds for each of the cases in KnownNames. Fixing such a test case when the compiler churns will be much more efficient than analyzing other test cases that break in weird ways because KnownNames is invalidated by a compiler change.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it's a good idea to keep it and the TODO/comment around till we hunt down it's replacement :)

Copy link
Contributor Author

@davidsemakula davidsemakula Jan 1, 2025

Choose a reason for hiding this comment

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

It may be worthwhile to write a test case that contains, one way or another, code the generates DefIds for each of the cases in KnownNames.

Makes sense

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will work on this and ping you :)

Copy link
Collaborator

@hermanventer hermanventer left a comment

Choose a reason for hiding this comment

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

Looks good.

@hermanventer hermanventer merged commit dd70459 into endorlabs:main Jan 2, 2025
6 checks passed
@davidsemakula davidsemakula deleted the known-name-resolution branch January 2, 2025 04:03
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.

Assertion failure in checker/src/call_visitor.rs:2038
2 participants