mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-19 10:24:16 +00:00
Directly encode Defaultness in metadata.
This commit is contained in:
parent
ec7f80036d
commit
42820daf91
@ -1450,7 +1450,7 @@ impl<'a, 'tcx> EncodeContext<'a, 'tcx> {
|
||||
}))
|
||||
}
|
||||
hir::ItemKind::Impl(hir::Impl { defaultness, constness, .. }) => {
|
||||
record!(self.tables.impl_defaultness[def_id] <- defaultness);
|
||||
self.tables.impl_defaultness.set(def_id.index, defaultness);
|
||||
self.tables.impl_constness.set(def_id.index, constness);
|
||||
|
||||
let trait_ref = self.tcx.impl_trait_ref(def_id);
|
||||
|
@ -312,7 +312,7 @@ define_tables! {
|
||||
impl_parent: Table<DefIndex, Lazy!(DefId)>,
|
||||
impl_polarity: Table<DefIndex, ty::ImplPolarity>,
|
||||
impl_constness: Table<DefIndex, hir::Constness>,
|
||||
impl_defaultness: Table<DefIndex, Lazy!(hir::Defaultness)>,
|
||||
impl_defaultness: Table<DefIndex, hir::Defaultness>,
|
||||
// FIXME(eddyb) perhaps compute this on the fly if cheap enough?
|
||||
coerce_unsized_info: Table<DefIndex, Lazy!(ty::adjustment::CoerceUnsizedInfo)>,
|
||||
mir_const_qualif: Table<DefIndex, Lazy!(mir::ConstQualifs)>,
|
||||
|
@ -120,6 +120,14 @@ fixed_size_enum! {
|
||||
}
|
||||
}
|
||||
|
||||
fixed_size_enum! {
|
||||
hir::Defaultness {
|
||||
( Final )
|
||||
( Default { has_value: false } )
|
||||
( Default { has_value: true } )
|
||||
}
|
||||
}
|
||||
|
||||
// NOTE(eddyb) there could be an impl for `usize`, which would enable a more
|
||||
// generic `Lazy<T>` impl, but in the general case we might not need / want to
|
||||
// fit every `usize` in `u32`.
|
||||
|
Loading…
Reference in New Issue
Block a user