diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-05-25 14:25:15 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2021-05-25 14:25:15 +0100 |
commit | 33fdd512e318f86ccd66b84ce6128c03eb44cf77 (patch) | |
tree | 146d712f24c290963bb268e443f02b59dd79f26a /crates/hir_ty/src/display.rs | |
parent | f3cfd8afb6db1ee0a8449655703172a0c8cf5411 (diff) | |
parent | 7c6f764ad6d7c6fc964be9fd2e96da717e2b2cc1 (diff) |
Merge #8987
8987: Fix lowering of FnOnce() without return type r=flodiebold a=flodiebold
This should result in an implicit `-> ()`, not leaving out the binding.
Co-authored-by: Florian Diebold <[email protected]>
Diffstat (limited to 'crates/hir_ty/src/display.rs')
-rw-r--r-- | crates/hir_ty/src/display.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/crates/hir_ty/src/display.rs b/crates/hir_ty/src/display.rs index 637bbc634..44f843bf3 100644 --- a/crates/hir_ty/src/display.rs +++ b/crates/hir_ty/src/display.rs | |||
@@ -778,8 +778,10 @@ fn write_bounds_like_dyn_trait( | |||
778 | } | 778 | } |
779 | WhereClause::AliasEq(alias_eq) if is_fn_trait => { | 779 | WhereClause::AliasEq(alias_eq) if is_fn_trait => { |
780 | is_fn_trait = false; | 780 | is_fn_trait = false; |
781 | write!(f, " -> ")?; | 781 | if !alias_eq.ty.is_unit() { |
782 | alias_eq.ty.hir_fmt(f)?; | 782 | write!(f, " -> ")?; |
783 | alias_eq.ty.hir_fmt(f)?; | ||
784 | } | ||
783 | } | 785 | } |
784 | WhereClause::AliasEq(AliasEq { ty, alias }) => { | 786 | WhereClause::AliasEq(AliasEq { ty, alias }) => { |
785 | // in types in actual Rust, these will always come | 787 | // in types in actual Rust, these will always come |