diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2023-02-10 06:09:57 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-02-10 06:09:57 +0100 |
| commit | 11e128025a7d855b80aa7ec1871e71451d8c8b7f (patch) | |
| tree | b08d175889d5ab902af55c8a4d6290eed000581a /compiler/rustc_trait_selection/src/traits | |
| parent | 8fc9ed51f04dbb6e3d7f0928ebaea9c8bce6849b (diff) | |
| parent | 243944c6535867f2d4e3bc44f4a8b0e300dc83b9 (diff) | |
Rollup merge of #107831 - nnethercote:query-refactoring, r=oli-obk
Query refactoring Just some cleanups I found when learning about the query system. Best reviewed one commit at a time. r? `@oli-obk`
Diffstat (limited to 'compiler/rustc_trait_selection/src/traits')
| -rw-r--r-- | compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs | 7 |
1 files changed, 3 insertions, 4 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 59aef52910e..2b543520198 100644 --- a/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs +++ b/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs @@ -98,6 +98,7 @@ impl<'tcx, 'a> GeneratorData<'tcx, 'a> { // obligation fn get_from_await_ty<F>( &self, + tcx: TyCtxt<'tcx>, visitor: AwaitsVisitor, hir: map::Map<'tcx>, ty_matches: F, @@ -134,9 +135,7 @@ impl<'tcx, 'a> GeneratorData<'tcx, 'a> { .unwrap_or_else(|| { bug!( "node_type: no type for node {}", - ty::tls::with(|tcx| tcx - .hir() - .node_to_string(await_expr.hir_id)) + tcx.hir().node_to_string(await_expr.hir_id) ) }) }, @@ -2351,7 +2350,7 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> { let mut interior_or_upvar_span = None; - let from_awaited_ty = generator_data.get_from_await_ty(visitor, hir, ty_matches); + let from_awaited_ty = generator_data.get_from_await_ty(self.tcx, visitor, hir, ty_matches); debug!(?from_awaited_ty); // The generator interior types share the same binders |
