Skip to content

Commit 2967dcc

Browse files
committed
E0184 Update error format #35275
- Fixes #35275 - Part of #35233 r? @jonathandturner
1 parent 28c5edb commit 2967dcc

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/librustc_typeck/coherence/mod.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -348,9 +348,11 @@ impl<'a, 'gcx, 'tcx> CoherenceChecker<'a, 'gcx, 'tcx> {
348348
.emit();
349349
}
350350
Err(CopyImplementationError::HasDestructor) => {
351-
span_err!(tcx.sess, span, E0184,
351+
struct_span_err!(tcx.sess, span, E0184,
352352
"the trait `Copy` may not be implemented for this type; \
353-
the type has a destructor");
353+
the type has a destructor")
354+
.span_label(span, &format!("Copy not allowed on types with destructors"))
355+
.emit();
354356
}
355357
}
356358
});

src/test/compile-fail/E0184.rs

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
// except according to those terms.
1010

1111
#[derive(Copy)] //~ ERROR E0184
12+
//~| NOTE Copy not allowed on types with destructors
13+
//~| NOTE in this expansion of #[derive(Copy)]
1214
struct Foo;
1315

1416
impl Drop for Foo {

0 commit comments

Comments
 (0)