Handle properly when there is no crate attrs#107836
Conversation
e45e6b3 to
b940f50
Compare
|
I think we should stop compilation and report an error instead of silently continueing. The user asked for something to get printed and we just don't print anything, that seems suboptimal. You can add a test for this in |
|
The current fix return rust/compiler/rustc_driver_impl/src/lib.rs Line 263 in 8996ea9 the output is: gh-chenyukang@dev-desktop-us-2:~/rust$ rustc +dev --print crate-name
error: no input filename givenThe naming and code path seems easy to misinterpret, I will have a cleanup and add test. |
80a67bc to
2573898
Compare
|
For command line: rustc +dev -o /tmp/out
error: no input filename givenit's returned by this line, seems not relevant code logic but just works by expection 😂 rust/compiler/rustc_driver_impl/src/lib.rs Line 599 in 8996ea9 then rust/compiler/rustc_driver_impl/src/lib.rs Line 263 in 8996ea9 |
|
@bors r+ rollup Yea, that error is sufficient imo, thanks |
…iaskrgr Rollup of 6 pull requests Successful merges: - rust-lang#107789 (Avoid exposing type parameters and implementation details sourced from macro expansions) - rust-lang#107836 (Handle properly when there is no crate attrs) - rust-lang#107839 (avoid duplicating the RUSTC_LOG env var name) - rust-lang#107866 (Allow wasi-libc to initialize its environment variables lazily.) - rust-lang#107876 (create symlink only for non-windows operating systems) - rust-lang#107882 (Cleanup typos in en_US/borrowck.ftl) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Fixes #107822
r? @oli-obk