Skip to content

Commit

Permalink
Rollup merge of #83804 - detrumi:build-type-ir-on-stable, r=petrochenkov
Browse files Browse the repository at this point in the history
Remove nightly features in rustc_type_ir

`rustc_type_ir` will be used as a type library by Chalk, which we want to be able to build on stable, so this PR removes the current nightly features used.
  • Loading branch information
JohnTitor committed Apr 3, 2021
2 parents d0266e3 + 3ea7c90 commit d636b0a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
6 changes: 4 additions & 2 deletions compiler/rustc_index/src/vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,15 +124,17 @@ macro_rules! newtype_index {

#[inline]
$v const fn from_usize(value: usize) -> Self {
assert!(value <= ($max as usize));
// FIXME: replace with `assert!(value <= ($max as usize));` once `const_panic` is stable
[()][(value > ($max as usize)) as usize];
unsafe {
Self::from_u32_unchecked(value as u32)
}
}

#[inline]
$v const fn from_u32(value: u32) -> Self {
assert!(value <= $max);
// FIXME: replace with `assert!(value <= $max);` once `const_panic` is stable
[()][(value > $max) as usize];
unsafe {
Self::from_u32_unchecked(value)
}
Expand Down
4 changes: 0 additions & 4 deletions compiler/rustc_type_ir/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
#![feature(never_type)]
#![feature(const_panic)]
#![feature(control_flow_enum)]

#[macro_use]
extern crate bitflags;
#[macro_use]
Expand Down

0 comments on commit d636b0a

Please sign in to comment.