1
Fork 0

Rollup merge of #85800 - BoxyUwU:const-param-default-diagnostics, r=oli-obk

Fix some diagnostic issues with const_generics_defaults feature gate

This PR makes a few changes:
- print out const param defaults in "lifetime ordering" errors rather than discarding them
- update `is_simple_text` to account for const params when checking if a type has no generics, this was causing a note to be failed to add to an error message
- fixes some diagnostic wording that incorrectly said there was ordering restrictions between type/const params despite the `const_generics_defaults` feature gate is active
This commit is contained in:
Yuki Okushi 2021-06-12 01:15:56 +09:00 committed by GitHub
commit 3b47d337e0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 47 additions and 16 deletions

View file

@ -54,7 +54,7 @@ impl<'tcx> TyS<'tcx> {
/// ADTs with no type arguments.
pub fn is_simple_text(&self) -> bool {
match self.kind() {
Adt(_, substs) => substs.types().next().is_none(),
Adt(_, substs) => substs.non_erasable_generics().next().is_none(),
Ref(_, ty, _) => ty.is_simple_text(),
_ => self.is_simple_ty(),
}