Hide -> () in Fn traits
This commit is contained in:
parent
35c948ff4a
commit
7c6f764ad6
2 changed files with 7 additions and 5 deletions
|
|
@ -778,8 +778,10 @@ fn write_bounds_like_dyn_trait(
|
|||
}
|
||||
WhereClause::AliasEq(alias_eq) if is_fn_trait => {
|
||||
is_fn_trait = false;
|
||||
write!(f, " -> ")?;
|
||||
alias_eq.ty.hir_fmt(f)?;
|
||||
if !alias_eq.ty.is_unit() {
|
||||
write!(f, " -> ")?;
|
||||
alias_eq.ty.hir_fmt(f)?;
|
||||
}
|
||||
}
|
||||
WhereClause::AliasEq(AliasEq { ty, alias }) => {
|
||||
// in types in actual Rust, these will always come
|
||||
|
|
|
|||
|
|
@ -3095,16 +3095,16 @@ fn foo() {
|
|||
478..576 '{ ...&s); }': ()
|
||||
488..489 's': Option<i32>
|
||||
492..504 'Option::None': Option<i32>
|
||||
514..515 'f': Box<dyn FnOnce(&Option<i32>) -> ()>
|
||||
514..515 'f': Box<dyn FnOnce(&Option<i32>)>
|
||||
549..562 'box (|ps| {})': Box<|{unknown}| -> ()>
|
||||
554..561 '|ps| {}': |{unknown}| -> ()
|
||||
555..557 'ps': {unknown}
|
||||
559..561 '{}': ()
|
||||
568..569 'f': Box<dyn FnOnce(&Option<i32>) -> ()>
|
||||
568..569 'f': Box<dyn FnOnce(&Option<i32>)>
|
||||
568..573 'f(&s)': ()
|
||||
570..572 '&s': &Option<i32>
|
||||
571..572 's': Option<i32>
|
||||
549..562: expected Box<dyn FnOnce(&Option<i32>) -> ()>, got Box<|{unknown}| -> ()>
|
||||
549..562: expected Box<dyn FnOnce(&Option<i32>)>, got Box<|{unknown}| -> ()>
|
||||
"#]],
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue