mirror of
https://github.com/rust-lang/rust.git
synced 2026-06-01 14:10:03 +03:00
document -Zmiri-start-fn; make its logic more clear
This commit is contained in:
@@ -76,6 +76,9 @@ MIRI_SYSROOT=~/.xargo/HOST cargo run --bin miri tests/run-pass-fullmir/vecs.rs
|
||||
Notice that you will have to re-run the last step of the preparations above when
|
||||
your toolchain changes (e.g., when you update the nightly).
|
||||
|
||||
You can also set `-Zmiri-start-fn` to make miri start evaluation with the
|
||||
`start_fn` lang item, instead of starting at the `main` function.
|
||||
|
||||
## Contributing and getting help
|
||||
|
||||
Check out the issues on this GitHub repository for some ideas. There's lots that
|
||||
|
||||
+2
-7
@@ -138,13 +138,8 @@ fn visit_impl_item(&mut self, _impl_item: &'hir hir::ImplItem) {}
|
||||
);
|
||||
} else if let Some((entry_node_id, _, _)) = *state.session.entry_fn.borrow() {
|
||||
let entry_def_id = tcx.hir.local_def_id(entry_node_id);
|
||||
let start_wrapper = tcx.lang_items().start_fn().and_then(|start_fn| {
|
||||
if use_start_fn {
|
||||
Some(start_fn)
|
||||
} else {
|
||||
None
|
||||
}
|
||||
});
|
||||
// Use start_fn lang item if it is available and we have -Zmiri-start-fn set
|
||||
let start_wrapper = if use_start_fn { tcx.lang_items().start_fn() } else { None };
|
||||
miri::eval_main(tcx, entry_def_id, start_wrapper);
|
||||
|
||||
state.session.abort_if_errors();
|
||||
|
||||
Reference in New Issue
Block a user