Skip to content

Commit

Permalink
Add inline.
Browse files Browse the repository at this point in the history
  • Loading branch information
cjgillot committed Apr 16, 2022
1 parent 4387490 commit 8b8c12e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion compiler/rustc_middle/src/ty/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1176,7 +1176,7 @@ impl<'tcx> TyCtxt<'tcx> {
}

crate fn query_kind(self, k: DepKind) -> &'tcx DepKindStruct {
&self.query_kinds[k.index() as usize]
&self.query_kinds[k.index()]
}

/// Constructs a `TyKind::Error` type and registers a `delay_span_bug` to ensure it gets used.
Expand Down
6 changes: 4 additions & 2 deletions compiler/rustc_query_system/src/dep_graph/dep_node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,14 @@ impl DepKind {
/// We use this for most things when incr. comp. is turned off.
pub const NULL: Self = DepKind(0);

#[inline]
pub const fn new(index: u16) -> Self {
DepKind(index)
}

pub const fn index(self) -> u16 {
self.0
#[inline]
pub const fn index(self) -> usize {
self.0 as usize
}
}

Expand Down

0 comments on commit 8b8c12e

Please sign in to comment.