Skip to content

Commit 8b8c12e

Browse files
committed
Add inline.
1 parent 4387490 commit 8b8c12e

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

compiler/rustc_middle/src/ty/context.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1176,7 +1176,7 @@ impl<'tcx> TyCtxt<'tcx> {
11761176
}
11771177

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

11821182
/// Constructs a `TyKind::Error` type and registers a `delay_span_bug` to ensure it gets used.

compiler/rustc_query_system/src/dep_graph/dep_node.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,14 @@ impl DepKind {
5858
/// We use this for most things when incr. comp. is turned off.
5959
pub const NULL: Self = DepKind(0);
6060

61+
#[inline]
6162
pub const fn new(index: u16) -> Self {
6263
DepKind(index)
6364
}
6465

65-
pub const fn index(self) -> u16 {
66-
self.0
66+
#[inline]
67+
pub const fn index(self) -> usize {
68+
self.0 as usize
6769
}
6870
}
6971

0 commit comments

Comments
 (0)