Skip to content

Commit

Permalink
Always validate HIR ID for TypeckTables
Browse files Browse the repository at this point in the history
...and not only with `debug_assertions` compiled in
  • Loading branch information
Xanewok committed Sep 7, 2019
1 parent ef54f57 commit f6ae4a4
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 f6ae4a4

Please sign in to comment.