Auto merge of #115817 - fee1-dead-contrib:fix-codegen, r=oli-obk
treat host effect params as erased in codegen This fixes the changes brought to codegen tests when effect params are added to libcore, by not attempting to monomorphize functions that get the host param by being `const fn`. r? `@oli-obk`
This commit is contained in:
commit
5e71913156
17 changed files with 71 additions and 41 deletions
|
@ -459,7 +459,7 @@ fn collect_items_rec<'tcx>(
|
|||
// Check for PMEs and emit a diagnostic if one happened. To try to show relevant edges of the
|
||||
// mono item graph.
|
||||
if tcx.sess.diagnostic().err_count() > error_count
|
||||
&& starting_item.node.is_generic_fn()
|
||||
&& starting_item.node.is_generic_fn(tcx)
|
||||
&& starting_item.node.is_user_defined()
|
||||
{
|
||||
let formatted_item = with_no_trimmed_paths!(starting_item.node.to_string());
|
||||
|
@ -1315,6 +1315,7 @@ fn create_mono_items_for_default_impls<'tcx>(
|
|||
// it, to validate whether or not the impl is legal to instantiate at all.
|
||||
let only_region_params = |param: &ty::GenericParamDef, _: &_| match param.kind {
|
||||
GenericParamDefKind::Lifetime => tcx.lifetimes.re_erased.into(),
|
||||
GenericParamDefKind::Const { is_host_effect: true, .. } => tcx.consts.true_.into(),
|
||||
GenericParamDefKind::Type { .. } | GenericParamDefKind::Const { .. } => {
|
||||
unreachable!(
|
||||
"`own_requires_monomorphization` check means that \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue