https://pantsbuild.org/ logo
e

early-needle-54791

07/10/2019, 5:10 PM
@witty-crayon-22786 here is a minimal diff demonstrating the problem. the errors look like
Copy code
error[E0308]: mismatched types
    --> process_execution/src/remote.rs:1713:37
     |
1713 |         super::make_execute_request(&execute_request, &None, &None, BTreeMap::new())
     |                                     ^^^^^^^^^^^^^^^^ expected struct `ExecuteProcessRequest`, found struct `process_execution::ExecuteProcessRequest`
     |
     = note: expected type `&ExecuteProcessRequest`
                found type `&process_execution::ExecuteProcessRequest`
it seems like the struct gets a new identity when it is used for a different crate (though this makes no sense to me)
w

witty-crayon-22786

07/10/2019, 5:21 PM
-
@average-vr-56795: ^ puzzler
the stackoverflow answer isn't... super useful
oooh, nevermind. that's not related
a

average-vr-56795

07/10/2019, 5:35 PM
I applied the diff and didn’t repro
Can you push a branch?
Oh wait!
I do repro!
My guess is it’s because there’s on some level a circular dependency? I need to run, but I’ll have a play tomorrow… In the mean time, avoiding the circular dep will probably get you unblocked
w

witty-crayon-22786

07/10/2019, 5:45 PM
the test crate of the crate shouldn't have the circular dep? but yea, possibly. maybe it's not actually treated as a separate crate.
thanks... not a blocker for now.
@early-needle-54791: via Daniel: https://github.com/rust-lang/cargo/issues/6765
(haven't read it yet: still fine with duping the method with a TODO)
e

early-needle-54791

07/10/2019, 10:45 PM
Interesting. Thanks. I have just duplicated the function for now.
another option would be a local testutil module in the process_execution crate
a

average-vr-56795

07/11/2019, 9:27 AM
Is the problem that you’re trying to re-use the function from a different crate, or that you’re trying to re-use the function from a different module?