Rollup merge of #79236 - lcnr:mcg-resolve-dsb, r=eddyb
const_generics: assert resolve hack causes an error prevent the min_const_generics `HACK`s in resolve from triggering a fallback path which successfully compiles so that we don't have to worry about future compat issues when removing it r? `@eddyb` cc `@varkor`
This commit is contained in:
commit
c58c245e2c
2 changed files with 6 additions and 1 deletions
|
@ -143,7 +143,7 @@ impl<'a> Resolver<'a> {
|
||||||
_ => {
|
_ => {
|
||||||
bug!(
|
bug!(
|
||||||
"GenericParamsFromOuterFunction should only be used with Res::SelfTy, \
|
"GenericParamsFromOuterFunction should only be used with Res::SelfTy, \
|
||||||
DefKind::TyParam"
|
DefKind::TyParam or DefKind::ConstParam"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2539,6 +2539,7 @@ impl<'a> Resolver<'a> {
|
||||||
span: Span,
|
span: Span,
|
||||||
all_ribs: &[Rib<'a>],
|
all_ribs: &[Rib<'a>],
|
||||||
) -> Res {
|
) -> Res {
|
||||||
|
const CG_BUG_STR: &str = "min_const_generics resolve check didn't stop compilation";
|
||||||
debug!("validate_res_from_ribs({:?})", res);
|
debug!("validate_res_from_ribs({:?})", res);
|
||||||
let ribs = &all_ribs[rib_index + 1..];
|
let ribs = &all_ribs[rib_index + 1..];
|
||||||
|
|
||||||
|
@ -2639,6 +2640,8 @@ impl<'a> Resolver<'a> {
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
self.session.delay_span_bug(span, CG_BUG_STR);
|
||||||
return Res::Err;
|
return Res::Err;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2720,6 +2723,8 @@ impl<'a> Resolver<'a> {
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
self.session.delay_span_bug(span, CG_BUG_STR);
|
||||||
return Res::Err;
|
return Res::Err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue