@@ -31,7 +31,6 @@ use smallvec::SmallVec;
3131use thin_vec::ThinVec;
3232use tracing::debug;
3333
34- use crate::LangItem;
3534use crate::attrs::AttributeKind;
3635use crate::def::{CtorKind, DefKind, MacroKinds, PerNS, Res};
3736use crate::def_id::{DefId, LocalDefIdMap};
@@ -2420,9 +2419,6 @@ impl Expr<'_> {
24202419 allow_projections_from(base) || base.is_place_expr(allow_projections_from)
24212420 }
24222421
2423- // Lang item paths cannot currently be local variables or statics.
2424- ExprKind::Path(QPath::LangItem(..)) => false,
2425-
24262422 // Suppress errors for bad expressions.
24272423 ExprKind::Err(_guar)
24282424 | ExprKind::Let(&LetExpr { recovered: ast::Recovered::Yes(_guar), .. }) => true,
@@ -2592,10 +2588,6 @@ impl Expr<'_> {
25922588 pub fn equivalent_for_indexing(&self, other: &Expr<'_>) -> bool {
25932589 match (self.kind, other.kind) {
25942590 (ExprKind::Lit(lit1), ExprKind::Lit(lit2)) => lit1.node == lit2.node,
2595- (
2596- ExprKind::Path(QPath::LangItem(item1, _)),
2597- ExprKind::Path(QPath::LangItem(item2, _)),
2598- ) => item1 == item2,
25992591 (
26002592 ExprKind::Path(QPath::Resolved(None, path1)),
26012593 ExprKind::Path(QPath::Resolved(None, path2)),
@@ -2850,9 +2842,6 @@ pub enum QPath<'hir> {
28502842 /// `<Vec>::new`, and `T::X::Y::method` into `<<<T>::X>::Y>::method`,
28512843 /// the `X` and `Y` nodes each being a `TyKind::Path(QPath::TypeRelative(..))`.
28522844 TypeRelative(&'hir Ty<'hir>, &'hir PathSegment<'hir>),
2853-
2854- /// Reference to a `#[lang = "foo"]` item.
2855- LangItem(LangItem, Span),
28562845}
28572846
28582847impl<'hir> QPath<'hir> {
@@ -2861,7 +2850,6 @@ impl<'hir> QPath<'hir> {
28612850 match *self {
28622851 QPath::Resolved(_, path) => path.span,
28632852 QPath::TypeRelative(qself, ps) => qself.span.to(ps.ident.span),
2864- QPath::LangItem(_, span) => span,
28652853 }
28662854 }
28672855
@@ -2871,7 +2859,6 @@ impl<'hir> QPath<'hir> {
28712859 match *self {
28722860 QPath::Resolved(_, path) => path.span,
28732861 QPath::TypeRelative(qself, _) => qself.span,
2874- QPath::LangItem(_, span) => span,
28752862 }
28762863 }
28772864}
0 commit comments