We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 20e843f commit e325ad2Copy full SHA for e325ad2
src/eval.rs
@@ -62,9 +62,8 @@ pub fn create_ecx<'mir, 'tcx: 'mir>(
62
// Setup first stack-frame
63
let main_instance = ty::Instance::mono(tcx, main_id);
64
let main_mir = ecx.load_mir(main_instance.def, None)?;
65
-
66
- if !main_mir.return_ty().is_unit() || main_mir.arg_count != 0 {
67
- throw_unsup_format!("miri does not support main functions without `fn()` type signatures");
+ if main_mir.arg_count != 0 {
+ bug!("main function must not take any arguments");
68
}
69
70
let start_id = tcx.lang_items().start_fn().unwrap();
tests/run-pass/main_result.rs
@@ -0,0 +1,3 @@
1
+fn main() -> Result<(), Box<dyn std::error::Error>> {
2
+ Ok(())
3
+}
0 commit comments