Skip to content

Beautify doctest path #130643

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

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

Conversation

GuillaumeGomez
Copy link
Member

Fixes #130626.

r? @notriddle

@rustbot rustbot added A-run-make Area: port run-make Makefiles to rmake.rs S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Sep 20, 2024
@rustbot
Copy link
Collaborator

rustbot commented Sep 20, 2024

This PR modifies tests/run-make/. If this PR is trying to port a Makefile
run-make test to use rmake.rs, please update the
run-make port tracking issue
so we can track our progress. You can either modify the tracking issue
directly, or you can comment on the tracking issue and link this PR.

cc @jieyouxu

@notriddle
Copy link
Contributor

I'd rather not implement this in a way that only works with doctests. We can see the same problem with the regular compiler. Can't this be implemented in a way that applies everywhere?

for component in path.components().filter(|c| !matches!(c, Component::CurDir)) {
if matches!(component, Component::ParentDir) {
if beautiful_path.parent().is_none() {
return path.canonicalize().unwrap_or_else(|_| path.to_path_buf());
Copy link
Member Author

Choose a reason for hiding this comment

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

Note for myself: remove this canonicalize.

@GuillaumeGomez
Copy link
Member Author

I'd rather not implement this in a way that only works with doctests. We can see the same problem with the regular compiler. Can't this be implemented in a way that applies everywhere?

I suppose I can. I'll move my beautify_path in rustc_span directly and then we can see if the compiler team is ok with it.

@alex-semenyuk alex-semenyuk added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-run-make Area: port run-make Makefiles to rmake.rs S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

rustdoc reports diagnostics against very/../long/PATH.md instead of normalizing to PATH.md
4 participants