Skip to content

Conversation

@faculerena
Copy link

Applies here the fix suggested in this PR.

Original issue.

@epage
Copy link
Contributor

epage commented Nov 12, 2025

Have to double check with @Muscraft but I suspect this belongs in the rustc code calling annotate-snippets. annotate-snippets is a general library with no knowledge of import paths.

@faculerena
Copy link
Author

faculerena commented Nov 12, 2025

I'm not sure either, but I sent this PR to talk about that. I agree that the path part of the fix looks like it should be in rustc, but the issue will persist here for other strings (the prefix for origin & suggestion matches then the shared_prefix is "wrong" (not really wrong, but it does not feel right))

Edit: I mean, fixing this in rustc would mean getting a handful of things that were removed in favor of using this crate back there.

@Muscraft
Copy link
Member

I took some time to try and find a solution that didn't require adding knowledge of rust syntax and ended up finding one (#345). For good measure, I ran the fix against rust-lang/rust's testsuite, as well as a test for std::sync, and it passed. I'll open a PR updating annotate-snippets in rust-lang/rust once #345 is merged and I have released a new version.

@faculerena
Copy link
Author

Amazing man, the other fix will probably stay in rustc stable if annotate-snippets is not stabilized before 1.93, then that solution will work. Thanks!

@epage epage closed this in #345 Nov 15, 2025
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.

3 participants