Skip to content

Commit e569ada

Browse files
committed
Retire hir::ptr.
1 parent e2c9dd7 commit e569ada

File tree

6 files changed

+2
-153
lines changed

6 files changed

+2
-153
lines changed

src/librustc/hir/lowering.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ use crate::dep_graph::DepGraph;
3737
use crate::hir::def::{DefKind, Namespace, PartialRes, PerNS, Res};
3838
use crate::hir::def_id::{DefId, DefIndex, CRATE_DEF_INDEX};
3939
use crate::hir::map::{DefKey, DefPathData, Definitions};
40-
use crate::hir::ptr::P;
4140
use crate::hir::{self, ParamName};
4241
use crate::hir::{ConstArg, GenericArg};
4342
use crate::lint;
@@ -3205,7 +3204,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
32053204
/// `std::cell::Ref<T>`; note that implicit lifetimes in these
32063205
/// sorts of cases are deprecated. This may therefore report a warning or an
32073206
/// error, depending on the mode.
3208-
fn elided_path_lifetimes(&mut self, span: Span, count: usize) -> P<[hir::Lifetime]> {
3207+
fn elided_path_lifetimes(&mut self, span: Span, count: usize) -> Vec<hir::Lifetime> {
32093208
(0..count).map(|_| self.elided_path_lifetime(span)).collect()
32103209
}
32113210

src/librustc/hir/mod.rs

-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ pub mod lowering;
4343
pub mod map;
4444
pub mod pat_util;
4545
pub mod print;
46-
pub mod ptr;
4746
pub mod upvars;
4847

4948
/// Uniquely identifies a node in the HIR of the current crate. It is

src/librustc/hir/ptr.rs

-128
This file was deleted.

src/librustc_typeck/astconv.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
use crate::hir::def::{CtorOf, DefKind, Res};
66
use crate::hir::def_id::DefId;
77
use crate::hir::print;
8-
use crate::hir::ptr::P;
98
use crate::hir::{self, ExprKind, GenericArg, GenericArgs};
109
use crate::lint;
1110
use crate::middle::lang_items::SizedTraitLangItem;
@@ -255,7 +254,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
255254
seg: &hir::PathSegment<'_>,
256255
is_method_call: bool,
257256
) -> bool {
258-
let empty_args = P(hir::GenericArgs { args: &[], bindings: &[], parenthesized: false });
257+
let empty_args = hir::GenericArgs::none();
259258
let suppress_mismatch = Self::check_impl_trait(tcx, seg, &def);
260259
Self::check_generic_arg_count(
261260
tcx,

src/librustc_typeck/check/coercion.rs

-7
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ use crate::check::{FnCtxt, Needs};
5454
use errors::DiagnosticBuilder;
5555
use rustc::hir;
5656
use rustc::hir::def_id::DefId;
57-
use rustc::hir::ptr::P;
5857
use rustc::infer::type_variable::{TypeVariableOrigin, TypeVariableOriginKind};
5958
use rustc::infer::{Coercion, InferOk, InferResult};
6059
use rustc::traits::{self, ObligationCause, ObligationCauseCode};
@@ -1377,12 +1376,6 @@ impl AsCoercionSite for hir::Expr<'_> {
13771376
}
13781377
}
13791378

1380-
impl AsCoercionSite for P<hir::Expr<'_>> {
1381-
fn as_coercion_site(&self) -> &hir::Expr<'_> {
1382-
self
1383-
}
1384-
}
1385-
13861379
impl<'a, T> AsCoercionSite for &'a T
13871380
where
13881381
T: AsCoercionSite,

src/librustdoc/clean/mod.rs

-13
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ pub mod utils;
1212
use rustc::hir;
1313
use rustc::hir::def::{CtorKind, DefKind, Res};
1414
use rustc::hir::def_id::{CrateNum, DefId, CRATE_DEF_INDEX};
15-
use rustc::hir::ptr::P;
1615
use rustc::infer::region_constraints::{Constraint, RegionConstraintData};
1716
use rustc::middle::lang_items;
1817
use rustc::middle::resolve_lifetime as rl;
@@ -74,12 +73,6 @@ impl<T: Clean<U>, U> Clean<U> for &T {
7473
}
7574
}
7675

77-
impl<T: Clean<U>, U> Clean<U> for P<T> {
78-
fn clean(&self, cx: &DocContext<'_>) -> U {
79-
(**self).clean(cx)
80-
}
81-
}
82-
8376
impl<T: Clean<U>, U> Clean<U> for Rc<T> {
8477
fn clean(&self, cx: &DocContext<'_>) -> U {
8578
(**self).clean(cx)
@@ -101,12 +94,6 @@ where
10194
}
10295
}
10396

104-
impl<T: Clean<U>, U> Clean<Vec<U>> for P<[T]> {
105-
fn clean(&self, cx: &DocContext<'_>) -> Vec<U> {
106-
self.iter().map(|x| x.clean(cx)).collect()
107-
}
108-
}
109-
11097
impl Clean<ExternalCrate> for CrateNum {
11198
fn clean(&self, cx: &DocContext<'_>) -> ExternalCrate {
11299
let root = DefId { krate: *self, index: CRATE_DEF_INDEX };

0 commit comments

Comments
 (0)