From 0a64dac604564fc7544a4cc5d232b95871c6514c Mon Sep 17 00:00:00 2001 From: Takayuki Maeda Date: Fri, 5 May 2023 17:28:52 +0900 Subject: [PATCH] remove unnecessary attribute from a diagnostic --- compiler/rustc_hir_analysis/src/errors.rs | 1 - tests/ui/specialization/issue-111232.rs | 11 +++++++++++ tests/ui/specialization/issue-111232.stderr | 11 +++++++++++ 3 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 tests/ui/specialization/issue-111232.rs create mode 100644 tests/ui/specialization/issue-111232.stderr diff --git a/compiler/rustc_hir_analysis/src/errors.rs b/compiler/rustc_hir_analysis/src/errors.rs index c0ee777722e..30e2c675f59 100644 --- a/compiler/rustc_hir_analysis/src/errors.rs +++ b/compiler/rustc_hir_analysis/src/errors.rs @@ -657,7 +657,6 @@ pub enum ImplNotMarkedDefault { #[note] Err { #[primary_span] - #[label] span: Span, cname: Symbol, ident: Symbol, diff --git a/tests/ui/specialization/issue-111232.rs b/tests/ui/specialization/issue-111232.rs new file mode 100644 index 00000000000..3ed3c580e6d --- /dev/null +++ b/tests/ui/specialization/issue-111232.rs @@ -0,0 +1,11 @@ +#![feature(min_specialization)] + +struct S; + +impl From for S { + fn from(s: S) -> S { //~ ERROR `from` specializes an item from a parent `impl`, but that item is not marked `default` + s + } +} + +fn main() {} diff --git a/tests/ui/specialization/issue-111232.stderr b/tests/ui/specialization/issue-111232.stderr new file mode 100644 index 00000000000..27ee42fc00c --- /dev/null +++ b/tests/ui/specialization/issue-111232.stderr @@ -0,0 +1,11 @@ +error[E0520]: `from` specializes an item from a parent `impl`, but that item is not marked `default` + --> $DIR/issue-111232.rs:6:5 + | +LL | fn from(s: S) -> S { + | ^^^^^^^^^^^^^^^^^^ + | + = note: parent implementation is in crate `core` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0520`.