Skip to content

Commit 0239ca6

Browse files
celinvaltedinski
authored andcommitted
Remove is_rmc check from monomorphizer (rust-lang#485) (rust-lang#524)
We have changed rmc to always compile the target crate as a library. This allow us to treat any extern / public function to be used as the starting point of a proof. Furthermore, it allow us to remove the is_rmc check that we were using to skip the rust start function generation. The start function is only generated when we are compiling a bin crate.
1 parent 1817659 commit 0239ca6

File tree

1 file changed

+1
-14
lines changed

1 file changed

+1
-14
lines changed

compiler/rustc_monomorphize/src/collector.rs

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -319,11 +319,6 @@ pub fn collect_crate_mono_items(
319319
}
320320

321321
// Temporary function that allow us to skip monomorphizing lang_start.
322-
fn is_rmc(tcx: TyCtxt<'_>) -> bool {
323-
const RMC_STR: &'static str = "rmc";
324-
tcx.sess.parse_sess.config.iter().any(|(s, _)| s == &Symbol::intern(RMC_STR))
325-
}
326-
327322
// Find all non-generic items by walking the HIR. These items serve as roots to
328323
// start monomorphizing from.
329324
fn collect_roots(tcx: TyCtxt<'_>, mode: MonoItemCollectionMode) -> Vec<MonoItem<'_>> {
@@ -339,15 +334,7 @@ fn collect_roots(tcx: TyCtxt<'_>, mode: MonoItemCollectionMode) -> Vec<MonoItem<
339334

340335
tcx.hir().krate().visit_all_item_likes(&mut visitor);
341336

342-
// When building an executable that starts from a main function, the monomorphizer will
343-
// generate a function that wraps main and initializes rust "runtime" as well as handle
344-
// the executable error code based on main's return value.
345-
//
346-
// For RMC, we don't need the start function, and we also can't handle it. Thus, skip
347-
// this for now.
348-
if !is_rmc(tcx) {
349-
visitor.push_extra_entry_roots();
350-
}
337+
visitor.push_extra_entry_roots();
351338
}
352339

353340
// We can only codegen items that are instantiable - items all of

0 commit comments

Comments
 (0)