Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
add const_fn feature
  • Loading branch information
nikomatsakis committed Sep 7, 2018
commit ab43c1e9a43d5c62e0e6ea7442221a2d2f638f7f
6 changes: 3 additions & 3 deletions src/librustc_data_structures/indexed_vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ macro_rules! newtype_index {
];

unsafe {
$type::from_u32_unchecked(value)
$type { private: value }
}
}

Expand All @@ -153,13 +153,13 @@ macro_rules! newtype_index {

/// Extract value of this index as a usize.
#[inline]
$v const fn as_u32(self) -> u32 {
$v fn as_u32(self) -> u32 {
self.private
}

/// Extract value of this index as a u32.
#[inline]
$v const fn as_usize(self) -> usize {
$v fn as_usize(self) -> usize {
self.as_u32() as usize
}
}
Expand Down
1 change: 1 addition & 0 deletions src/librustc_mir/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Rust MIR: a lowered representation of Rust. Also: an experiment!
#![feature(box_syntax)]
#![feature(crate_visibility_modifier)]
#![feature(core_intrinsics)]
#![feature(const_fn)]
#![feature(decl_macro)]
#![cfg_attr(stage0, feature(macro_vis_matcher))]
#![feature(exhaustive_patterns)]
Expand Down