I'd like to use trybuild for a crate that's designed to run on a microcontroller target (lpc8xx-hal). As cargo run --example ... is one of the most common things we do when developing the crate, we are setting the target in .cargo/config, to save us from typing --target=thumbv6m-none-eabi every time.
The standard library is not available for that target, so the Cargo package generated by trybuild won't compile (see #60). This is fine, as we can just compile our crate for the host platform, which should work well enough for compile-fail tests (we already do this for doc tests). However, when overriding the target (e.g. cargo test --target=x86_64-unknown-linux-gnu), trybuild won't pass this on in its own Cargo invocations. I think it should.
I tried implementing this, but couldn't figure out where I can get the --target that has been passed to Cargo, before I ran out of time. I think I'll leave this for now, as I have some higher-priority tasks. But if someone can give me pointers on how I can figure out which target to use, I might give this another try.
I'd like to use trybuild for a crate that's designed to run on a microcontroller target (
lpc8xx-hal). Ascargo run --example ...is one of the most common things we do when developing the crate, we are setting the target in.cargo/config, to save us from typing--target=thumbv6m-none-eabievery time.The standard library is not available for that target, so the Cargo package generated by trybuild won't compile (see #60). This is fine, as we can just compile our crate for the host platform, which should work well enough for compile-fail tests (we already do this for doc tests). However, when overriding the target (e.g.
cargo test --target=x86_64-unknown-linux-gnu), trybuild won't pass this on in its own Cargo invocations. I think it should.I tried implementing this, but couldn't figure out where I can get the
--targetthat has been passed to Cargo, before I ran out of time. I think I'll leave this for now, as I have some higher-priority tasks. But if someone can give me pointers on how I can figure out which target to use, I might give this another try.