summary refs log tree commit diff
path: root/compiler/rustc_trait_selection/src/traits
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2023-11-25 19:51:55 +0100
committerGitHub <noreply@github.com>2023-11-25 19:51:55 +0100
commit8fb68fc3b024e1d0de8067d002a635bd157efd5b (patch)
treef4fc75000b6a6d10f6f187d9d5d22d0a60d241e1 /compiler/rustc_trait_selection/src/traits
parent5d2b6b355649d4a5359f2737c5bf32f9ae5d03f8 (diff)
parent4e23448c49f8e954f1412fd0ed0e892931533e36 (diff)
downloadrust-8fb68fc3b024e1d0de8067d002a635bd157efd5b.tar.gz
rust-8fb68fc3b024e1d0de8067d002a635bd157efd5b.zip
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.
Diffstat (limited to 'compiler/rustc_trait_selection/src/traits')
-rw-r--r--compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs3
1 files changed, 1 insertions, 2 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs b/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs
index 38ef94a4d3b..e260fcd5e75 100644
--- a/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs
+++ b/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs
@@ -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 `()`