Skip to content

Commit

Permalink
Auto merge of #64262 - Xanewok:always-validate-hir-id-for-typeck-tabl…
Browse files Browse the repository at this point in the history
…es, r=<try>

[DONT MERGE] Always validate HIR ID for TypeckTables

...and not only with `debug_assertions` compiled in - #64250 (comment).

cc @Mark-Simulacrum @michaelwoerister

Let's do a try run to see if this impacts perf anyhow?

r? @ghost
  • Loading branch information
bors committed Sep 7, 2019
2 parents ef54f57 + f6ae4a4 commit 1c025bb
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/librustc/ty/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ pub struct LocalTableInContext<'a, V> {
fn validate_hir_id_for_typeck_tables(local_id_root: Option<DefId>,
hir_id: hir::HirId,
mut_access: bool) {
if cfg!(debug_assertions) {
// if cfg!(debug_assertions) {
if let Some(local_id_root) = local_id_root {
if hir_id.owner != local_id_root.index {
ty::tls::with(|tcx| {
Expand All @@ -228,7 +228,7 @@ fn validate_hir_id_for_typeck_tables(local_id_root: Option<DefId>,
bug!("access to invalid TypeckTables")
}
}
}
// }
}

impl<'a, V> LocalTableInContext<'a, V> {
Expand Down
2 changes: 1 addition & 1 deletion src/tools/clippy

0 comments on commit 1c025bb

Please sign in to comment.