Skip to content

Commit

Permalink
Hide <...> defined here note if the source is not available
Browse files Browse the repository at this point in the history
  • Loading branch information
FabianWolff committed Sep 24, 2021
1 parent a0648ea commit 911ced0
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -731,7 +731,11 @@ impl<'a, 'tcx> WrongNumberOfGenericArgs<'a, 'tcx> {
/// Builds the `type defined here` message.
fn show_definition(&self, err: &mut DiagnosticBuilder<'_>) {
let mut spans: MultiSpan = if let Some(def_span) = self.tcx.def_ident_span(self.def_id) {
def_span.into()
if self.tcx.sess.source_map().span_to_snippet(def_span).is_ok() {
def_span.into()
} else {
return;
}
} else {
return;
};
Expand Down

0 comments on commit 911ced0

Please sign in to comment.