Add a span note on type definition spot

This commit is contained in:
vegai 2016-03-02 07:06:22 +02:00
parent 59fafcf00c
commit bd7e422996

View File

@ -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(())