pub fn check_for_rustc_errors_attr(tcx: TyCtxt) {
    if let Some((id, span, _)) = *tcx.sess.entry_fn.borrow() {
        let main_def_id = tcx.hir.local_def_id(id);

        if tcx.has_attr(main_def_id, "rustc_error") {
            tcx.sess.span_fatal(span, "compilation successful");
        }
    }
}
/// check for the #[rustc_error] annotation, which forces an
/// error in codegen. This is used to write compile-fail tests
/// that actually test that compilation succeeds without
/// reporting an error.
check for the #[rustc_error] annotation, which forces an
error in codegen. This is used to write compile-fail tests
that actually test that compilation succeeds without
reporting an error.
check for the # [ rustc_error ] annotation which forces an error in codegen . This is used to write compile - fail tests that actually test that compilation succeeds without reporting an error .
pub fn check_for_rustc_errors_attr(tcx: TyCtxt) {
    if let Some((id, span, _)) = *tcx.sess.entry_fn.borrow() {
        let main_def_id = tcx.hir.local_def_id(id);
        if tcx.has_attr(main_def_id, "rustc_error") {
            tcx.sess.span_fatal(span, "compilation successful");
        }
    }
}
pub fn check_for_rustc_errors_attr ( tcx : TyCtxt ) { if let Some ( ( id , span , _ ) ) = * tcx . sess . entry_fn . borrow ( ) { let main_def_id = tcx . hir . local_def_id ( id ) ; if tcx . has_attr ( main_def_id , " " ) { tcx . sess . span_fatal ( span , " " ) ; } } }
check for the #[rustc_error] annotation, which forces an
error in codegen.
check for the # [ rustc_error ] annotation which forces an error in codegen .
tcx
TyCtxt
tcx
TyCtxt