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:
Jonas Schievink 2020-11-23 15:25:42 +01:00 committed by GitHub
commit c58c245e2c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View file

@ -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"
); );
} }
} }

View file

@ -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;
} }