Skip to content
Permalink
Browse files

rustc: always keep `hir::Path` behind a `P<...>`.

  • Loading branch information...
eddyb committed Jun 19, 2019
1 parent 765eebf commit 7e5f6c7f83d4092a216248ed64068befdb25e99c
Showing with 5 additions and 5 deletions.
  1. +3 −3 src/librustc/hir/lowering.rs
  2. +1 −1 src/librustc/hir/mod.rs
  3. +1 −1 src/librustc_typeck/collect.rs
@@ -2725,7 +2725,7 @@ impl<'a> LoweringContext<'a> {

// ::std::future::Future<future_params>
let future_path =
self.std_path(span, &[sym::future, sym::Future], Some(future_params), false);
P(self.std_path(span, &[sym::future, sym::Future], Some(future_params), false));

hir::GenericBound::Trait(
hir::PolyTraitRef {
@@ -3094,7 +3094,7 @@ impl<'a> LoweringContext<'a> {

fn lower_trait_ref(&mut self, p: &TraitRef, itctx: ImplTraitContext<'_>) -> hir::TraitRef {
let path = match self.lower_qpath(p.ref_id, &None, &p.path, ParamMode::Explicit, itctx) {
hir::QPath::Resolved(None, path) => path.and_then(|path| path),
hir::QPath::Resolved(None, path) => path,
qpath => bug!("lower_trait_ref: unexpected QPath `{:?}`", qpath),
};
hir::TraitRef {
@@ -5577,7 +5577,7 @@ impl<'a> LoweringContext<'a> {
let principal = hir::PolyTraitRef {
bound_generic_params: hir::HirVec::new(),
trait_ref: hir::TraitRef {
path: path.and_then(|path| path),
path,
hir_ref_id: hir_id,
},
span,
@@ -2217,7 +2217,7 @@ pub enum UseKind {
/// within the resolution map.
#[derive(RustcEncodable, RustcDecodable, Debug, HashStable)]
pub struct TraitRef {
pub path: Path,
pub path: P<Path>,
// Don't hash the ref_id. It is tracked via the thing it is used to access
#[stable_hasher(ignore)]
pub hir_ref_id: HirId,
@@ -1353,7 +1353,7 @@ pub fn checked_type_of<'tcx>(tcx: TyCtxt<'tcx>, def_id: DefId, fail: bool) -> Op
None
}
}
Node::TraitRef(&hir::TraitRef { ref path, .. }) => Some(path),
Node::TraitRef(&hir::TraitRef { ref path, .. }) => Some(&**path),
_ => None,
};

0 comments on commit 7e5f6c7

Please sign in to comment.
You can’t perform that action at this time.