Avoid a duplicated error case in fn_sig_suggestion
.
This commit is contained in:
parent
97d1b0cbcd
commit
b546334f6c
1 changed files with 5 additions and 9 deletions
|
@ -455,18 +455,14 @@ fn fn_sig_suggestion<'tcx>(
|
|||
let mut output = sig.output();
|
||||
|
||||
let asyncness = if tcx.asyncness(assoc.def_id).is_async() {
|
||||
output = if let ty::Alias(_, alias_ty) = *output.kind() {
|
||||
tcx.explicit_item_self_bounds(alias_ty.def_id)
|
||||
output = if let ty::Alias(_, alias_ty) = *output.kind()
|
||||
&& let Some(output) = tcx
|
||||
.explicit_item_self_bounds(alias_ty.def_id)
|
||||
.iter_instantiated_copied(tcx, alias_ty.args)
|
||||
.find_map(|(bound, _)| {
|
||||
bound.as_projection_clause()?.no_bound_vars()?.term.as_type()
|
||||
})
|
||||
.unwrap_or_else(|| {
|
||||
span_bug!(
|
||||
ident.span,
|
||||
"expected async fn to have `impl Future` output, but it returns {output}"
|
||||
)
|
||||
})
|
||||
}) {
|
||||
output
|
||||
} else {
|
||||
span_bug!(
|
||||
ident.span,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue