commit
712874ef11
4 changed files with 10 additions and 2 deletions
|
@ -50,7 +50,10 @@ pub fn find_entry_point(session: &Session, ast_map: &ast_map::Map) {
|
|||
let any_exe = session.crate_types.borrow().iter().any(|ty| {
|
||||
*ty == config::CrateTypeExecutable
|
||||
});
|
||||
if !any_exe {
|
||||
let emit_link = session.opts.output_types.iter().any(|ty| {
|
||||
*ty == config::OutputTypeExe
|
||||
});
|
||||
if !any_exe || !emit_link {
|
||||
// No need to find a main function
|
||||
return
|
||||
}
|
||||
|
|
|
@ -83,7 +83,7 @@ pub struct Options {
|
|||
pub debuginfo: DebugInfoLevel,
|
||||
pub lint_opts: Vec<(String, lint::Level)>,
|
||||
pub describe_lints: bool,
|
||||
pub output_types: Vec<OutputType> ,
|
||||
pub output_types: Vec<OutputType>,
|
||||
// This was mutable for rustpkg, which updates search paths based on the
|
||||
// parsed code. It remains mutable in case its replacements wants to use
|
||||
// this.
|
||||
|
|
5
src/test/run-make/empty-file/Makefile
Normal file
5
src/test/run-make/empty-file/Makefile
Normal file
|
@ -0,0 +1,5 @@
|
|||
-include ../tools.mk
|
||||
|
||||
all:
|
||||
$(RUSTC) --emit=asm,llvm-bc,llvm-ir,obj,dep-info empty.rs
|
||||
$(RUSTC) --emit=link --crate-type=rlib,dylib,staticlib empty.rs
|
0
src/test/run-make/empty-file/empty.rs
Normal file
0
src/test/run-make/empty-file/empty.rs
Normal file
Loading…
Add table
Add a link
Reference in a new issue