-
Notifications
You must be signed in to change notification settings - Fork 13.8k
Remove track_errors
from check_match
, typeck_item_bodies
and register_plugins
#59199
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
d1808aa
936dec8
c89872c
afdc38d
5723632
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,6 @@ use rustc::ty::layout::{self, LayoutOf, VariantIdx}; | |
use rustc::ty::subst::Subst; | ||
use rustc::traits::Reveal; | ||
use rustc_data_structures::fx::FxHashMap; | ||
use rustc::util::common::ErrorReported; | ||
|
||
use syntax::ast::Mutability; | ||
use syntax::source_map::{Span, DUMMY_SP}; | ||
|
@@ -619,9 +618,8 @@ pub fn const_eval_raw_provider<'a, 'tcx>( | |
let tables = tcx.typeck_tables_of(def_id); | ||
|
||
// Do match-check before building MIR | ||
if let Err(ErrorReported) = tcx.check_match(def_id) { | ||
return Err(ErrorHandled::Reported) | ||
} | ||
// FIXME(#59378) check_match may have errored but we're not checking for that anymore | ||
tcx.check_match(def_id); | ||
|
||
|
||
if let hir::BodyOwnerKind::Const = tcx.hir().body_owner_kind_by_hir_id(id) { | ||
tcx.mir_const_qualif(def_id); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,6 @@ use rustc::ty::{self, Ty, TyCtxt, TyKind}; | |
use rustc::ty::subst::{InternalSubsts, SubstsRef}; | ||
use rustc::lint; | ||
use rustc_errors::{Applicability, DiagnosticBuilder}; | ||
use rustc::util::common::ErrorReported; | ||
|
||
use rustc::hir::def::*; | ||
use rustc::hir::def_id::DefId; | ||
|
@@ -27,25 +26,20 @@ use std::slice; | |
use syntax::ptr::P; | ||
use syntax_pos::{Span, DUMMY_SP, MultiSpan}; | ||
|
||
pub(crate) fn check_match<'a, 'tcx>( | ||
tcx: TyCtxt<'a, 'tcx, 'tcx>, | ||
def_id: DefId, | ||
) -> Result<(), ErrorReported> { | ||
pub(crate) fn check_match<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, def_id: DefId) { | ||
let body_id = if let Some(id) = tcx.hir().as_local_hir_id(def_id) { | ||
tcx.hir().body_owned_by(id) | ||
} else { | ||
return Ok(()); | ||
return; | ||
|
||
}; | ||
|
||
tcx.sess.track_errors(|| { | ||
MatchVisitor { | ||
tcx, | ||
tables: tcx.body_tables(body_id), | ||
region_scope_tree: &tcx.region_scope_tree(def_id), | ||
param_env: tcx.param_env(def_id), | ||
identity_substs: InternalSubsts::identity_for_item(tcx, def_id), | ||
}.visit_body(tcx.hir().body(body_id)); | ||
}) | ||
MatchVisitor { | ||
tcx, | ||
tables: tcx.body_tables(body_id), | ||
region_scope_tree: &tcx.region_scope_tree(def_id), | ||
param_env: tcx.param_env(def_id), | ||
identity_substs: InternalSubsts::identity_for_item(tcx, def_id), | ||
}.visit_body(tcx.hir().body(body_id)); | ||
} | ||
|
||
fn create_e0004<'a>(sess: &'a Session, sp: Span, error_message: String) -> DiagnosticBuilder<'a> { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
fn foo<T>() where for<'a> T: 'a {} | ||
|
||
fn main<'a>() { | ||
fn bar<'a>() { | ||
foo::<&'a i32>(); | ||
//~^ ERROR the type `&'a i32` does not fulfill the required lifetime | ||
} | ||
|
||
fn main() { | ||
bar(); | ||
} |
Uh oh!
There was an error while loading. Please reload this page.