Auto merge of #86857 - fee1-dead:add-attr, r=oli-obk
Add #[default_method_body_is_const] `@rustbot` label F-const_trait_impl
This commit is contained in:
commit
394804bb23
19 changed files with 265 additions and 34 deletions
|
@ -952,6 +952,10 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
|
|||
self.get_impl_data(id).defaultness
|
||||
}
|
||||
|
||||
fn get_impl_constness(&self, id: DefIndex) -> hir::Constness {
|
||||
self.get_impl_data(id).constness
|
||||
}
|
||||
|
||||
fn get_coerce_unsized_info(&self, id: DefIndex) -> Option<ty::adjustment::CoerceUnsizedInfo> {
|
||||
self.get_impl_data(id).coerce_unsized_info
|
||||
}
|
||||
|
|
|
@ -168,6 +168,7 @@ provide! { <'tcx> tcx, def_id, other, cdata,
|
|||
is_no_builtins => { cdata.root.no_builtins }
|
||||
symbol_mangling_version => { cdata.root.symbol_mangling_version }
|
||||
impl_defaultness => { cdata.get_impl_defaultness(def_id.index) }
|
||||
impl_constness => { cdata.get_impl_constness(def_id.index) }
|
||||
reachable_non_generics => {
|
||||
let reachable_non_generics = tcx
|
||||
.exported_symbols(cdata.cnum)
|
||||
|
|
|
@ -1412,7 +1412,7 @@ impl EncodeContext<'a, 'tcx> {
|
|||
adt_def.repr,
|
||||
)
|
||||
}
|
||||
hir::ItemKind::Impl(hir::Impl { defaultness, .. }) => {
|
||||
hir::ItemKind::Impl(hir::Impl { defaultness, constness, .. }) => {
|
||||
let trait_ref = self.tcx.impl_trait_ref(def_id);
|
||||
let polarity = self.tcx.impl_polarity(def_id);
|
||||
let parent = if let Some(trait_ref) = trait_ref {
|
||||
|
@ -1437,8 +1437,13 @@ impl EncodeContext<'a, 'tcx> {
|
|||
}
|
||||
});
|
||||
|
||||
let data =
|
||||
ImplData { polarity, defaultness, parent_impl: parent, coerce_unsized_info };
|
||||
let data = ImplData {
|
||||
polarity,
|
||||
defaultness,
|
||||
constness,
|
||||
parent_impl: parent,
|
||||
coerce_unsized_info,
|
||||
};
|
||||
|
||||
EntryKind::Impl(self.lazy(data))
|
||||
}
|
||||
|
|
|
@ -390,6 +390,7 @@ struct TraitData {
|
|||
#[derive(TyEncodable, TyDecodable)]
|
||||
struct ImplData {
|
||||
polarity: ty::ImplPolarity,
|
||||
constness: hir::Constness,
|
||||
defaultness: hir::Defaultness,
|
||||
parent_impl: Option<DefId>,
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue