mirror of
https://github.com/rust-lang/rust.git
synced 2026-06-01 05:57:03 +03:00
Rename from_u32_const -> from_u32
This commit is contained in:
@@ -346,7 +346,7 @@ fn find_entry(&self, id: HirId) -> Option<Entry<'hir>> {
|
||||
}
|
||||
|
||||
fn get_entry(&self, id: HirId) -> Entry<'hir> {
|
||||
if id.local_id == ItemLocalId::from_u32_const(0) {
|
||||
if id.local_id == ItemLocalId::from_u32(0) {
|
||||
let owner = self.tcx.hir_owner(id.owner_def_id());
|
||||
Entry { parent: owner.parent, node: owner.node }
|
||||
} else {
|
||||
|
||||
@@ -1697,7 +1697,7 @@ pub struct UniverseIndex {
|
||||
}
|
||||
|
||||
impl UniverseIndex {
|
||||
pub const ROOT: UniverseIndex = UniverseIndex::from_u32_const(0);
|
||||
pub const ROOT: UniverseIndex = UniverseIndex::from_u32(0);
|
||||
|
||||
/// Returns the "next" universe index in order -- this new index
|
||||
/// is considered to extend all previous universes. This
|
||||
|
||||
@@ -12,7 +12,7 @@ pub struct NodeId {
|
||||
rustc_data_structures::define_id_collections!(NodeMap, NodeSet, NodeId);
|
||||
|
||||
/// `NodeId` used to represent the root of the crate.
|
||||
pub const CRATE_NODE_ID: NodeId = NodeId::from_u32_const(0);
|
||||
pub const CRATE_NODE_ID: NodeId = NodeId::from_u32(0);
|
||||
|
||||
/// When parsing and doing expansions, we initially give all AST nodes this AST
|
||||
/// node value. Then later, in the renumber pass, we renumber them to have
|
||||
|
||||
@@ -71,7 +71,7 @@ pub struct ItemLocalId { .. }
|
||||
|
||||
/// The `HirId` corresponding to `CRATE_NODE_ID` and `CRATE_DEF_INDEX`.
|
||||
pub const CRATE_HIR_ID: HirId =
|
||||
HirId { owner: CRATE_DEF_INDEX, local_id: ItemLocalId::from_u32_const(0) };
|
||||
HirId { owner: CRATE_DEF_INDEX, local_id: ItemLocalId::from_u32(0) };
|
||||
|
||||
pub const DUMMY_HIR_ID: HirId = HirId { owner: CRATE_DEF_INDEX, local_id: DUMMY_ITEM_LOCAL_ID };
|
||||
|
||||
|
||||
@@ -482,7 +482,7 @@ fn decode<D: ::rustc_serialize::Decoder>(d: &mut D) -> Result<Self, D::Error> {
|
||||
const $name:ident = $constant:expr,
|
||||
$($tokens:tt)*) => (
|
||||
$(#[doc = $doc])*
|
||||
$v const $name: $type = $type::from_u32_const($constant);
|
||||
$v const $name: $type = $type::from_u32($constant);
|
||||
$crate::newtype_index!(
|
||||
@derives [$($derives,)*]
|
||||
@attrs [$(#[$attrs])*]
|
||||
|
||||
@@ -25,7 +25,7 @@ pub enum CrateNum {
|
||||
|
||||
/// Item definitions in the currently-compiled crate would have the `CrateNum`
|
||||
/// `LOCAL_CRATE` in their `DefId`.
|
||||
pub const LOCAL_CRATE: CrateNum = CrateNum::Index(CrateId::from_u32_const(0));
|
||||
pub const LOCAL_CRATE: CrateNum = CrateNum::Index(CrateId::from_u32(0));
|
||||
|
||||
impl Idx for CrateNum {
|
||||
#[inline]
|
||||
|
||||
@@ -997,7 +997,7 @@ pub struct SymbolIndex { .. }
|
||||
|
||||
impl Symbol {
|
||||
const fn new(n: u32) -> Self {
|
||||
Symbol(SymbolIndex::from_u32_const(n))
|
||||
Symbol(SymbolIndex::from_u32(n))
|
||||
}
|
||||
|
||||
/// Maps a string to its interned representation.
|
||||
|
||||
Reference in New Issue
Block a user