1
Fork 0

Introduce OwnerNode::Crate.

This commit is contained in:
Camille GILLOT 2021-07-25 12:03:24 +02:00
parent 36a28060f1
commit fee421685d
17 changed files with 69 additions and 65 deletions

View file

@ -183,7 +183,7 @@ fn configure_main(tcx: TyCtxt<'_>, visitor: &EntryContext<'_, '_>) -> Option<(De
}
fn no_main_err(tcx: TyCtxt<'_>, visitor: &EntryContext<'_, '_>) {
let sp = tcx.hir().krate().item.inner;
let sp = tcx.hir().krate().module().inner;
if *tcx.sess.parse_sess.reached_eof.borrow() {
// There's an unclosed brace that made the parser reach `Eof`, we shouldn't complain about
// the missing `fn main()` then as it might have been hidden inside an unclosed block.