Skip to content

Commit ac10b5f

Browse files
committed
Update error E0117 to new format
Fixes #35250
1 parent 802d081 commit ac10b5f

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

src/librustc_typeck/coherence/orphan.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -228,12 +228,14 @@ impl<'cx, 'tcx> OrphanChecker<'cx, 'tcx> {
228228
match traits::orphan_check(self.tcx, def_id) {
229229
Ok(()) => { }
230230
Err(traits::OrphanCheckErr::NoLocalInputType) => {
231-
span_err!(
231+
struct_span_err!(
232232
self.tcx.sess, item.span, E0117,
233-
"the impl does not reference any \
234-
types defined in this crate; \
235-
only traits defined in the current crate can be \
236-
implemented for arbitrary types");
233+
"only traits defined in the current crate can be \
234+
implemented for arbitrary types")
235+
.span_label(item.span, &format!("impl doesn't use types inside crate"))
236+
.note(&format!("the impl does not reference any \
237+
types defined in this crate"))
238+
.emit();
237239
return;
238240
}
239241
Err(traits::OrphanCheckErr::UncoveredTy(param_ty)) => {

src/test/compile-fail/E0117.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
// except according to those terms.
1010

1111
impl Drop for u32 {} //~ ERROR E0117
12+
//~^ NOTE impl doesn't use types inside crate
13+
//~| NOTE the impl does not reference any types defined in this crate
1214

1315
fn main() {
1416
}

0 commit comments

Comments
 (0)