File tree 3 files changed +10
-1
lines changed
compiler/rustc_driver_impl/src
tests/run-make/no-input-file
3 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -628,7 +628,10 @@ fn print_crate_info(
628
628
println ! ( "{}" , serde_json:: to_string_pretty( & sess. target. to_json( ) ) . unwrap( ) ) ;
629
629
}
630
630
FileNames | CrateName => {
631
- let Some ( attrs) = attrs. as_ref ( ) else { return Compilation :: Continue ; } ;
631
+ let Some ( attrs) = attrs. as_ref ( ) else {
632
+ // no crate attributes, print out an error and exit
633
+ return Compilation :: Continue ;
634
+ } ;
632
635
let t_outputs = rustc_interface:: util:: build_output_filenames ( attrs, sess) ;
633
636
let id = rustc_session:: output:: find_crate_name ( sess, attrs) ;
634
637
if * req == PrintRequest :: CrateName {
Original file line number Diff line number Diff line change
1
+ include ../../run-make-fulldeps/tools.mk
2
+
3
+ all :
4
+ $(RUSTC ) --print crate-name 2>&1 | diff - no-input-file.stderr
Original file line number Diff line number Diff line change
1
+ error: no input filename given
2
+
You can’t perform that action at this time.
0 commit comments