-
Notifications
You must be signed in to change notification settings - Fork 33
Running cargo rerast in workspaces fails #39
Comments
#33 might be relevant. It looks, based on the nightly version that you're using that you're on a very old version of rerast. That's possibly to avoid the bug mentioned in #30, but that bug has been fixed. If possible, perhaps try updating to the latest nightly and rerast. Rerast v0.1.77 was released yesterday which should work with nightly-2019-12-01 (and probably later). |
Hi,
|
When looking for the workspace root, the match: ```rust if let JsonValue::String(s) = &metadata()?["workspace_root"] ``` was not succeding as the value was actually `JsonValue::Short(...)`, an alternative string representation. Switch to calling `JsonValue`'s `as_str()` method and matching on the result, which should work in both cases.
I found the problem - it wasn't working when the One related question - the path to the rules file has to be relative to the workspace root rather than current directory, since it |
When looking for the workspace root, the match: ```rust if let JsonValue::String(s) = &metadata()?["workspace_root"] ``` was not succeding as the value was actually `JsonValue::Short(...)`, an alternative string representation. Switch to calling `JsonValue`'s `as_str()` method and matching on the result, which should work in both cases.
Thanks fo the fix! Just noticed your question. I don't think that was intentional. You're right that the current directory would make more sense. Feel free to send a PR to fix it if you like. |
Sure - submitted. |
I was trying to replace
r#try!(...)
with...?
in a project which happens to be inside a workspace.I've put an example here:
https://github.com/jugglerchris/temp_rerast_workspace_bug
Running
cargo +nightly-2019-05-13 rerast --rules_file=rtry.rs --diff
from insidecrates/rerast_test
inside that repo just outputs:If I rename the
Cargo.toml
in the workspace root toCargo.toml_
, then it works.The text was updated successfully, but these errors were encountered: