1
Fork 0

Disallow (min) specialization imps with no items

Such implementations are usually mistakes and are not used in the
compiler or standard library (after this commit) so forbid them with
`min_specialization`.
This commit is contained in:
Matthew Jasper 2023-05-05 12:54:58 +01:00
parent dd9a7bf848
commit bd928a0b5e
11 changed files with 112 additions and 23 deletions

View file

@ -803,6 +803,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 {