Skip to content

Commit

Permalink
Auto merge of rust-lang#119234 - aDotInTheVoid:ast-lowering-asserts, …
Browse files Browse the repository at this point in the history
…r=<try>

ast_lowering: Make some asserts in ID generation debug only.

Ran into this code, as was kinda surprised these are still here in release. These methods seem hot.

r? `@ghost`

`@bors` try `@rust-timer` queue
  • Loading branch information
bors committed Dec 26, 2023
2 parents ea7ef7b + 03be3e3 commit 970345b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion compiler/rustc_ast_lowering/src/lib.rs
Expand Up @@ -721,7 +721,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
v.insert(local_id);
self.item_local_id_counter.increment_by(1);

assert_ne!(local_id, hir::ItemLocalId::new(0));
debug_assert_ne!(local_id, hir::ItemLocalId::new(0));
if let Some(def_id) = self.opt_local_def_id(ast_node_id) {
self.children.push((def_id, hir::MaybeOwner::NonOwner(hir_id)));
}
Expand Down

0 comments on commit 970345b

Please sign in to comment.