1
Fork 0

Remove HirId from QPath::LangItem

This commit is contained in:
Michael Goulet 2023-11-23 06:01:35 +00:00
parent fe3038f263
commit fa7633dda1
12 changed files with 41 additions and 71 deletions

View file

@ -1634,8 +1634,7 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
fn suggest_remove_await(&self, obligation: &PredicateObligation<'tcx>, err: &mut Diagnostic) {
let hir = self.tcx.hir();
if let ObligationCauseCode::AwaitableExpr(Some(hir_id)) =
obligation.cause.code().peel_derives()
if let ObligationCauseCode::AwaitableExpr(hir_id) = obligation.cause.code().peel_derives()
&& let hir::Node::Expr(expr) = hir.get(*hir_id)
{
// FIXME: use `obligation.predicate.kind()...trait_ref.self_ty()` to see if we have `()`