Rollup merge of #89233 - FabianWolff:issue-89159, r=estebank
Hide `<...> defined here` note if the source is not available Fixes #89159. Similar to #87088. r? ``@estebank``
This commit is contained in:
commit
3c60e040b2
1 changed files with 5 additions and 1 deletions
|
@ -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;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue