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

Consider how to replace CARGO_MANIFEST_DIR without trailing slash #204

Open
dtolnay opened this issue Oct 26, 2022 · 1 comment
Open

Consider how to replace CARGO_MANIFEST_DIR without trailing slash #204

dtolnay opened this issue Oct 26, 2022 · 1 comment

Comments

@dtolnay
Copy link
Owner

dtolnay commented Oct 26, 2022

#202 (comment)

My macro outputs "Help: Searching in directory $CARGO_MANIFEST_DIR" when the file it was looking for doesn't exist, which by its nature, will not always be the same path. However, trybuild for some reason doesn't replace that directory with $DIR but leaves the path untouched.

@TomzBench
Copy link

TomzBench commented Sep 14, 2023

Your solution in issue #202 with CARGO_MANIFEST_OVERRIDE works well for me. One thing that is unfortunate though is that when writing tests, the rust analyzer does not detect this, so i think when it runs my macro it is not finding the file correctly, so my macro doesn't expand.

However, when i run my tests, my tests will pass. As a work around what i am doing is putting in the absolute path into my macro during development. and then after testing looks good i insert the relative path. This works ok. but do you have any other ideas for getting rust analyzer to pick up the override?

Thanks!

(Also since #202 is locked i wrote the comment here, hope thats ok)

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

No branches or pull requests

2 participants