about summary refs log tree commit diff
path: root/compiler/rustc_hir_analysis/src/errors.rs
diff options
context:
space:
mode:
authorDylan DPC <99973273+Dylan-DPC@users.noreply.github.com>2023-05-09 12:33:46 +0530
committerGitHub <noreply@github.com>2023-05-09 12:33:46 +0530
commitf748bb1402fb2e8befb9ab1188b2229ce617ffcc (patch)
treeb579351fa4d79e4f390abeba8f6109c996b68bef /compiler/rustc_hir_analysis/src/errors.rs
parent8c51701b8a5ac3a2fbfbad9f6d386ec443344293 (diff)
parentf46eabb9e56fab132ec8171d0e0239f42c986e52 (diff)
downloadrust-f748bb1402fb2e8befb9ab1188b2229ce617ffcc.tar.gz
rust-f748bb1402fb2e8befb9ab1188b2229ce617ffcc.zip
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
Diffstat (limited to 'compiler/rustc_hir_analysis/src/errors.rs')
-rw-r--r--compiler/rustc_hir_analysis/src/errors.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/compiler/rustc_hir_analysis/src/errors.rs b/compiler/rustc_hir_analysis/src/errors.rs
index 379a88538a9..6e7eb4f6cdc 100644
--- a/compiler/rustc_hir_analysis/src/errors.rs
+++ b/compiler/rustc_hir_analysis/src/errors.rs
@@ -815,6 +815,15 @@ pub(crate) struct ClosureImplicitHrtb {
 }
 
 #[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 {
     #[primary_span]