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

This commit is contained in:
Eduard-Mihai Burtescu 2019-06-19 20:10:37 +03:00
parent 765eebf064
commit 7e5f6c7f83
3 changed files with 5 additions and 5 deletions

View File

@ -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,

View File

@ -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,

View File

@ -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,
};