review comments
This commit is contained in:
parent
562f4967b4
commit
3eb8eb9429
@ -92,9 +92,10 @@ pub(super) fn try_report_named_anon_conflict(&self) -> Option<DiagnosticBuilder<
|
||||
.next()
|
||||
.is_some()
|
||||
{
|
||||
// If the failure is due to a `'static` requirement coming from a `dyn` or
|
||||
// `impl` Trait that *isn't* caused by `async fn` desugaring, handle this case
|
||||
// better in `static_impl_trait`.
|
||||
debug!("try_report_named_anon_conflict: impl Trait + 'static");
|
||||
// This is an `impl Trait` or `dyn Trait` return that evaluates de need of
|
||||
// `'static`. We handle this case better in `static_impl_trait`.
|
||||
return None;
|
||||
}
|
||||
}
|
||||
|
@ -26,7 +26,7 @@ pub(super) fn try_report_static_impl_trait(&self) -> Option<ErrorReported> {
|
||||
);
|
||||
let anon_reg_sup = self.tcx().is_suitable_region(sup_r)?;
|
||||
debug!("try_report_static_impl_trait: anon_reg_sup={:?}", anon_reg_sup);
|
||||
let fn_returns = self.tcx().return_type_impl_or_dyn_trait(anon_reg_sup.def_id);
|
||||
let fn_returns = self.tcx().return_type_impl_or_dyn_traits(anon_reg_sup.def_id);
|
||||
if fn_returns.is_empty() {
|
||||
return None;
|
||||
}
|
||||
|
@ -1406,7 +1406,8 @@ pub fn is_suitable_region(&self, region: Region<'tcx>) -> Option<FreeRegionInfo>
|
||||
})
|
||||
}
|
||||
|
||||
pub fn return_type_impl_or_dyn_trait(&self, scope_def_id: DefId) -> Vec<&'tcx hir::Ty<'tcx>> {
|
||||
/// Given a `DefId` for an `fn`, return all the `dyn` and `impl` traits in its return type.
|
||||
pub fn return_type_impl_or_dyn_traits(&self, scope_def_id: DefId) -> Vec<&'tcx hir::Ty<'tcx>> {
|
||||
let hir_id = self.hir().as_local_hir_id(scope_def_id.expect_local());
|
||||
let hir_output = match self.hir().get(hir_id) {
|
||||
Node::Item(hir::Item {
|
||||
|
Loading…
Reference in New Issue
Block a user