Skip to content

Commit 35a0961

Browse files
committed
Auto merge of #108977 - matthiaskrgr:rollup-1bnl1hu, r=matthiaskrgr
Rollup of 9 pull requests Successful merges: - #108879 (Unconstrained terms should account for infer vars being equated) - #108936 (Rustdoc: don't hide anonymous reexport) - #108940 (Add myself to compiler reviewers list) - #108945 (Make some report and emit errors take DefIds instead of BodyIds) - #108946 (Document the resulting values produced when using `From<bool>` on floats) - #108956 (Make ptr::from_ref and ptr::from_mut in #106116 const.) - #108960 (Remove `body_def_id` from `Inherited`) - #108963 (only call git on git checkouts during bootstrap) - #108964 (Fix the docs for pointer method with_metadata_of) Failed merges: - #108950 (Directly construct Inherited in typeck.) r? `@ghost` `@rustbot` modify labels: rollup
2 parents d583342 + df74b70 commit 35a0961

File tree

24 files changed

+157
-121
lines changed

24 files changed

+157
-121
lines changed

compiler/rustc_borrowck/src/region_infer/opaque_types.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ impl<'tcx> InferCtxtExt<'tcx> for InferCtxt<'tcx> {
325325
if errors.is_empty() {
326326
definition_ty
327327
} else {
328-
let reported = infcx.err_ctxt().report_fulfillment_errors(&errors, None);
328+
let reported = infcx.err_ctxt().report_fulfillment_errors(&errors);
329329
self.tcx.ty_error(reported)
330330
}
331331
}

compiler/rustc_const_eval/src/transform/check_consts/check.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -770,7 +770,7 @@ impl<'tcx> Visitor<'tcx> for Checker<'_, 'tcx> {
770770

771771
let errors = ocx.select_all_or_error();
772772
if !errors.is_empty() {
773-
infcx.err_ctxt().report_fulfillment_errors(&errors, None);
773+
infcx.err_ctxt().report_fulfillment_errors(&errors);
774774
}
775775
}
776776

compiler/rustc_hir_analysis/src/check/check.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ fn check_opaque_meets_bounds<'tcx>(
444444
// version.
445445
let errors = ocx.select_all_or_error();
446446
if !errors.is_empty() {
447-
infcx.err_ctxt().report_fulfillment_errors(&errors, None);
447+
infcx.err_ctxt().report_fulfillment_errors(&errors);
448448
}
449449
match origin {
450450
// Checked when type checking the function containing them.
@@ -1545,6 +1545,6 @@ pub(super) fn check_generator_obligations(tcx: TyCtxt<'_>, def_id: LocalDefId) {
15451545
let errors = fulfillment_cx.select_all_or_error(&infcx);
15461546
debug!(?errors);
15471547
if !errors.is_empty() {
1548-
infcx.err_ctxt().report_fulfillment_errors(&errors, None);
1548+
infcx.err_ctxt().report_fulfillment_errors(&errors);
15491549
}
15501550
}

compiler/rustc_hir_analysis/src/check/compare_impl_item.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ fn compare_method_predicate_entailment<'tcx>(
320320
});
321321
}
322322
CheckImpliedWfMode::Skip => {
323-
let reported = infcx.err_ctxt().report_fulfillment_errors(&errors, None);
323+
let reported = infcx.err_ctxt().report_fulfillment_errors(&errors);
324324
return Err(reported);
325325
}
326326
}
@@ -720,7 +720,7 @@ pub(super) fn collect_return_position_impl_trait_in_trait_tys<'tcx>(
720720
// RPITs.
721721
let errors = ocx.select_all_or_error();
722722
if !errors.is_empty() {
723-
let reported = infcx.err_ctxt().report_fulfillment_errors(&errors, None);
723+
let reported = infcx.err_ctxt().report_fulfillment_errors(&errors);
724724
return Err(reported);
725725
}
726726

@@ -1731,7 +1731,7 @@ pub(super) fn compare_impl_const_raw(
17311731
// version.
17321732
let errors = ocx.select_all_or_error();
17331733
if !errors.is_empty() {
1734-
return Err(infcx.err_ctxt().report_fulfillment_errors(&errors, None));
1734+
return Err(infcx.err_ctxt().report_fulfillment_errors(&errors));
17351735
}
17361736

17371737
let outlives_environment = OutlivesEnvironment::new(param_env);
@@ -1831,7 +1831,7 @@ fn compare_type_predicate_entailment<'tcx>(
18311831
// version.
18321832
let errors = ocx.select_all_or_error();
18331833
if !errors.is_empty() {
1834-
let reported = infcx.err_ctxt().report_fulfillment_errors(&errors, None);
1834+
let reported = infcx.err_ctxt().report_fulfillment_errors(&errors);
18351835
return Err(reported);
18361836
}
18371837

@@ -2044,7 +2044,7 @@ pub(super) fn check_type_bounds<'tcx>(
20442044
// version.
20452045
let errors = ocx.select_all_or_error();
20462046
if !errors.is_empty() {
2047-
let reported = infcx.err_ctxt().report_fulfillment_errors(&errors, None);
2047+
let reported = infcx.err_ctxt().report_fulfillment_errors(&errors);
20482048
return Err(reported);
20492049
}
20502050

compiler/rustc_hir_analysis/src/check/wfcheck.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ pub(super) fn enter_wf_checking_ctxt<'tcx, F>(
111111

112112
let errors = wfcx.select_all_or_error();
113113
if !errors.is_empty() {
114-
infcx.err_ctxt().report_fulfillment_errors(&errors, None);
114+
infcx.err_ctxt().report_fulfillment_errors(&errors);
115115
return;
116116
}
117117

compiler/rustc_hir_analysis/src/coherence/builtin.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ fn visit_implementation_of_dispatch_from_dyn(tcx: TyCtxt<'_>, impl_did: LocalDef
345345
}),
346346
);
347347
if !errors.is_empty() {
348-
infcx.err_ctxt().report_fulfillment_errors(&errors, None);
348+
infcx.err_ctxt().report_fulfillment_errors(&errors);
349349
}
350350

351351
// Finally, resolve all regions.
@@ -585,7 +585,7 @@ pub fn coerce_unsized_info<'tcx>(tcx: TyCtxt<'tcx>, impl_did: DefId) -> CoerceUn
585585
predicate_for_trait_def(tcx, param_env, cause, trait_def_id, 0, [source, target]);
586586
let errors = traits::fully_solve_obligation(&infcx, predicate);
587587
if !errors.is_empty() {
588-
infcx.err_ctxt().report_fulfillment_errors(&errors, None);
588+
infcx.err_ctxt().report_fulfillment_errors(&errors);
589589
}
590590

591591
// Finally, resolve all regions.

compiler/rustc_hir_analysis/src/impl_wf_check/min_specialization.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ fn get_impl_substs(
174174

175175
let errors = ocx.select_all_or_error();
176176
if !errors.is_empty() {
177-
ocx.infcx.err_ctxt().report_fulfillment_errors(&errors, None);
177+
ocx.infcx.err_ctxt().report_fulfillment_errors(&errors);
178178
return None;
179179
}
180180

compiler/rustc_hir_analysis/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ fn require_same_types<'tcx>(
176176
match &errors[..] {
177177
[] => true,
178178
errors => {
179-
infcx.err_ctxt().report_fulfillment_errors(errors, None);
179+
infcx.err_ctxt().report_fulfillment_errors(errors);
180180
false
181181
}
182182
}
@@ -309,7 +309,7 @@ fn check_main_fn_ty(tcx: TyCtxt<'_>, main_def_id: DefId) {
309309
ocx.register_bound(cause, param_env, norm_return_ty, term_did);
310310
let errors = ocx.select_all_or_error();
311311
if !errors.is_empty() {
312-
infcx.err_ctxt().report_fulfillment_errors(&errors, None);
312+
infcx.err_ctxt().report_fulfillment_errors(&errors);
313313
error = true;
314314
}
315315
// now we can take the return type of the given main function

compiler/rustc_hir_typeck/src/fn_ctxt/_impl.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
581581

582582
if !errors.is_empty() {
583583
self.adjust_fulfillment_errors_for_expr_obligation(&mut errors);
584-
self.err_ctxt().report_fulfillment_errors(&errors, self.inh.body_id);
584+
self.err_ctxt().report_fulfillment_errors(&errors);
585585
}
586586
}
587587

@@ -594,7 +594,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
594594
if !result.is_empty() {
595595
mutate_fulfillment_errors(&mut result);
596596
self.adjust_fulfillment_errors_for_expr_obligation(&mut result);
597-
self.err_ctxt().report_fulfillment_errors(&result, self.inh.body_id);
597+
self.err_ctxt().report_fulfillment_errors(&result);
598598
}
599599
}
600600

@@ -1411,7 +1411,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
14111411
} else {
14121412
let e = self.tainted_by_errors().unwrap_or_else(|| {
14131413
self.err_ctxt()
1414-
.emit_inference_failure_err((**self).body_id, sp, ty.into(), E0282, true)
1414+
.emit_inference_failure_err(self.body_id, sp, ty.into(), E0282, true)
14151415
.emit()
14161416
});
14171417
let err = self.tcx.ty_error(e);

compiler/rustc_hir_typeck/src/inherited.rs

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,6 @@ pub struct Inherited<'tcx> {
5858
pub(super) deferred_generator_interiors:
5959
RefCell<Vec<(LocalDefId, hir::BodyId, Ty<'tcx>, hir::GeneratorKind)>>,
6060

61-
pub(super) body_id: Option<hir::BodyId>,
62-
6361
/// Whenever we introduce an adjustment from `!` into a type variable,
6462
/// we record that type variable here. This is later used to inform
6563
/// fallback. See the `fallback` module for details.
@@ -80,7 +78,6 @@ impl<'tcx> Deref for Inherited<'tcx> {
8078
/// without using `Rc` or something similar.
8179
pub struct InheritedBuilder<'tcx> {
8280
infcx: infer::InferCtxtBuilder<'tcx>,
83-
def_id: LocalDefId,
8481
typeck_results: RefCell<ty::TypeckResults<'tcx>>,
8582
}
8683

@@ -93,7 +90,6 @@ impl<'tcx> Inherited<'tcx> {
9390
.infer_ctxt()
9491
.ignoring_regions()
9592
.with_opaque_type_inference(DefiningAnchor::Bind(hir_owner.def_id)),
96-
def_id,
9793
typeck_results: RefCell::new(ty::TypeckResults::new(hir_owner)),
9894
}
9995
}
@@ -104,19 +100,13 @@ impl<'tcx> InheritedBuilder<'tcx> {
104100
where
105101
F: FnOnce(&Inherited<'tcx>) -> R,
106102
{
107-
let def_id = self.def_id;
108-
f(&Inherited::new(self.infcx.build(), def_id, self.typeck_results))
103+
f(&Inherited::new(self.infcx.build(), self.typeck_results))
109104
}
110105
}
111106

112107
impl<'tcx> Inherited<'tcx> {
113-
fn new(
114-
infcx: InferCtxt<'tcx>,
115-
def_id: LocalDefId,
116-
typeck_results: RefCell<ty::TypeckResults<'tcx>>,
117-
) -> Self {
108+
fn new(infcx: InferCtxt<'tcx>, typeck_results: RefCell<ty::TypeckResults<'tcx>>) -> Self {
118109
let tcx = infcx.tcx;
119-
let body_id = tcx.hir().maybe_body_owned_by(def_id);
120110

121111
Inherited {
122112
typeck_results,
@@ -130,7 +120,6 @@ impl<'tcx> Inherited<'tcx> {
130120
deferred_asm_checks: RefCell::new(Vec::new()),
131121
deferred_generator_interiors: RefCell::new(Vec::new()),
132122
diverging_type_vars: RefCell::new(Default::default()),
133-
body_id,
134123
infer_var_info: RefCell::new(Default::default()),
135124
}
136125
}

0 commit comments

Comments
 (0)