Rollup merge of #111252 - matthewjasper:min-spec-improvements, r=compiler-errors

Min specialization improvements

- Don't allow specialization impls with no items, such implementations are probably not correct and only occur as mistakes in the compiler and standard library
- Fix a missing normalization call
- Adds spans for lifetime errors from overly general specializations

Closes #79457
Closes #109815
This commit is contained in:
Dylan DPC
2023-05-09 12:33:46 +05:30
committed by GitHub
20 changed files with 346 additions and 48 deletions

View File

@@ -814,6 +814,15 @@ pub(crate) struct ClosureImplicitHrtb {
pub for_sp: Span,
}
#[derive(Diagnostic)]
#[diag(hir_analysis_empty_specialization)]
pub(crate) struct EmptySpecialization {
#[primary_span]
pub span: Span,
#[note]
pub base_impl_span: Span,
}
#[derive(Diagnostic)]
#[diag(hir_analysis_const_specialize)]
pub(crate) struct ConstSpecialize {