-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Handle properly when there is no crate attrs #107836
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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 given The 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 given it'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