mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-29 02:03:53 +00:00
better error on missing #[start]
This commit is contained in:
parent
89c2596dde
commit
812f9b2620
@ -67,7 +67,7 @@ impl rustc_driver::Callbacks for MiriCompilerCalls {
|
||||
if tcx.sess.compile_status().is_err() {
|
||||
tcx.sess.fatal("miri cannot be run on programs that fail compilation");
|
||||
}
|
||||
;
|
||||
|
||||
init_late_loggers(handler, tcx);
|
||||
if !tcx.sess.crate_types().contains(&CrateType::Executable) {
|
||||
tcx.sess.fatal("miri only makes sense on bin crates");
|
||||
|
@ -365,7 +365,11 @@ pub fn create_ecx<'mir, 'tcx: 'mir>(
|
||||
|
||||
match entry_type {
|
||||
EntryFnType::Main { .. } => {
|
||||
let start_id = tcx.lang_items().start_fn().unwrap();
|
||||
let start_id = tcx.lang_items().start_fn().unwrap_or_else(|| {
|
||||
tcx.sess.fatal(
|
||||
"could not find start function. Make sure the entry point is marked with `#[start]`."
|
||||
);
|
||||
});
|
||||
let main_ret_ty = tcx.fn_sig(entry_id).no_bound_vars().unwrap().output();
|
||||
let main_ret_ty = main_ret_ty.no_bound_vars().unwrap();
|
||||
let start_instance = ty::Instance::resolve(
|
||||
|
Loading…
Reference in New Issue
Block a user