Skip to content

Commit bd7e422

Browse files
committed
Add a span note on type definition spot
1 parent 59fafcf commit bd7e422

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/librustc_resolve/lib.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1988,9 +1988,12 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
19881988
path_depth)));
19891989

19901990
// If it's a typedef, give a note
1991-
if let Def::TyAlias(..) = path_res.base_def {
1991+
if let Def::TyAlias(did) = path_res.base_def {
19921992
err.fileline_note(trait_path.span,
19931993
"`type` aliases cannot be used for traits");
1994+
if let Some(sp) = self.ast_map.span_if_local(did) {
1995+
err.span_note(sp, "type defined here");
1996+
}
19941997
}
19951998
err.emit();
19961999
Err(())

0 commit comments

Comments
 (0)