Add a span note on type definition spot
This commit is contained in:
parent
59fafcf00c
commit
bd7e422996
@ -1988,9 +1988,12 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
|
||||
path_depth)));
|
||||
|
||||
// If it's a typedef, give a note
|
||||
if let Def::TyAlias(..) = path_res.base_def {
|
||||
if let Def::TyAlias(did) = path_res.base_def {
|
||||
err.fileline_note(trait_path.span,
|
||||
"`type` aliases cannot be used for traits");
|
||||
if let Some(sp) = self.ast_map.span_if_local(did) {
|
||||
err.span_note(sp, "type defined here");
|
||||
}
|
||||
}
|
||||
err.emit();
|
||||
Err(())
|
||||
|
Loading…
x
Reference in New Issue
Block a user