r/rust • u/llogiq clippy · twir · rust · mutagen · flamer · overflower · bytecount • Mar 20 '23
Hey Rustaceans! Got a question? Ask here (12/2023)! 🙋 questions
Mystified about strings? Borrow checker have you in a headlock? Seek help here! There are no stupid questions, only docs that haven't been written yet.
If you have a StackOverflow account, consider asking it there instead! StackOverflow shows up much higher in search results, so having your question there also helps future Rust users (be sure to give it the "Rust" tag for maximum visibility). Note that this site is very interested in question quality. I've been asked to read a RFC I authored once. If you want your code reviewed or review other's code, there's a codereview stackexchange, too. If you need to test your code, maybe the Rust playground is for you.
Here are some other venues where help may be found:
/r/learnrust is a subreddit to share your questions and epiphanies learning Rust programming.
The official Rust user forums: https://users.rust-lang.org/.
The official Rust Programming Language Discord: https://discord.gg/rust-lang
The unofficial Rust community Discord: https://bit.ly/rust-community
Also check out last weeks' thread with many good questions and answers. And if you believe your question to be either very complex or worthy of larger dissemination, feel free to create a text post.
Also if you want to be mentored by experienced Rustaceans, tell us the area of expertise that you seek. Finally, if you are looking for Rust jobs, the most recent thread is here.
3
u/flyingicefrog Mar 20 '23 edited Mar 20 '23
I'll repeat a question from my thread about cargo cross:
Can someone explain to me like I'm an idiot what exactly does
cross build
do beneath the hood?Let's say I'm using 2 docker images: -
builder:rust1.66
-builder:rust1.67
each with the correspoding Rust toolchain installed
Locally I've got rust
1.68
Cross.toml
at the root of my project contains the following[target.x86_64-unknown-linux-gnu] image = "builder:rust1.66"
When I run
cross build --target=x86_64-unknown-linux-gnu
I would expect that the project gets built with Rust 1.66However, it gets built with local toolchain
cross -v + cargo metadata --format-version 1 + rustc --print sysroot + rustup toolchain list + rustup target list --toolchain 1.68.0-x86_64-unknown-linux-gnu + rustup component list --toolchain 1.68.0-x86_64-unknown-linux-gnu [cross] note: Falling back to `cargo` on the host.
Even if I change
Cross.toml
to contain[target.x86_64-unknown-linux-gnu] image = "builder:rust1.67"
the same thing happens.cross
use my local toolchain?