7 ms·
Would it still work correctly when invoking rustc on its own or from another tool? I've seen a couple of people on IRC asking about driving rustc from a non-Car
by dikaiosune 10y ago
Would it still work correctly when invoking rustc on its own or from another tool? I've seen a couple of people on IRC asking about driving rustc from a non-Cargo tool.
- steveklabnik 10y agorustc already requires passing an --extern flag for each 'extern crate' in the source, so in some sense, yes. You'd be passing that stuff along. You already have to know where those deps are on disk; the difference is that you wouldn't have a list of which deps in the source code. But if you did, it would work.
- qwertyuiop924 10y agoAh. I was working under the assumption that extern crate acted as that, but file-embedded. If rust already needs --extern, I have no objections.
- gpm 10y ago> rustc already requires passing an --extern flag for each 'extern crate' in the source Only if it can't find the crate otherwise. Generally it just searches your library path and any directories you specify with -L, e.g. most cargo executables can be recompiled (the first compilation via cargo used to compile the dependencies) via `rustc src/main.rs -L target/debug/deps`
- steveklabnik 10y agoAh thanks; Cargo always passes the flag for each, I guess it's just being extra-explicit. (And that doesn't change the main point, which is that you could still be explicit about what deps you're including)