1
Fork 0

(Mostly) revert "Account for type param from other item in note_and_explain"

This mostly reverts commit 7449478c2f.
It also removes an `opt_param_at` that really is unnecessary given our
ICE policy for malformed intrinsics.
This commit is contained in:
Michael Goulet 2024-04-19 22:59:34 -04:00
parent 5ee4db4e05
commit a25bb5f4ac
3 changed files with 45 additions and 93 deletions

View file

@ -164,9 +164,8 @@ pub fn check_intrinsic_type(
) {
let generics = tcx.generics_of(intrinsic_id);
let param = |n| {
if let Some(&ty::GenericParamDef {
name, kind: ty::GenericParamDefKind::Type { .. }, ..
}) = generics.opt_param_at(n as usize, tcx)
if let &ty::GenericParamDef { name, kind: ty::GenericParamDefKind::Type { .. }, .. } =
generics.param_at(n as usize, tcx)
{
Ty::new_param(tcx, n, name)
} else {