Skip to content

Commit 7e5f6c7

Browse files
committed
rustc: always keep hir::Path behind a P<...>.
1 parent 765eebf commit 7e5f6c7

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/librustc/hir/lowering.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -2725,7 +2725,7 @@ impl<'a> LoweringContext<'a> {
27252725

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

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

30953095
fn lower_trait_ref(&mut self, p: &TraitRef, itctx: ImplTraitContext<'_>) -> hir::TraitRef {
30963096
let path = match self.lower_qpath(p.ref_id, &None, &p.path, ParamMode::Explicit, itctx) {
3097-
hir::QPath::Resolved(None, path) => path.and_then(|path| path),
3097+
hir::QPath::Resolved(None, path) => path,
30983098
qpath => bug!("lower_trait_ref: unexpected QPath `{:?}`", qpath),
30993099
};
31003100
hir::TraitRef {
@@ -5577,7 +5577,7 @@ impl<'a> LoweringContext<'a> {
55775577
let principal = hir::PolyTraitRef {
55785578
bound_generic_params: hir::HirVec::new(),
55795579
trait_ref: hir::TraitRef {
5580-
path: path.and_then(|path| path),
5580+
path,
55815581
hir_ref_id: hir_id,
55825582
},
55835583
span,

src/librustc/hir/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2217,7 +2217,7 @@ pub enum UseKind {
22172217
/// within the resolution map.
22182218
#[derive(RustcEncodable, RustcDecodable, Debug, HashStable)]
22192219
pub struct TraitRef {
2220-
pub path: Path,
2220+
pub path: P<Path>,
22212221
// Don't hash the ref_id. It is tracked via the thing it is used to access
22222222
#[stable_hasher(ignore)]
22232223
pub hir_ref_id: HirId,

src/librustc_typeck/collect.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1353,7 +1353,7 @@ pub fn checked_type_of<'tcx>(tcx: TyCtxt<'tcx>, def_id: DefId, fail: bool) -> Op
13531353
None
13541354
}
13551355
}
1356-
Node::TraitRef(&hir::TraitRef { ref path, .. }) => Some(path),
1356+
Node::TraitRef(&hir::TraitRef { ref path, .. }) => Some(&**path),
13571357
_ => None,
13581358
};
13591359

0 commit comments

Comments
 (0)