1
Fork 0

rustc: Move crate_types from Session to GlobalCtxt

Removes a piece of mutable state.
Follow up to #114578.
This commit is contained in:
Vadim Petrochenkov 2023-08-08 18:28:20 +08:00
parent 8838c73e86
commit 0b89aac08d
26 changed files with 108 additions and 108 deletions

View file

@ -31,7 +31,7 @@ struct EntryContext<'tcx> {
}
fn entry_fn(tcx: TyCtxt<'_>, (): ()) -> Option<(DefId, EntryFnType)> {
let any_exe = tcx.sess.crate_types().iter().any(|ty| *ty == CrateType::Executable);
let any_exe = tcx.crate_types().iter().any(|ty| *ty == CrateType::Executable);
if !any_exe {
// No need to find a main function.
return None;