We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents e220d3d + 2e09714 commit 3af1885Copy full SHA for 3af1885
crates/hir_ty/src/display.rs
@@ -190,6 +190,7 @@ impl DisplayTarget {
190
pub enum DisplaySourceCodeError {
191
PathNotFound,
192
UnknownType,
193
+ Closure,
194
}
195
196
pub enum HirDisplayError {
@@ -543,6 +544,11 @@ impl HirDisplay for Ty {
543
544
545
546
TyKind::Closure(.., substs) => {
547
+ if f.display_target.is_source_code() {
548
+ return Err(HirDisplayError::DisplaySourceCodeError(
549
+ DisplaySourceCodeError::Closure,
550
+ ));
551
+ }
552
let sig = substs[0].callable_sig(f.db);
553
if let Some(sig) = sig {
554
if sig.params().is_empty() {
0 commit comments