Auto merge of #118605 - fee1-dead-contrib:rm-rustc_host, r=compiler-errors

Remove `#[rustc_host]`, use internal desugaring

Also removed a way for users to explicitly specify the host param since that isn't particularly useful. This should eliminate any pain with encoding attributes across crates and etc.

r? `@compiler-errors`
This commit is contained in:
bors
2023-12-06 16:00:24 +00:00
16 changed files with 56 additions and 88 deletions

View File

@@ -2122,7 +2122,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
let default = default.as_ref().map(|def| self.lower_anon_const(def));
(
hir::ParamName::Plain(self.lower_ident(param.ident)),
hir::GenericParamKind::Const { ty, default },
hir::GenericParamKind::Const { ty, default, is_host_effect: false },
)
}
}
@@ -2550,15 +2550,6 @@ impl<'hir> GenericArgsCtor<'hir> {
})
});
let attr_id = lcx.tcx.sess.parse_sess.attr_id_generator.mk_attr_id();
let attr = lcx.arena.alloc(Attribute {
kind: AttrKind::Normal(P(NormalAttr::from_ident(Ident::new(sym::rustc_host, span)))),
span,
id: attr_id,
style: AttrStyle::Outer,
});
lcx.attrs.insert(hir_id.local_id, std::slice::from_ref(attr));
let def_id = lcx.create_def(
lcx.current_hir_id_owner.def_id,
id,
@@ -2566,6 +2557,7 @@ impl<'hir> GenericArgsCtor<'hir> {
DefKind::AnonConst,
span,
);
lcx.children.push((def_id, hir::MaybeOwner::NonOwner(hir_id)));
self.args.push(hir::GenericArg::Const(hir::ConstArg {
value: hir::AnonConst { def_id, hir_id, body },