Fix error message with non-tupled bare fn trait
This commit is contained in:
parent
40336865fe
commit
8b64988575
10 changed files with 101 additions and 38 deletions
|
@ -1750,6 +1750,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
|
|||
if let Some(ValuePairs::PolyTraitRefs(exp_found)) = values
|
||||
&& let ty::Closure(def_id, _) = exp_found.expected.skip_binder().self_ty().kind()
|
||||
&& let Some(def_id) = def_id.as_local()
|
||||
&& terr.involves_regions()
|
||||
{
|
||||
let span = self.tcx.def_span(def_id);
|
||||
diag.span_note(span, "this closure does not fulfill the lifetime requirements");
|
||||
|
|
|
@ -1935,6 +1935,18 @@ impl<'tcx> TypeTrace<'tcx> {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn poly_trait_refs(
|
||||
cause: &ObligationCause<'tcx>,
|
||||
a_is_expected: bool,
|
||||
a: ty::PolyTraitRef<'tcx>,
|
||||
b: ty::PolyTraitRef<'tcx>,
|
||||
) -> TypeTrace<'tcx> {
|
||||
TypeTrace {
|
||||
cause: cause.clone(),
|
||||
values: PolyTraitRefs(ExpectedFound::new(a_is_expected, a.into(), b.into())),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn consts(
|
||||
cause: &ObligationCause<'tcx>,
|
||||
a_is_expected: bool,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue