1
Fork 0

Rollup merge of #118199 - compiler-errors:qpath, r=lcnr

Remove `HirId` from `QPath::LangItem`

Remove `HirId` from `QPath::LangItem`, since there was only *one* use-case (`ObligationCauseCode::AwaitableExpr`), which we can instead recover by walking the HIR tree.
This commit is contained in:
Guillaume Gomez 2023-11-25 19:51:55 +01:00 committed by GitHub
commit 8fb68fc3b0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 45 additions and 75 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 `()`