Skip to content

Commit 66fd99c

Browse files
authored
Unrolled build for rust-lang#120573
Rollup merge of rust-lang#120573 - nnethercote:rm-BorrowckErrors-tainted_by_errors, r=oli-obk Remove `BorrowckErrors::tainted_by_errors` This PR removes one of the `tainted_by_errors` occurrences, replacing it with direct use of `ErrorGuaranteed`. r? `@oli-obk`
2 parents 671eb38 + b6a4f03 commit 66fd99c

File tree

7 files changed

+88
-91
lines changed

7 files changed

+88
-91
lines changed

compiler/rustc_borrowck/src/borrowck_errors.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ impl<'cx, 'tcx> crate::MirBorrowckCtxt<'cx, 'tcx> {
130130
noun_old: &str,
131131
old_opt_via: &str,
132132
previous_end_span: Option<Span>,
133-
) -> DiagnosticBuilder<'cx> {
133+
) -> DiagnosticBuilder<'tcx> {
134134
let mut err = struct_span_code_err!(
135135
self.dcx(),
136136
new_loan_span,
@@ -162,7 +162,7 @@ impl<'cx, 'tcx> crate::MirBorrowckCtxt<'cx, 'tcx> {
162162
old_opt_via: &str,
163163
previous_end_span: Option<Span>,
164164
second_borrow_desc: &str,
165-
) -> DiagnosticBuilder<'cx> {
165+
) -> DiagnosticBuilder<'tcx> {
166166
let mut err = struct_span_code_err!(
167167
self.dcx(),
168168
new_loan_span,
@@ -194,7 +194,7 @@ impl<'cx, 'tcx> crate::MirBorrowckCtxt<'cx, 'tcx> {
194194
kind_old: &str,
195195
msg_old: &str,
196196
old_load_end_span: Option<Span>,
197-
) -> DiagnosticBuilder<'cx> {
197+
) -> DiagnosticBuilder<'tcx> {
198198
let via = |msg: &str| if msg.is_empty() { "".to_string() } else { format!(" (via {msg})") };
199199
let mut err = struct_span_code_err!(
200200
self.dcx(),
@@ -235,7 +235,7 @@ impl<'cx, 'tcx> crate::MirBorrowckCtxt<'cx, 'tcx> {
235235
span: Span,
236236
borrow_span: Span,
237237
desc: &str,
238-
) -> DiagnosticBuilder<'cx> {
238+
) -> DiagnosticBuilder<'tcx> {
239239
struct_span_code_err!(
240240
self.dcx(),
241241
span,
@@ -252,7 +252,7 @@ impl<'cx, 'tcx> crate::MirBorrowckCtxt<'cx, 'tcx> {
252252
span: Span,
253253
desc: &str,
254254
is_arg: bool,
255-
) -> DiagnosticBuilder<'cx> {
255+
) -> DiagnosticBuilder<'tcx> {
256256
let msg = if is_arg { "to immutable argument" } else { "twice to immutable variable" };
257257
struct_span_code_err!(self.dcx(), span, E0384, "cannot assign {} {}", msg, desc)
258258
}
@@ -265,7 +265,7 @@ impl<'cx, 'tcx> crate::MirBorrowckCtxt<'cx, 'tcx> {
265265
&self,
266266
move_from_span: Span,
267267
move_from_desc: &str,
268-
) -> DiagnosticBuilder<'cx> {
268+
) -> DiagnosticBuilder<'tcx> {
269269
struct_span_code_err!(
270270
self.dcx(),
271271
move_from_span,
@@ -283,7 +283,7 @@ impl<'cx, 'tcx> crate::MirBorrowckCtxt<'cx, 'tcx> {
283283
move_from_span: Span,
284284
ty: Ty<'_>,
285285
is_index: Option<bool>,
286-
) -> DiagnosticBuilder<'cx> {
286+
) -> DiagnosticBuilder<'tcx> {
287287
let type_name = match (&ty.kind(), is_index) {
288288
(&ty::Array(_, _), Some(true)) | (&ty::Array(_, _), None) => "array",
289289
(&ty::Slice(_), _) => "slice",
@@ -304,7 +304,7 @@ impl<'cx, 'tcx> crate::MirBorrowckCtxt<'cx, 'tcx> {
304304
&self,
305305
move_from_span: Span,
306306
container_ty: Ty<'_>,
307-
) -> DiagnosticBuilder<'cx> {
307+
) -> DiagnosticBuilder<'tcx> {
308308
struct_span_code_err!(
309309
self.dcx(),
310310
move_from_span,

compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs

+10-10
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
327327
&mut self,
328328
mpi: MovePathIndex,
329329
move_span: Span,
330-
err: &mut DiagnosticBuilder<'_>,
330+
err: &mut DiagnosticBuilder<'tcx>,
331331
in_pattern: &mut bool,
332332
move_spans: UseSpans<'_>,
333333
) {
@@ -486,7 +486,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
486486
desired_action: InitializationRequiringAction,
487487
span: Span,
488488
use_spans: UseSpans<'tcx>,
489-
) -> DiagnosticBuilder<'cx> {
489+
) -> DiagnosticBuilder<'tcx> {
490490
// We need all statements in the body where the binding was assigned to later find all
491491
// the branching code paths where the binding *wasn't* assigned to.
492492
let inits = &self.move_data.init_path_map[mpi];
@@ -880,7 +880,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
880880
location: Location,
881881
(place, _span): (Place<'tcx>, Span),
882882
borrow: &BorrowData<'tcx>,
883-
) -> DiagnosticBuilder<'cx> {
883+
) -> DiagnosticBuilder<'tcx> {
884884
let borrow_spans = self.retrieve_borrow_spans(borrow);
885885
let borrow_span = borrow_spans.args_or_use();
886886

@@ -930,7 +930,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
930930
(place, span): (Place<'tcx>, Span),
931931
gen_borrow_kind: BorrowKind,
932932
issued_borrow: &BorrowData<'tcx>,
933-
) -> DiagnosticBuilder<'cx> {
933+
) -> DiagnosticBuilder<'tcx> {
934934
let issued_spans = self.retrieve_borrow_spans(issued_borrow);
935935
let issued_span = issued_spans.args_or_use();
936936

@@ -2129,7 +2129,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
21292129
drop_span: Span,
21302130
borrow_spans: UseSpans<'tcx>,
21312131
explanation: BorrowExplanation<'tcx>,
2132-
) -> DiagnosticBuilder<'cx> {
2132+
) -> DiagnosticBuilder<'tcx> {
21332133
debug!(
21342134
"report_local_value_does_not_live_long_enough(\
21352135
{:?}, {:?}, {:?}, {:?}, {:?}\
@@ -2304,7 +2304,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
23042304
&mut self,
23052305
drop_span: Span,
23062306
borrow_span: Span,
2307-
) -> DiagnosticBuilder<'cx> {
2307+
) -> DiagnosticBuilder<'tcx> {
23082308
debug!(
23092309
"report_thread_local_value_does_not_live_long_enough(\
23102310
{:?}, {:?}\
@@ -2329,7 +2329,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
23292329
borrow_spans: UseSpans<'tcx>,
23302330
proper_span: Span,
23312331
explanation: BorrowExplanation<'tcx>,
2332-
) -> DiagnosticBuilder<'cx> {
2332+
) -> DiagnosticBuilder<'tcx> {
23332333
if let BorrowExplanation::MustBeValidFor { category, span, from_closure: false, .. } =
23342334
explanation
23352335
{
@@ -2496,7 +2496,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
24962496
return_span: Span,
24972497
category: ConstraintCategory<'tcx>,
24982498
opt_place_desc: Option<&String>,
2499-
) -> Option<DiagnosticBuilder<'cx>> {
2499+
) -> Option<DiagnosticBuilder<'tcx>> {
25002500
let return_kind = match category {
25012501
ConstraintCategory::Return(_) => "return",
25022502
ConstraintCategory::Yield => "yield",
@@ -2591,7 +2591,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
25912591
constraint_span: Span,
25922592
captured_var: &str,
25932593
scope: &str,
2594-
) -> DiagnosticBuilder<'cx> {
2594+
) -> DiagnosticBuilder<'tcx> {
25952595
let tcx = self.infcx.tcx;
25962596
let args_span = use_span.args_or_use();
25972597

@@ -2699,7 +2699,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
26992699
upvar_span: Span,
27002700
upvar_name: Symbol,
27012701
escape_span: Span,
2702-
) -> DiagnosticBuilder<'cx> {
2702+
) -> DiagnosticBuilder<'tcx> {
27032703
let tcx = self.infcx.tcx;
27042704

27052705
let escapes_from = tcx.def_descr(self.mir_def_id().to_def_id());

compiler/rustc_borrowck/src/diagnostics/move_errors.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
288288
&mut self,
289289
place: Place<'tcx>,
290290
span: Span,
291-
) -> DiagnosticBuilder<'a> {
291+
) -> DiagnosticBuilder<'tcx> {
292292
let description = if place.projection.len() == 1 {
293293
format!("static item {}", self.describe_any_place(place.as_ref()))
294294
} else {
@@ -310,7 +310,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
310310
deref_target_place: Place<'tcx>,
311311
span: Span,
312312
use_spans: Option<UseSpans<'tcx>>,
313-
) -> DiagnosticBuilder<'a> {
313+
) -> DiagnosticBuilder<'tcx> {
314314
// Inspect the type of the content behind the
315315
// borrow to provide feedback about why this
316316
// was a move rather than a copy.

compiler/rustc_borrowck/src/diagnostics/outlives_suggestion.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,6 @@ impl OutlivesSuggestionBuilder {
251251
diag.sort_span = mir_span.shrink_to_hi();
252252

253253
// Buffer the diagnostic
254-
mbcx.buffer_non_error_diag(diag);
254+
mbcx.buffer_non_error(diag);
255255
}
256256
}

0 commit comments

Comments
 (0)