-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Test Fixture ExplicitRoot + ModuleResolutionRelativePathOutsideRoot. #6435
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
Test Fixture ExplicitRoot + ModuleResolutionRelativePathOutsideRoot. #6435
Conversation
| check( | ||
| r#" | ||
| //- /main.rs | ||
| //- /a/b/c/d/e/main.rs root: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| //- /a/b/c/d/e/main.rs root: | |
| //- /a/b/c/d/e/main.rs crate:main |
I think this should do the same without introducnig code for explicit_root handling
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That worked. I'll revert the explicit root stuff.
| //- /outside.rs | ||
| mod bar; | ||
| //- /bar.rs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, shouldn't it be /outside/bar.rs? I see that the test passes, so there might be a bug in rust-analyzer?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, you're right that should be /outside/bar.rs or /outside/bar/mod.rs. I'll see if I can figure out what's happening there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Err actually I think this behavior is correct, my bad. If you declare a non-inline mod, it's located in the same parent as where it's declared. /main.rs: mod foo; -> /foo.rs
|
bors r+ I think this should pass via bors, but it might need a rebase |
Updates
module_resolution_relative_path_outside_roottest to check valid paths outside of the root, by moving the root to a subpath so that paths outside of it are possible. If this would be more appropriate as a new test, or if the original check for an invalid path should be left, I'm happy to update.