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

Fix bug generating top-level links for standard library crates (e.g. ::std). #56

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Fix bug generating top-level links for standard library crates (e.g. ::std). #56

wants to merge 3 commits into from

Conversation

orium
Copy link
Contributor

@orium orium commented Jan 28, 2021

Links to standard library crates themselves (e.g. ::std, or ::alloc) were not working.

@@ -182,6 +191,12 @@ impl fmt::Display for FQIdentifier {
}
}

impl fmt::Debug for FQIdentifier {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

If we simply derived Debug the output from unit test failures were completely unreadable.

Copy link
Owner

Choose a reason for hiding this comment

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

Do you have an example of such an output?

Copy link
Contributor Author

@orium orium Feb 14, 2021

Choose a reason for hiding this comment

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

With this implementation the output is something like crate::foo::bar. With auto derivation it is FQIdentifier { anchor: Crate, path_shared: ["foo", "bar"], path_end: 2 }. This is specially confusing when path_end does truncate the path_shared to a shorter length.

orium added 3 commits March 1, 2021 13:33
…`::std`).

Links to standard library crates themselves (e.g. `::std`, or `::alloc`) were
not working.
This was not a bug the code ever triggered.
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.

2 participants