Skip to content

Commit b5018de

Browse files
nikomatsakiscsmoe
andcommitted
make shifted_in and shifted_out const fns
Co-authored-by: csmoe <[email protected]>
1 parent 9c5a450 commit b5018de

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/librustc/ty/sty.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1277,7 +1277,7 @@ impl DebruijnIndex {
12771277
///
12781278
/// you would need to shift the index for `'a` into 1 new binder.
12791279
#[must_use]
1280-
pub fn shifted_in(self, amount: u32) -> DebruijnIndex {
1280+
pub const fn shifted_in(self, amount: u32) -> DebruijnIndex {
12811281
DebruijnIndex { depth: self.depth + amount }
12821282
}
12831283

@@ -1290,7 +1290,7 @@ impl DebruijnIndex {
12901290
/// Returns the resulting index when this value is moved out from
12911291
/// `amount` number of new binders.
12921292
#[must_use]
1293-
pub fn shifted_out(self, amount: u32) -> DebruijnIndex {
1293+
pub const fn shifted_out(self, amount: u32) -> DebruijnIndex {
12941294
DebruijnIndex { depth: self.depth - amount }
12951295
}
12961296

0 commit comments

Comments
 (0)