siderophile icon indicating copy to clipboard operation
siderophile copied to clipboard

Incorrect module paths for files not in an crate/src/ directory

Open rozbb opened this issue 6 years ago • 0 comments

siderophile naively looks for "src" occurring in the current Rust file path, and will sometimes overshoot the actual crate root. This sometimes gives output like

unsafe expr in function log::github::log_0::tests::filters::set_boxed_logger

since filters.rs presumably occurs in the tests/ directory of the log crate.

A neat fix would be to give a relative path to ast_walker::find_unsafe_in_file instead of an absolute path.

rozbb avatar May 21 '19 22:05 rozbb