Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit e08ad7a

Browse files
committedApr 13, 2020
Use CRATE_HIR_ID instead of DUMMY_HIR_ID when appropriate.
Those usage ends up forwarded to a `ObligationClause` which uses `CRATE_HIR_ID` for dummy value as seen in `ObligationClause::dummy`.
1 parent 95fb7bf commit e08ad7a

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed
 

Diff for: ‎src/librustc_traits/implied_outlives_bounds.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ fn compute_implied_outlives_bounds<'tcx>(
6262
// unresolved inference variables here anyway, but there might be
6363
// during typeck under some circumstances.)
6464
let obligations =
65-
wf::obligations(infcx, param_env, hir::DUMMY_HIR_ID, ty, DUMMY_SP).unwrap_or(vec![]);
65+
wf::obligations(infcx, param_env, hir::CRATE_HIR_ID, ty, DUMMY_SP).unwrap_or(vec![]);
6666

6767
// N.B., all of these predicates *ought* to be easily proven
6868
// true. In fact, their correctness is (mostly) implied by

Diff for: ‎src/librustc_ty/ty.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ fn param_env(tcx: TyCtxt<'_>, def_id: DefId) -> ty::ParamEnv<'_> {
265265
let unnormalized_env =
266266
ty::ParamEnv::new(tcx.intern_predicates(&predicates), traits::Reveal::UserFacing, None);
267267

268-
let body_id = tcx.hir().as_local_hir_id(def_id).map_or(hir::DUMMY_HIR_ID, |id| {
268+
let body_id = tcx.hir().as_local_hir_id(def_id).map_or(hir::CRATE_HIR_ID, |id| {
269269
tcx.hir().maybe_body_owned_by(id).map_or(id, |body| body.hir_id)
270270
});
271271
let cause = traits::ObligationCause::misc(tcx.def_span(def_id), body_id);

Diff for: ‎src/librustc_typeck/check/method/probe.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ fn method_autoderef_steps<'tcx>(
452452
tcx.infer_ctxt().enter_with_canonical(DUMMY_SP, &goal, |ref infcx, goal, inference_vars| {
453453
let ParamEnvAnd { param_env, value: self_ty } = goal;
454454

455-
let mut autoderef = Autoderef::new(infcx, param_env, hir::DUMMY_HIR_ID, DUMMY_SP, self_ty)
455+
let mut autoderef = Autoderef::new(infcx, param_env, hir::CRATE_HIR_ID, DUMMY_SP, self_ty)
456456
.include_raw_pointers()
457457
.silence_errors();
458458
let mut reached_raw_pointer = false;

0 commit comments

Comments
 (0)
Please sign in to comment.