summary refs log tree commit diff
path: root/compiler/rustc_ast_lowering/src/expr.rs
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2023-12-26 13:29:13 -0500
committerGitHub <noreply@github.com>2023-12-26 13:29:13 -0500
commite7bd402a38be3e7c6d5f32ddfb2d36b6f7d98f2f (patch)
treef1bd72ee1a4dac2711d0d97879620a7e3eeb223c /compiler/rustc_ast_lowering/src/expr.rs
parent50e380c8f3e8bad3c6327895a2af8a99b378030b (diff)
parent7e00e9736db89ecef7575622a13b57021ec34493 (diff)
downloadrust-e7bd402a38be3e7c6d5f32ddfb2d36b6f7d98f2f.tar.gz
rust-e7bd402a38be3e7c6d5f32ddfb2d36b6f7d98f2f.zip
Rollup merge of #119240 - compiler-errors:lang-item-more, r=petrochenkov
Make some non-diagnostic-affecting `QPath::LangItem` into regular `QPath`s

The rest of 'em affect diagnostics, so leave them alone... for now.

cc #115178
Diffstat (limited to 'compiler/rustc_ast_lowering/src/expr.rs')
-rw-r--r--compiler/rustc_ast_lowering/src/expr.rs10
1 files changed, 4 insertions, 6 deletions
diff --git a/compiler/rustc_ast_lowering/src/expr.rs b/compiler/rustc_ast_lowering/src/expr.rs
index 1f195916c77..ccc6644923a 100644
--- a/compiler/rustc_ast_lowering/src/expr.rs
+++ b/compiler/rustc_ast_lowering/src/expr.rs
@@ -638,7 +638,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
             self.lower_span(span),
             Some(self.allow_gen_future.clone()),
         );
-        let resume_ty = hir::QPath::LangItem(hir::LangItem::ResumeTy, unstable_span);
+        let resume_ty = self.make_lang_item_qpath(hir::LangItem::ResumeTy, unstable_span);
         let input_ty = hir::Ty {
             hir_id: self.next_id(),
             kind: hir::TyKind::Path(resume_ty),
@@ -774,7 +774,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
             self.lower_span(span),
             Some(self.allow_gen_future.clone()),
         );
-        let resume_ty = hir::QPath::LangItem(hir::LangItem::ResumeTy, unstable_span);
+        let resume_ty = self.make_lang_item_qpath(hir::LangItem::ResumeTy, unstable_span);
         let input_ty = hir::Ty {
             hir_id: self.next_id(),
             kind: hir::TyKind::Path(resume_ty),
@@ -2126,11 +2126,9 @@ impl<'hir> LoweringContext<'_, 'hir> {
         lang_item: hir::LangItem,
         name: Symbol,
     ) -> hir::Expr<'hir> {
+        let qpath = self.make_lang_item_qpath(lang_item, self.lower_span(span));
         let path = hir::ExprKind::Path(hir::QPath::TypeRelative(
-            self.arena.alloc(self.ty(
-                span,
-                hir::TyKind::Path(hir::QPath::LangItem(lang_item, self.lower_span(span))),
-            )),
+            self.arena.alloc(self.ty(span, hir::TyKind::Path(qpath))),
             self.arena.alloc(hir::PathSegment::new(
                 Ident::new(name, span),
                 self.next_id(),